File tree 3 files changed +17
-9
lines changed
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
2
2
3
3
pub fn main ( ) {
4
4
Original file line number Diff line number Diff line change 1
- // compile-flags: -O
1
+ // compile-flags: -O -Zmerge-functions=disabled
2
2
// ignore-x86
3
3
// ignore-arm
4
4
// ignore-emscripten
5
5
// ignore-gnux32
6
6
// ignore 32-bit platforms (LLVM has a bug with them)
7
7
8
- // See issue #37945.
8
+ // Check that LLVM understands that `Iter` pointer is not null. Issue #37945.
9
9
10
10
#![ crate_type = "lib" ]
11
11
12
12
use std:: slice:: Iter ;
13
13
14
- // CHECK-LABEL: @is_empty_1
15
14
#[ no_mangle]
16
15
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:%.*]]
18
22
{ xs} . next ( ) . is_none ( )
19
23
}
20
24
21
- // CHECK-LABEL: @is_empty_2
22
25
#[ no_mangle]
23
26
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:%.*]]
25
33
xs. map ( |& x| x) . next ( ) . is_none ( )
26
34
}
Original file line number Diff line number Diff line change @@ -15,9 +15,9 @@ pub fn shrink_to_fit(vec: &mut Vec<u32>) {
15
15
16
16
// CHECK-LABEL: @issue71861
17
17
#[ no_mangle]
18
- pub fn issue71861 ( n : usize ) -> Box < [ u32 ] > {
18
+ pub fn issue71861 ( vec : Vec < u32 > ) -> Box < [ u32 ] > {
19
19
// CHECK-NOT: panic
20
- vec ! [ 0 ; n ] . into_boxed_slice ( )
20
+ vec. into_boxed_slice ( )
21
21
}
22
22
23
23
// CHECK-LABEL: @issue75636
You can’t perform that action at this time.
0 commit comments