Skip to content

Commit bf5d114

Browse files
committed
FileCheck discriminant.
1 parent 043d29b commit bf5d114

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed
+13-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// skip-filecheck
21
// unit-test: ConstProp
3-
// compile-flags: -O
42

53
// FIXME(wesleywiser): Ideally, we could const-prop away all of this and just be left with
64
// `let x = 42` but that doesn't work because const-prop doesn't support `Operand::Indirect`
@@ -10,5 +8,18 @@
108
// EMIT_MIR_FOR_EACH_BIT_WIDTH
119
// EMIT_MIR discriminant.main.ConstProp.diff
1210
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);
1324
let x = (if let Some(true) = Some(true) { 42 } else { 10 }) + 0;
1425
}

0 commit comments

Comments
 (0)