File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,27 @@ cargo bisect-rustc --script=./test.sh \
136
136
[ issue #53157 ] : https://github.com/rust-lang/rust/issues/53157
137
137
[ issue #55036 ] : https://github.com/rust-lang/rust/issues/55036
138
138
139
+ ## Testing with LLVM FileCheck
140
+
141
+ If you want to investigate a regression in codegen, you can use LLVM's FileCheck. You can write a library containing FileCheck annotations:
142
+
143
+ ``` rs
144
+ // CHECK-LABEL: @wildcard(
145
+ #[no_mangle]
146
+ pub fn wildcard (a : u16 , b : u16 , v : u16 ) -> u16 {
147
+ // CHECK-NOT: br
148
+ match (a == v , b == v ) {
149
+ (true , false ) => 0 ,
150
+ (false , true ) => u16 :: MAX ,
151
+ _ => 1 << 15 , // half
152
+ }
153
+ }
154
+ ```
155
+
156
+ To investigate when ` br ` stopped being emitted, you can use ` cargo-bisect-rustc --start 1.70.0 --filecheck src/lib.rs --preserve --regress success ` .
157
+
158
+ By default, this will compile with ` cargo rustc -- -Copt-level=3 -Cdebuginfo=0 --emit=llvm-ir=<target dir>/debug/deps/output.ll ` .
159
+
139
160
## Custom bisection messages
140
161
141
162
* Available from v0.6.9*
You can’t perform that action at this time.
0 commit comments