The tests for the SIMD floating-point maximum and minimum operations require particular care because the handling of the NaN values is non-deterministic and may vary between platforms. There is no way to match several NaN values in a test, so the solution is to extract the non-deterministic test cases into a separate file that is subsequently replicated for every backend under test, with adjustments made to the expected results. Copyright (c) 2021, Arm Limited.
66 lines
953 B
Plaintext
66 lines
953 B
Plaintext
; Test basic code generation for control flow WebAssembly instructions.
|
|
test compile
|
|
|
|
target aarch64
|
|
target i686 haswell
|
|
target x86_64 haswell
|
|
|
|
function %br_if(i32) -> i32 {
|
|
block0(v0: i32):
|
|
v1 = iconst.i32 1
|
|
brz v0, block1(v1)
|
|
jump block2
|
|
|
|
block1(v2: i32):
|
|
return v2
|
|
|
|
block2:
|
|
jump block1(v0)
|
|
}
|
|
|
|
function %br_if_not(i32) -> i32 {
|
|
block0(v0: i32):
|
|
v1 = iconst.i32 1
|
|
brnz v0, block1(v0)
|
|
jump block2
|
|
|
|
block1(v2: i32):
|
|
return v2
|
|
|
|
block2:
|
|
jump block1(v0)
|
|
}
|
|
|
|
function %br_if_fallthrough(i32) -> i32 {
|
|
block0(v0: i32):
|
|
v1 = iconst.i32 1
|
|
brz v0, block1(v1)
|
|
; This jump gets converted to a fallthrough.
|
|
jump block1(v0)
|
|
|
|
block1(v2: i32):
|
|
return v2
|
|
}
|
|
|
|
function %undefined() {
|
|
block0:
|
|
trap user0
|
|
}
|
|
|
|
function %br_table(i32) {
|
|
jt0 = jump_table [block3, block1, block2]
|
|
|
|
block0(v0: i32):
|
|
br_table v0, block4, jt0
|
|
|
|
block4:
|
|
trap heap_oob
|
|
|
|
block1:
|
|
return
|
|
block2:
|
|
return
|
|
block3:
|
|
return
|
|
}
|