* Fix verifier printing to print instruction encodings consistently. Use `FuncWriter::write_instruction` for all instructions so that encodings are printed consistently. * Make use-before-def errors mention the relevant value. * When there are verifier errors, print a message at the end. * Make verifier errors prettier. Fix the length of the "^~~~~" to match the printed entity, and print the error messsage on its own line. * Clean up "test verifier" failure messages. * Tidy the uses-value-from-itself error. The use instruction is the same as the def instruction, so don't print both. Also, the use instruction is already being printed at the beginning, so don't print it again at the end.
17 lines
396 B
Plaintext
17 lines
396 B
Plaintext
test verifier
|
|
|
|
; Test verification that uses properly dominate defs.
|
|
|
|
function %non_dominating(i32) -> i32 system_v {
|
|
ebb0(v0: i32):
|
|
v1 = iadd.i32 v2, v0 ; error: uses value v2 from non-dominating
|
|
v2 = iadd.i32 v1, v0
|
|
return v2
|
|
}
|
|
|
|
function %inst_uses_its_own_values(i32) -> i32 system_v {
|
|
ebb0(v0: i32):
|
|
v1 = iadd.i32 v1, v0 ; error: uses value v1 from itself
|
|
return v1
|
|
}
|