2024-04-20 06:19:34 -05:00
|
|
|
//@ test-mir-pass: DataflowConstProp
|
2022-11-11 04:24:31 -06:00
|
|
|
|
|
|
|
// The struct has scalar ABI, but is not a scalar type.
|
|
|
|
// Make sure that we handle this correctly.
|
|
|
|
#[repr(transparent)]
|
|
|
|
struct I32(i32);
|
|
|
|
|
|
|
|
// EMIT_MIR repr_transparent.main.DataflowConstProp.diff
|
2024-01-08 22:19:59 -06:00
|
|
|
|
2024-01-12 01:22:33 -06:00
|
|
|
// CHECK-LABEL: fn main(
|
2022-11-11 04:24:31 -06:00
|
|
|
fn main() {
|
2024-01-08 22:19:59 -06:00
|
|
|
// CHECK: debug x => [[x:_.*]];
|
|
|
|
// CHECK: debug y => [[y:_.*]];
|
|
|
|
|
|
|
|
// CHECK: [[x]] = const I32(0_i32);
|
2022-11-11 04:24:31 -06:00
|
|
|
let x = I32(0);
|
2024-01-08 22:19:59 -06:00
|
|
|
|
|
|
|
// CHECK: [[y]] = const I32(0_i32);
|
2022-11-11 04:24:31 -06:00
|
|
|
let y = I32(x.0 + x.0);
|
|
|
|
}
|