Fix legalize-br-table test case for basic blocks. (#990)
This commit is contained in:
committed by
Sean Stangl
parent
891944dba1
commit
592f5445dd
@@ -0,0 +1,31 @@
|
|||||||
|
test compile
|
||||||
|
target x86_64
|
||||||
|
feature "basic-blocks"
|
||||||
|
; regex: V=v\d+
|
||||||
|
; regex: EBB=ebb\d+
|
||||||
|
|
||||||
|
function u0:0(i64) system_v {
|
||||||
|
ss0 = explicit_slot 1
|
||||||
|
jt0 = jump_table [ebb1]
|
||||||
|
|
||||||
|
ebb0(v0: i64):
|
||||||
|
v1 = stack_addr.i64 ss0
|
||||||
|
v2 = load.i8 v1
|
||||||
|
br_table v2, ebb2, jt0
|
||||||
|
; check: $(oob=$V) = ifcmp_imm $(idx=$V), 1
|
||||||
|
; ebb2 is replaced by ebb1 by fold_redundant_jump
|
||||||
|
; nextln: brif uge $oob, ebb1
|
||||||
|
; nextln: fallthrough $(inb=$EBB)
|
||||||
|
; check: $inb:
|
||||||
|
; nextln: $(final_idx=$V) = uextend.i64 $idx
|
||||||
|
; nextln: $(base=$V) = jump_table_base.i64 jt0
|
||||||
|
; nextln: $(rel_addr=$V) = jump_table_entry $final_idx, $base, 4, jt0
|
||||||
|
; nextln: $(addr=$V) = iadd $base, $rel_addr
|
||||||
|
; nextln: indirect_jump_table_br $addr, jt0
|
||||||
|
|
||||||
|
ebb2:
|
||||||
|
jump ebb1
|
||||||
|
|
||||||
|
ebb1:
|
||||||
|
return
|
||||||
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
test compile
|
test compile
|
||||||
|
|
||||||
target x86_64
|
target x86_64
|
||||||
feature !"basic-blocks"
|
feature !"basic-blocks"
|
||||||
; regex: V=v\d+
|
; regex: V=v\d+
|
||||||
|
|||||||
Reference in New Issue
Block a user