Skip to content

Commit f960f28

Browse files
authored
Rollup merge of #78967 - tmiasko:codegen-tests, r=cuviper
Make codegen tests compatible with extra inlining
2 parents d6da525 + d54ea4f commit f960f28

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

src/test/codegen/internalize-closures.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -C no-prepopulate-passes
1+
// compile-flags: -C no-prepopulate-passes -Zmir-opt-level=0
22

33
pub fn main() {
44

src/test/codegen/issue-37945.rs

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
1-
// compile-flags: -O
1+
// compile-flags: -O -Zmerge-functions=disabled
22
// ignore-x86
33
// ignore-arm
44
// ignore-emscripten
55
// ignore-gnux32
66
// ignore 32-bit platforms (LLVM has a bug with them)
77

8-
// See issue #37945.
8+
// Check that LLVM understands that `Iter` pointer is not null. Issue #37945.
99

1010
#![crate_type = "lib"]
1111

1212
use std::slice::Iter;
1313

14-
// CHECK-LABEL: @is_empty_1
1514
#[no_mangle]
1615
pub fn is_empty_1(xs: Iter<f32>) -> bool {
17-
// CHECK-NOT: icmp eq float* {{.*}}, null
16+
// CHECK-LABEL: @is_empty_1(
17+
// CHECK-NEXT: start:
18+
// CHECK-NEXT: [[A:%.*]] = icmp ne i32* %xs.1, null
19+
// CHECK-NEXT: tail call void @llvm.assume(i1 [[A]])
20+
// CHECK-NEXT: [[B:%.*]] = icmp eq i32* %xs.0, %xs.1
21+
// CHECK-NEXT: ret i1 [[B:%.*]]
1822
{xs}.next().is_none()
1923
}
2024

21-
// CHECK-LABEL: @is_empty_2
2225
#[no_mangle]
2326
pub fn is_empty_2(xs: Iter<f32>) -> bool {
24-
// CHECK-NOT: icmp eq float* {{.*}}, null
27+
// CHECK-LABEL: @is_empty_2
28+
// CHECK-NEXT: start:
29+
// CHECK-NEXT: [[C:%.*]] = icmp ne i32* %xs.1, null
30+
// CHECK-NEXT: tail call void @llvm.assume(i1 [[C]])
31+
// CHECK-NEXT: [[D:%.*]] = icmp eq i32* %xs.0, %xs.1
32+
// CHECK-NEXT: ret i1 [[D:%.*]]
2533
xs.map(|&x| x).next().is_none()
2634
}

src/test/codegen/vec-shrink-panic.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ pub fn shrink_to_fit(vec: &mut Vec<u32>) {
1515

1616
// CHECK-LABEL: @issue71861
1717
#[no_mangle]
18-
pub fn issue71861(n: usize) -> Box<[u32]> {
18+
pub fn issue71861(vec: Vec<u32>) -> Box<[u32]> {
1919
// CHECK-NOT: panic
20-
vec![0; n].into_boxed_slice()
20+
vec.into_boxed_slice()
2121
}
2222

2323
// CHECK-LABEL: @issue75636

0 commit comments

Comments
 (0)