Add FileCheck to terminator.rs and tuple.rs

This commit is contained in:
sfzhu93 2024-01-08 20:21:23 -08:00
parent 732f6a1303
commit 1adda9a170
2 changed files with 18 additions and 2 deletions

View File

@ -1,12 +1,14 @@
// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: DataflowConstProp // unit-test: DataflowConstProp
fn foo(n: i32) {} fn foo(n: i32) {}
// EMIT_MIR terminator.main.DataflowConstProp.diff // EMIT_MIR terminator.main.DataflowConstProp.diff
// CHECK-LABEL: fn main
fn main() { fn main() {
let a = 1; let a = 1;
// Checks that we propagate into terminators. // Checks that we propagate into terminators.
// CHECK: {{_[0-9]+}} = foo(const 2_i32) -> [return: {{bb[0-9]+}}, unwind continue];
foo(a + 1); foo(a + 1);
} }

View File

@ -1,13 +1,27 @@
// skip-filecheck
// unit-test: DataflowConstProp // unit-test: DataflowConstProp
// EMIT_MIR_FOR_EACH_BIT_WIDTH // EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR tuple.main.DataflowConstProp.diff // EMIT_MIR tuple.main.DataflowConstProp.diff
// CHECK-LABEL: fn main
fn main() { fn main() {
// CHECK: debug a => [[a:_[0-9]+]];
// CHECK: debug b => [[b:_[0-9]+]];
// CHECK: debug c => [[c:_[0-9]+]];
// CHECK: debug d => [[d:_[0-9]+]];
// CHECK: [[a]] = const (1_i32, 2_i32);
let mut a = (1, 2); let mut a = (1, 2);
// CHECK: [[b]] = const 6_i32;
let b = a.0 + a.1 + 3; let b = a.0 + a.1 + 3;
// CHECK: [[a]] = const (2_i32, 3_i32);
a = (2, 3); a = (2, 3);
// CHECK: [[c]] = const 11_i32;
let c = a.0 + a.1 + b; let c = a.0 + a.1 + b;
// CHECK: [[d]] = (const 6_i32, const (2_i32, 3_i32), const 11_i32);
let d = (b, a, c); let d = (b, a, c);
} }