FileCheck aggregate. · rust-lang/rust@6564bac (original) (raw)

Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
1 -// skip-filecheck
2 1 // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
3 2 // unit-test: ConstProp
4 3 // compile-flags: -O
5 4
6 5 // EMIT_MIR aggregate.main.ConstProp.diff
7 -// EMIT_MIR aggregate.main.PreCodegen.after.mir
8 6 fn main() {
7 +// CHECK-LABEL: fn main(
8 +// CHECK: debug x => [[x:_.*]];
9 +// CHECK-NOT: = Add(
10 +// CHECK: [[x]] = const 1_u8;
11 +// CHECK-NOT: = Add(
12 +// CHECK: foo(const 1_u8)
9 13 let x = (0, 1, 2).1 + 0;
10 14 foo(x);
11 15 }
12 16
17 +// Verify that we still propagate if part of the aggregate is not known.
13 18 // EMIT_MIR aggregate.foo.ConstProp.diff
14 -// EMIT_MIR aggregate.foo.PreCodegen.after.mir
15 19 fn foo(x: u8) {
16 -// Verify that we still propagate if part of the aggregate is not known.
20 +// CHECK-LABEL: fn foo(
21 +// CHECK: debug first => [[first:_.*]];
22 +// CHECK: debug second => [[second:_.*]];
23 +// CHECK-NOT: = Add(
24 +// CHECK: [[first]] = const 1_i32;
25 +// CHECK-NOT: = Add(
26 +// CHECK: [[second]] = const 3_i32;
17 27 let first = (0, x).0 + 1;
18 28 let second = (x, 1).1 + 2;
19 29 }