Skip to content

Commit f29b6b8

Browse files
change test to check for bcmp
1 parent c7daf18 commit f29b6b8

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// compile-flags: -C opt-level=3
2+
3+
#![crate_type = "lib"]
4+
5+
// #71602: check that slice equality just generates a single bcmp
6+
7+
// CHECK-LABEL: @is_zero_slice
8+
#[no_mangle]
9+
pub fn is_zero_slice(data: &[u8; 4]) -> bool {
10+
// CHECK: start:
11+
// CHECK-NEXT: %{{.+}} = getelementptr {{.+}}
12+
// CHECK-NEXT: %[[BCMP:.+]] = tail call i32 @bcmp({{.+}})
13+
// CHECK-NEXT: %[[EQ:.+]] = icmp eq i32 %[[BCMP]], 0
14+
// CHECK-NEXT: ret i1 %[[EQ]]
15+
*data == [0; 4]
16+
}

src/test/codegen/slice-ref-ptr-check.rs

-12
This file was deleted.

0 commit comments

Comments
 (0)