Add test showing argument type inference.

pull/1/head
Stella Laurenzo 2020-06-10 19:23:01 -07:00
parent 917fd94f94
commit c84ce17573
1 changed files with 11 additions and 0 deletions

View File

@ -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