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
14
14
15
15
to your test, causing separate files to be generated for 32bit and 64bit systems.
16
16
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
+
17
29
## Emit a diff of the mir for a specific optimization
18
30
19
31
This 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