Files
wasmtime/cranelift/filetests/filetests/runtests/call.clif
Trevor Elliott 32a7593c94 cranelift: Remove booleans (#5031)
Remove the boolean types from cranelift, and the associated instructions breduce, bextend, bconst, and bint. Standardize on using 1/0 for the return value from instructions that produce scalar boolean results, and -1/0 for boolean vector elements.

Fixes #3205

Co-authored-by: Afonso Bordado <afonso360@users.noreply.github.com>
Co-authored-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Co-authored-by: Chris Fallin <chris@cfallin.org>
2022-10-17 16:00:27 -07:00

90 lines
1.5 KiB
Plaintext

test interpret
test run
target x86_64
target aarch64
target aarch64 sign_return_address
target aarch64 has_pauth sign_return_address
target s390x
function %callee_i64(i64) -> i64 {
block0(v0: i64):
v1 = iadd_imm.i64 v0, 10
return v1
}
function %call_i64(i64) -> i64 {
fn0 = %callee_i64(i64) -> i64
block0(v0: i64):
v1 = call fn0(v0)
return v1
}
; run: %call_i64(10) == 20
function %colocated_i64(i64) -> i64 {
fn0 = colocated %callee_i64(i64) -> i64
block0(v0: i64):
v1 = call fn0(v0)
return v1
}
; run: %colocated_i64(10) == 20
function %callee_f64(f64) -> f64 {
block0(v0: f64):
v1 = f64const 0x10.0
v2 = fadd.f64 v0, v1
return v2
}
function %call_f64(f64) -> f64 {
fn0 = %callee_f64(f64) -> f64
block0(v0: f64):
v1 = call fn0(v0)
return v1
}
; run: %call_f64(0x10.0) == 0x20.0
function %callee_i8(i8) -> i8 {
block0(v0: i8):
v1 = iconst.i8 0
v2 = icmp eq v0, v1
return v2
}
function %call_i8(i8) -> i8 {
fn0 = %callee_i8(i8) -> i8
block0(v0: i8):
v1 = call fn0(v0)
return v1
}
; run: %call_i8(1) == 0
; run: %call_i8(0) == 1
; Tests calling across different calling conventions
function %callee_wasm_i64(i64) -> i64 wasmtime_system_v {
block0(v0: i64):
v1 = iadd_imm.i64 v0, 10
return v1
}
function %call_sysv_i64(i64) -> i64 system_v {
fn0 = %callee_wasm_i64(i64) -> i64 wasmtime_system_v
block0(v0: i64):
v1 = call fn0(v0)
return v1
}
; run: %call_sysv_i64(10) == 20