Skip to content

Commit 7a9159b

Browse files
committed
Bless mir opt tests and remove some broken custom MIR
1 parent 74cde5f commit 7a9159b

File tree

3 files changed

+11
-16
lines changed

3 files changed

+11
-16
lines changed

tests/mir-opt/dataflow-const-prop/enum.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn statics() {
6262

6363
static RC: &E = &E::V2(4);
6464

65-
// CHECK: [[t:_.*]] = const {alloc2: &&E};
65+
// CHECK: [[t:_.*]] = const {alloc4: &&E};
6666
// CHECK: [[e2]] = (*[[t]]);
6767
let e2 = RC;
6868

tests/mir-opt/instsimplify/combine_transmutes.integer_transmutes.InstSimplify.diff

+5-9
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,15 @@
55
let mut _0: ();
66
let mut _1: u32;
77
let mut _2: i64;
8-
let mut _3: i64;
9-
let mut _4: u32;
10-
let mut _5: usize;
8+
let mut _3: usize;
119

1210
bb0: {
1311
- _1 = const 1_i32 as u32 (Transmute);
12+
- _2 = const 1_u64 as i64 (Transmute);
13+
- _3 = const 1_isize as usize (Transmute);
1414
+ _1 = const 1_i32 as u32 (IntToInt);
15-
_2 = const 1_i32 as i64 (Transmute);
16-
- _3 = const 1_u64 as i64 (Transmute);
17-
+ _3 = const 1_u64 as i64 (IntToInt);
18-
_4 = const 1_u64 as u32 (Transmute);
19-
- _5 = const 1_isize as usize (Transmute);
20-
+ _5 = const 1_isize as usize (IntToInt);
15+
+ _2 = const 1_u64 as i64 (IntToInt);
16+
+ _3 = const 1_isize as usize (IntToInt);
2117
return;
2218
}
2319
}

tests/mir-opt/instsimplify/combine_transmutes.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#![feature(custom_mir)]
77

88
use std::intrinsics::mir::*;
9-
use std::mem::{MaybeUninit, ManuallyDrop, transmute};
9+
use std::mem::{transmute, ManuallyDrop, MaybeUninit};
1010

1111
// EMIT_MIR combine_transmutes.identity_transmutes.InstSimplify.diff
1212
pub unsafe fn identity_transmutes() {
@@ -25,19 +25,15 @@ pub unsafe fn integer_transmutes() {
2525
// CHECK-LABEL: fn integer_transmutes(
2626
// CHECK-NOT: _i32 as u32 (Transmute);
2727
// CHECK: _i32 as u32 (IntToInt);
28-
// CHECK: _i32 as i64 (Transmute);
2928
// CHECK-NOT: _u64 as i64 (Transmute);
3029
// CHECK: _u64 as i64 (IntToInt);
31-
// CHECK: _u64 as u32 (Transmute);
3230
// CHECK-NOT: _isize as usize (Transmute);
3331
// CHECK: _isize as usize (IntToInt);
3432

3533
mir! {
3634
{
3735
let A = CastTransmute::<i32, u32>(1); // Can be a cast
38-
let B = CastTransmute::<i32, i64>(1); // UB
3936
let C = CastTransmute::<u64, i64>(1); // Can be a cast
40-
let D = CastTransmute::<u64, u32>(1); // UB
4137
let E = CastTransmute::<isize, usize>(1); // Can be a cast
4238
Return()
4339
}
@@ -62,4 +58,7 @@ pub unsafe fn adt_transmutes() {
6258
let _a: ManuallyDrop<String> = transmute(MaybeUninit::<String>::uninit());
6359
}
6460

65-
pub union Union32 { u32: u32, i32: i32 }
61+
pub union Union32 {
62+
u32: u32,
63+
i32: i32,
64+
}

0 commit comments

Comments
 (0)