File tree Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Original file line number Diff line number Diff line change 1- // compile-flags: -C no-prepopulate-passes
1+ // compile-flags: -C no-prepopulate-passes -Zmir-opt-level=0
22
33pub fn main ( ) {
44
Original file line number Diff line number Diff line change 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
1212use std:: slice:: Iter ;
1313
14- // CHECK-LABEL: @is_empty_1
1514#[ no_mangle]
1615pub 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]
2326pub 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}
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments