Implement the 'test print-cfg' sub-test.
Move the CFG tests into the filetests directory. Remove the tests directory, there are no more shell-driven tests left.
This commit is contained in:
21
filetests/cfg/unused_node.cton
Normal file
21
filetests/cfg/unused_node.cton
Normal file
@@ -0,0 +1,21 @@
|
||||
; For testing cfg generation where some block is never reached.
|
||||
test print-cfg
|
||||
|
||||
function not_reached(i32) -> i32 {
|
||||
; check: digraph not_reached {
|
||||
; check: ebb0 [shape=record, label="{ebb0 | <inst0>brnz ebb2}"]
|
||||
; check: ebb1 [shape=record, label="{ebb1 | <inst4>jump ebb0}"]
|
||||
; check: ebb2 [shape=record, label="{ebb2}"]
|
||||
|
||||
ebb0(v0: i32):
|
||||
brnz v0, ebb2 ; unordered: ebb0:inst0 -> ebb2
|
||||
trap
|
||||
|
||||
ebb1:
|
||||
v1 = iconst.i32 1
|
||||
v2 = iadd v0, v1
|
||||
jump ebb0(v2) ; unordered: ebb1:inst4 -> ebb0
|
||||
|
||||
ebb2:
|
||||
return v0
|
||||
}
|
||||
Reference in New Issue
Block a user