mirror of https://github.com/llvm/torch-mlir
Add test showing argument type inference.
parent
917fd94f94
commit
c84ce17573
|
@ -7,6 +7,7 @@ def import_global(f):
|
|||
fe = ImportFrontend()
|
||||
fe.import_global_function(f)
|
||||
print(fe.ir_module.to_asm())
|
||||
print("// -----")
|
||||
return f
|
||||
|
||||
# CHECK-LABEL: func @arithmetic_expression
|
||||
|
@ -19,3 +20,13 @@ def arithmetic_expression():
|
|||
# CHECK: basicpy.unknown_cast{{.*}} : i64 -> i64
|
||||
# CHECK: return{{.*}} : i64
|
||||
return 1 + 2 - 3 * 4
|
||||
|
||||
# CHECK-LABEL: func @arg_inference
|
||||
# CHECK-SAME: (%arg0: i64, %arg1: i64) -> i64
|
||||
@import_global
|
||||
def arg_inference(a, b):
|
||||
# CHECK: basicpy.binary_expr{{.*}} : (i64, i64) -> i64
|
||||
# CHECK: basicpy.binary_expr{{.*}} : (i64, i64) -> i64
|
||||
# CHECK: basicpy.unknown_cast{{.*}} : i64 -> i64
|
||||
# CHECK: return{{.*}} : i64
|
||||
return a + 2 * b
|
||||
|
|
Loading…
Reference in New Issue