Files
wasmtime/cranelift/filetests/cfg/traps_early.cton
Jakob Stoklund Olesen 7d5f2f0404 Convert the CFG traversal tests to file tests.
Add a "cfg_postorder:" printout to the "test domtree" file tests and use
that to check the computed CFG post-order instead of doing it manually
with Rust code.
2017-12-08 13:58:18 -08:00

22 lines
564 B
Plaintext

; For testing cfg generation. This code explores the implications of encountering
; a terminating instruction before any connections have been made.
test print-cfg
test verifier
function %nonsense(i32) {
; check: digraph "%nonsense" {
ebb0(v1: i32):
trap user0 ; error: terminator instruction was encountered before the end
brnz v1, ebb2 ; unordered: ebb0:inst1 -> ebb2
jump ebb1 ; unordered: ebb0:inst2 -> ebb1
ebb1:
v2 = iconst.i32 0
v3 = iadd v1, v3
jump ebb0(v3) ; unordered: ebb1:inst5 -> ebb0
ebb2:
return v1
}