Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/tests/compiletest.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,17 @@ problematic in the presence of pointers in constants or other bit width
dependent things. In that case you can add `// EMIT_MIR_FOR_EACH_BIT_WIDTH` to
your test, causing separate files to be generated for 32bit and 64bit systems.

On top of the snapshot-based checks performed on the output requested by `EMIT_MIR`,
the *final runtime MIR*, as emitted by `--emit=mir`, is checked with the LLVM
[FileCheck] tool. For this purpose, your test should be annotated with
`// CHECK` comments to verify the final emitted MIR is properly optimized.

See the [FileCheck] documentation for a tutorial and more information.

Note however, that in some cases, it can also make more sense to skip the FileCheck
step. To do this, add a `// skip-filecheck` annotation instead of the `// CHECK`
comments.

[`tests/mir-opt`]: https://github.com/rust-lang/rust/tree/HEAD/tests/mir-opt


Expand Down
Loading