Files
wasmtime/tests/parser/branch.cton.ref
Jakob Stoklund Olesen 20fc675fc0 Parse the BranchTable instruction format.
Resolve the jump table reference immediately since all jump tables are declared
in the preamble.
2016-07-22 15:16:14 -07:00

58 lines
721 B
Plaintext

function minimal() {
ebb0:
jump ebb1
ebb1:
jump ebb0
}
function onearg(i32) {
ebb0(vx0: i32):
jump ebb1(vx0)
ebb1(vx1: i32):
jump ebb0(vx1)
}
function twoargs(i32, f32) {
ebb0(vx0: i32, vx1: f32):
jump ebb1(vx0, vx1)
ebb1(vx2: i32, vx3: f32):
jump ebb0(vx2, vx3)
}
function minimal(i32) {
ebb0(vx0: i32):
brz vx0, ebb1
ebb1:
brnz vx0, ebb1
}
function twoargs(i32, f32) {
ebb0(vx0: i32, vx1: f32):
brz vx0, ebb1(vx0, vx1)
ebb1(vx2: i32, vx3: f32):
brnz vx0, ebb0(vx2, vx3)
}
function jumptable(i32) {
jt0 = jump_table 0
jt1 = jump_table 0, 0, ebb0, ebb3, ebb1, ebb2
ebb0(vx0: i32):
br_table vx0, jt1
trap
ebb1:
trap
ebb2:
trap
ebb3:
trap
}