2023-06-08 02:18:34 -05:00
|
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
2024-04-20 06:19:34 -05:00
|
|
|
//@ test-mir-pass: GVN
|
2024-06-14 18:01:26 -05:00
|
|
|
//@ compile-flags: -Zdump-mir-exclude-alloc-bytes
|
2020-05-12 06:23:01 -05:00
|
|
|
|
2023-09-20 16:43:33 -05:00
|
|
|
// EMIT_MIR mutable_variable_unprop_assign.main.GVN.diff
|
2020-05-12 06:23:01 -05:00
|
|
|
fn main() {
|
2023-12-02 14:54:56 -06:00
|
|
|
// CHECK-LABEL: fn main(
|
|
|
|
// CHECK: debug a => [[a:_.*]];
|
|
|
|
// CHECK: debug x => [[x:_.*]];
|
|
|
|
// CHECK: debug y => [[y:_.*]];
|
|
|
|
// CHECK: debug z => [[z:_.*]];
|
|
|
|
// CHECK: [[a]] = foo()
|
|
|
|
// CHECK: [[x]] = const (1_i32, 2_i32);
|
2024-08-18 17:51:53 -05:00
|
|
|
// CHECK: ([[x]].1: i32) = copy [[a]];
|
|
|
|
// CHECK: [[y]] = copy ([[x]].1: i32);
|
|
|
|
// CHECK: [[z]] = copy ([[x]].0: i32);
|
2020-05-12 06:23:01 -05:00
|
|
|
let a = foo();
|
|
|
|
let mut x: (i32, i32) = (1, 2);
|
|
|
|
x.1 = a;
|
|
|
|
let y = x.1;
|
2023-12-02 14:54:56 -06:00
|
|
|
let z = x.0;
|
2020-05-12 06:23:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[inline(never)]
|
|
|
|
fn foo() -> i32 {
|
|
|
|
unimplemented!()
|
|
|
|
}
|