def testSelectOp(self): self.setUp() with self.module.function_context("foo", [self.boolType], [self.i32Type]) as fun: a = E.constant_int(42, 32) b = E.constant_int(0, 32) E.ret([E.select(fun.arg(0), a, b)]) printWithCurrentFunctionName(str(fun))
def testSelectOp(self): with self.module.function_context("foo", [self.boolType], [self.i32Type]) as fun: a = E.constant_int(42, 32) b = E.constant_int(0, 32) E.ret([E.select(fun.arg(0), a, b)]) code = str(fun) self.assertIn("%0 = select %arg0, %c42_i32, %c0_i32 : i32", code)