Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
667 B
Rust
Raw Normal View History

// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//@ test-mir-pass: DataflowConstProp
2022-10-07 01:11:06 +02:00
#[inline(never)]
fn escape<T>(x: &T) {}
2022-10-07 01:17:43 +02:00
#[inline(never)]
fn some_function() {}
2022-10-07 01:11:06 +02:00
// EMIT_MIR ref_without_sb.main.DataflowConstProp.diff
2024-01-11 23:22:33 -08:00
// CHECK-LABEL: fn main(
2022-10-07 01:11:06 +02:00
fn main() {
// CHECK: debug a => [[a:_.*]];
// CHECK: debug b => [[b:_.*]];
2022-10-07 01:11:06 +02:00
let mut a = 0;
2024-01-11 23:22:33 -08:00
// CHECK: {{_.*}} = escape::<i32>(move {{_.*}}) -> {{.*}}
2022-10-07 01:11:06 +02:00
escape(&a);
a = 1;
2024-01-11 23:22:33 -08:00
// CHECK: {{_.*}} = some_function() -> {{.*}}
2022-10-07 01:17:43 +02:00
some_function();
// This should currently not be propagated.
2024-01-11 23:22:33 -08:00
// CHECK-NOT: [[b]] = const
2024-08-18 15:51:53 -07:00
// CHECK: [[b]] = copy [[a]];
2024-01-11 23:22:33 -08:00
// CHECK-NOT: [[b]] = const
2022-10-07 01:11:06 +02:00
let b = a;
}