Skip to content

Commit

Permalink
Mention unit-test in MIR opt test README
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobDegen committed Aug 9, 2022
1 parent 9ee22ff commit 6ae1c03
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/mir-opt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ presence of pointers in constants or other bit width dependent things. In that c

to your test, causing separate files to be generated for 32bit and 64bit systems.

## Unit testing

If you are only testing the behavior of a particular mir-opt pass on some specific input (as is
usually the case), you should add

```
// unit-test: PassName
```

to the top of the file. This makes sure that other passes don't run which means you'll get the input
you expected and your test won't break when other code changes.

## Emit a diff of the mir for a specific optimization

This is what you want most often when you want to see how an optimization changes the MIR.
Expand Down

0 comments on commit 6ae1c03

Please sign in to comment.