File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,18 @@ presence of pointers in constants or other bit width dependent things. In that c
1414
1515to your test, causing separate files to be generated for 32bit and 64bit systems.
1616
17+ ## Unit testing
18+
19+ If you are only testing the behavior of a particular mir-opt pass on some specific input (as is
20+ usually the case), you should add
21+
22+ ```
23+ // unit-test: PassName
24+ ```
25+
26+ to the top of the file. This makes sure that other passes don't run which means you'll get the input
27+ you expected and your test won't break when other code changes.
28+
1729## Emit a diff of the mir for a specific optimization
1830
1931This is what you want most often when you want to see how an optimization changes the MIR.
You can’t perform that action at this time.
0 commit comments