]> git.lizzy.rs Git - rust.git/blob - tests/codegen/README.md
Rollup merge of #107731 - RalfJung:interpret-discriminant, r=cjgillot
[rust.git] / tests / codegen / README.md
1 The files here use the LLVM FileCheck framework, documented at
2 <https://llvm.org/docs/CommandGuide/FileCheck.html>.
3
4 One extension worth noting is the use of revisions as custom prefixes for
5 FileCheck. If your codegen test has different behavior based on the chosen
6 target or different compiler flags that you want to exercise, you can use a
7 revisions annotation, like so:
8
9 ```rust
10 // revisions: aaa bbb
11 // [bbb] compile-flags: --flags-for-bbb
12 ```
13
14 After specifying those variations, you can write different expected, or
15 explicitly *unexpected* output by using `<prefix>-SAME:` and `<prefix>-NOT:`,
16 like so:
17
18 ```rust
19 // CHECK: expected code
20 // aaa-SAME: emitted-only-for-aaa
21 // aaa-NOT:                        emitted-only-for-bbb
22 // bbb-NOT:  emitted-only-for-aaa
23 // bbb-SAME:                       emitted-only-for-bbb
24 ```