File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -49,3 +49,19 @@ This exists mainly for completeness and is rarely useful.
49
49
```
50
50
// EMIT_MIR $file_name_of_some_mir_dump.before.mir
51
51
```
52
+
53
+ # FileCheck directives
54
+
55
+ The LLVM FileCheck tool is used to verify the contents of output MIR against ` CHECK ` directives
56
+ present in the test file. This works on the runtime MIR, generated by ` --emit=mir ` , and not
57
+ on the output of a individual passes.
58
+
59
+ To check MIR for function ` foo ` , start with a ` // CHECK-LABEL fn foo( ` directive.
60
+
61
+ ` {{regex}} ` syntax allows to match ` regex ` .
62
+
63
+ ` [[name:regex]] ` syntax allows to bind ` name ` to a string matching ` regex ` , and refer to it
64
+ as ` [[name]] ` in later directives, ` regex ` should be written not to match a leading space.
65
+ Use ` [[my_local:_.*]] ` to name a local, and ` [[my_bb:bb.*]] ` to name a block.
66
+
67
+ Documentation for FileCheck is available here: https://www.llvm.org/docs/CommandGuide/FileCheck.html
You can’t perform that action at this time.
0 commit comments