File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 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 \
136136[ issue #53157 ] : https://github.com/rust-lang/rust/issues/53157
137137[ issue #55036 ] : https://github.com/rust-lang/rust/issues/55036
138138
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+
139160## Custom bisection messages
140161
141162* Available from v0.6.9*
You can’t perform that action at this time.
0 commit comments