Files
wasmtime/cranelift/filetests/filetests/wasm/multi-val-i32.clif
2020-06-03 13:31:34 -07:00

46 lines
885 B
Plaintext

test compile
target x86_64 haswell
target aarch64
;; Returning many i32s
function %return_2_i32s() -> i32, i32 {
block0:
v0 = iconst.i32 0
v1 = iconst.i32 1
return v0, v1
}
function %return_3_i32s() -> i32, i32, i32 {
block0:
v0 = iconst.i32 0
v1 = iconst.i32 1
v2 = iconst.i32 2
return v0, v1, v2
}
function %return_4_i32s() -> i32, i32, i32, i32 {
block0:
v0 = iconst.i32 0
v1 = iconst.i32 1
v2 = iconst.i32 2
v3 = iconst.i32 3
return v0, v1, v2, v3
}
;; Calling functions that return many i32s
function %call() -> i32 {
fn0 = %a() -> i32, i32
fn1 = %b(i32, i32) -> i32, i32, i32
fn2 = %c(i32, i32, i32) -> i32, i32, i32, i32
block0:
v0, v1 = call fn0()
v2, v3, v4 = call fn1(v0, v1)
v5, v6, v7, v8 = call fn2(v2, v3, v4)
v9 = iadd v5, v6
v10 = iadd v7, v8
v11 = iadd v9, v10
return v11
}