File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 1
- // skip-filecheck
2
1
// unit-test: ConstProp
3
- // compile-flags: -O
4
2
5
3
// FIXME(wesleywiser): Ideally, we could const-prop away all of this and just be left with
6
4
// `let x = 42` but that doesn't work because const-prop doesn't support `Operand::Indirect`
10
8
// EMIT_MIR_FOR_EACH_BIT_WIDTH
11
9
// EMIT_MIR discriminant.main.ConstProp.diff
12
10
fn main ( ) {
11
+ // CHECK-LABEL: fn main(
12
+ // CHECK: bb0: {
13
+ // CHECK: switchInt(const 1_isize) -> [1: bb1, otherwise: bb3];
14
+ // CHECK: bb1: {
15
+ // CHECK: switchInt(const true) -> [0: bb3, otherwise: bb2];
16
+ // CHECK: bb2: {
17
+ // CHECK: [[tmp:_.*]] = const 42_i32;
18
+ // CHECK: goto -> bb4;
19
+ // CHECK: bb3: {
20
+ // CHECK: [[tmp]] = const 10_i32;
21
+ // CHECK: goto -> bb4;
22
+ // CHECK: bb4: {
23
+ // CHECK: {{_.*}} = Add(move [[tmp]], const 0_i32);
13
24
let x = ( if let Some ( true ) = Some ( true ) { 42 } else { 10 } ) + 0 ;
14
25
}
You can’t perform that action at this time.
0 commit comments