1 This folder contains tests for MIR optimizations.
3 The `mir-opt` test format emits MIR to extra files that you can automatically update by specifying
4 `--bless` on the command line (just like `ui` tests updating `.stderr` files).
6 # `--bless`able test format
8 By default 32 bit and 64 bit targets use the same dump files, which can be problematic in the
9 presence of pointers in constants or other bit width dependent things. In that case you can add
12 // EMIT_MIR_FOR_EACH_BIT_WIDTH
15 to your test, causing separate files to be generated for 32bit and 64bit systems.
17 ## Emit a diff of the mir for a specific optimization
19 This is what you want most often when you want to see how an optimization changes the MIR.
22 // EMIT_MIR $file_name_of_some_mir_dump.diff
25 ## Emit mir after a specific optimization
27 Use this if you are just interested in the final state after an optimization.
30 // EMIT_MIR $file_name_of_some_mir_dump.after.mir
33 ## Emit mir before a specific optimization
35 This exists mainly for completeness and is rarely useful.
38 // EMIT_MIR $file_name_of_some_mir_dump.before.mir