Add an explainer mode to filecheck.

The -c flag to 'cton-util filecheck' will now print out a description of how
the directives are matching the input.

This explanation is also printed when a match fails.
This commit is contained in:
Jakob Stoklund Olesen
2016-09-09 17:08:29 -07:00
parent 1ce5bc3509
commit 38952eea00
5 changed files with 255 additions and 15 deletions

View File

@@ -2,12 +2,14 @@
function nonsense(i32, i32) -> f32 {
; check: digraph nonsense {
; regex: I=\binst\d+\b
; check: label="{ebb0 | <$(BRZ=$I)>brz ebb2 | <$(JUMP=$I)>jump ebb1}"]
ebb0(v1: i32, v2: i32):
v3 = f64const 0x0.0
brz v2, ebb2 ; unordered: ebb0:inst1 -> ebb2
brz v2, ebb2 ; unordered: ebb0:$BRZ -> ebb2
v4 = iconst.i32 0
jump ebb1(v4) ; unordered: ebb0:inst3 -> ebb1
jump ebb1(v4) ; unordered: ebb0:$JUMP -> ebb1
ebb1(v5: i32):
v6 = imul_imm v5, 4