mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Auto merge of #154802 - matthiaskrgr:rollup-HWNmEyC, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - rust-lang/rust#154376 (Remove more BuiltinLintDiag variants - part 4) - rust-lang/rust#154731 (llvm: Fix array ABI test to not check equality implementation) - rust-lang/rust#127534 (feat(core): impl Step for NonZero<u*>) - rust-lang/rust#154703 (Fix trailing comma in lifetime suggestion for empty angle brackets) - rust-lang/rust#154776 (Fix ICE in read_discriminant for enums with non-contiguous discriminants)
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
//@ revisions: llvm-current llvm-next
|
||||
//@[llvm-current] ignore-llvm-version: 23-99
|
||||
//@[llvm-next] min-llvm-version: 23
|
||||
//@ compile-flags: -Copt-level=3 -Z merge-functions=disabled
|
||||
//@ only-x86_64
|
||||
#![crate_type = "lib"]
|
||||
@@ -26,9 +29,18 @@
|
||||
#[no_mangle]
|
||||
pub fn array_eq_value_still_passed_by_pointer(a: [u16; 9], b: [u16; 9]) -> bool {
|
||||
// CHECK-NEXT: start:
|
||||
// CHECK: %[[CMP:.+]] = tail call i32 @{{bcmp|memcmp}}(ptr {{.*}} dereferenceable(18) %{{.+}}, ptr {{.*}} dereferenceable(18) %{{.+}}, i64 18)
|
||||
// CHECK-NEXT: %[[EQ:.+]] = icmp eq i32 %[[CMP]], 0
|
||||
// CHECK-NEXT: ret i1 %[[EQ]]
|
||||
// CHECK-NOT: alloca
|
||||
// llvm-current-NEXT: %[[CMP:.+]] = tail call i32 @{{bcmp|memcmp}}(ptr
|
||||
// llvm-current-SAME: {{.*}} dereferenceable(18) %{{.+}}, ptr {{.*}} dereferenceable(18)
|
||||
// llvm-current-SAME: %{{.+}}, i64 18)
|
||||
// llvm-current-NEXT: %[[EQ:.+]] = icmp eq i32 %[[CMP]], 0
|
||||
// llvm-current-NEXT: ret i1 %[[EQ]]
|
||||
// CHECK-NOT: call
|
||||
// New LLVM expands the bcmp earlier, so this becomes wide reads + icmp
|
||||
// No allocas or calls, and at least one icmp
|
||||
// llvm-next: icmp
|
||||
// CHECK-NOT: alloca
|
||||
// CHECK-NOT: call
|
||||
a == b
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user