Files
wasmtime/cranelift/tests/parser/branch.cton.ref
Jakob Stoklund Olesen f054d32f50 Implement jump tables.
- Add a ir::jumptable module with a JumpTableData struct representing the vector
  of destinations.
- Add an entity map of jump tables to the Function.
- Parse and write jump tables in the function preamble.
- Rewrite EBB references in jumptables after parsing.
2016-07-22 14:48:53 -07:00

57 lines
686 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() {
jt0 = jump_table 0
jt1 = jump_table 0, 0, ebb0, ebb3, ebb1, ebb2
ebb0:
trap
ebb1:
trap
ebb2:
trap
ebb3:
trap
}