2023-06-08 07:18:34 +00:00
|
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
2024-04-20 11:19:34 +00:00
|
|
|
//@ test-mir-pass: DataflowConstProp
|
2022-08-25 16:43:46 +00:00
|
|
|
|
|
|
|
fn foo(n: i32) {}
|
|
|
|
|
|
|
|
// EMIT_MIR terminator.main.DataflowConstProp.diff
|
2024-01-09 04:21:23 +00:00
|
|
|
|
2024-01-12 07:22:33 +00:00
|
|
|
// CHECK-LABEL: fn main(
|
2022-08-25 16:43:46 +00:00
|
|
|
fn main() {
|
|
|
|
let a = 1;
|
2022-11-09 17:03:30 +00:00
|
|
|
// Checks that we propagate into terminators.
|
2024-01-29 06:44:32 +00:00
|
|
|
// CHECK: {{_.*}} = foo(const 2_i32) -> [return: {{bb.*}}, unwind
|
2022-08-25 16:43:46 +00:00
|
|
|
foo(a + 1);
|
|
|
|
}
|