Add FileCheck to 3 tests: ref_without_sb, repeat, repr_transparent

This commit is contained in:
sfzhu93 2024-01-08 20:19:59 -08:00
parent 9452d7ed1a
commit e9152e2b6c
3 changed files with 27 additions and 3 deletions

View file

@ -1,4 +1,3 @@
// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: DataflowConstProp
@ -9,11 +8,21 @@ fn escape<T>(x: &T) {}
fn some_function() {}
// EMIT_MIR ref_without_sb.main.DataflowConstProp.diff
// CHECK-LABEL: fn main
fn main() {
// CHECK: debug a => [[a:_.*]];
// CHECK: debug b => [[b:_.*]];
let mut a = 0;
// CHECK: {{_[0-9]+}} = escape::<i32>(move {{_[0-9]+}}) -> [return: {{bb[0-9]+}}, unwind continue];
escape(&a);
a = 1;
// CHECK: {{_[0-9]+}} = some_function() -> [return: {{bb[0-9]+}}, unwind continue];
some_function();
// This should currently not be propagated.
// CHECK: [[b]] = [[a]];
let b = a;
}

View file

@ -1,9 +1,17 @@
// skip-filecheck
// unit-test: DataflowConstProp
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR repeat.main.DataflowConstProp.diff
// CHECK-LABEL: fn main
fn main() {
// CHECK: debug x => [[x:_.*]];
// CHECK: {{_[0-9]+}} = const 8_usize;
// CHECK: {{_[0-9]+}} = const true;
// CHECK-LABEL: assert(const true
// CHECK: {{_[0-9]+}} = {{_[0-9]+}}[2 of 3];
// CHECK: [[x]] = Add(move {{_[0-9]+}}, const 0_u32);
let x: u32 = [42; 8][2] + 0;
}

View file

@ -1,4 +1,3 @@
// skip-filecheck
// unit-test: DataflowConstProp
// The struct has scalar ABI, but is not a scalar type.
@ -7,7 +6,15 @@
struct I32(i32);
// EMIT_MIR repr_transparent.main.DataflowConstProp.diff
// CHECK-LABEL: fn main
fn main() {
// CHECK: debug x => [[x:_.*]];
// CHECK: debug y => [[y:_.*]];
// CHECK: [[x]] = const I32(0_i32);
let x = I32(0);
// CHECK: [[y]] = const I32(0_i32);
let y = I32(x.0 + x.0);
}