2024-04-20 06:19:34 -05:00
|
|
|
//@ test-mir-pass: DataflowConstProp
|
2024-06-14 18:01:26 -05:00
|
|
|
//@ compile-flags: -Zdump-mir-exclude-alloc-bytes
|
2023-09-17 04:35:06 -05:00
|
|
|
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
2022-10-24 19:27:27 -05:00
|
|
|
|
|
|
|
// EMIT_MIR tuple.main.DataflowConstProp.diff
|
2024-01-08 22:21:23 -06:00
|
|
|
|
2024-01-12 01:22:33 -06:00
|
|
|
// CHECK-LABEL: fn main(
|
2022-10-24 19:27:27 -05:00
|
|
|
fn main() {
|
2024-01-12 01:22:33 -06:00
|
|
|
// CHECK: debug a => [[a:_.*]];
|
|
|
|
// CHECK: debug b => [[b:_.*]];
|
|
|
|
// CHECK: debug c => [[c:_.*]];
|
|
|
|
// CHECK: debug d => [[d:_.*]];
|
2024-01-08 22:21:23 -06:00
|
|
|
|
|
|
|
// CHECK: [[a]] = const (1_i32, 2_i32);
|
2022-10-24 19:27:27 -05:00
|
|
|
let mut a = (1, 2);
|
2024-01-08 22:21:23 -06:00
|
|
|
|
|
|
|
// CHECK: [[b]] = const 6_i32;
|
2022-11-09 11:03:30 -06:00
|
|
|
let b = a.0 + a.1 + 3;
|
2024-01-08 22:21:23 -06:00
|
|
|
|
|
|
|
// CHECK: [[a]] = const (2_i32, 3_i32);
|
2022-10-24 19:27:27 -05:00
|
|
|
a = (2, 3);
|
2024-01-08 22:21:23 -06:00
|
|
|
|
|
|
|
// CHECK: [[c]] = const 11_i32;
|
2022-11-09 11:03:30 -06:00
|
|
|
let c = a.0 + a.1 + b;
|
2023-09-12 11:44:53 -05:00
|
|
|
|
2024-01-08 22:21:23 -06:00
|
|
|
// CHECK: [[d]] = (const 6_i32, const (2_i32, 3_i32), const 11_i32);
|
2023-09-12 11:44:53 -05:00
|
|
|
let d = (b, a, c);
|
2022-10-24 19:27:27 -05:00
|
|
|
}
|