code: def test_const_fold():
      def check(f, *args):
          x = f(*[tvm.tir.const(x, "int32") for x in args])
          y = f(*args)
          if not isinstance(x, (tvm.tir.IntImm,)) or x.value != int(y):
              raise ValueError("check error: %s vs %s " % (x, y))
  
      tmod = tvm.tir.truncmod
      check(lambda x, y: x + y, 3, 4)
      check(lambda x, y: x * y, 3, 12)
      check(lambda x, y: x * y - 10, 3, 12)
      check(lambda x, y: x - tmod(y, 10), 3, 12)
      check(lambda x, y: x // y + 10, 100, 12)
      check(lambda x, y: x & y + 10, 112, 128)
      check(lambda x, y: x > y, 112, 128)
      check(lambda x, y: x < y, 112, 128)
      check(lambda x, y: x <= y, 112, 128)
      check(lambda x, y: x >= y, 112, 128)
      check(lambda x, y: (x | y) ^ 10, 112, 128)
  
file_path: tvm/tests/python/tir-base/test_tir_ops.py
imports: import tvm
  import tvm.testing
  from tvm import te
  import pytest
label_desc: Use image node_id 2 for calling a global function with example usage: test_const_fold() without return types