about summary refs log tree commit diff
path: root/tests/mir-opt/dataflow-const-prop/repr_transparent.rs
blob: 6152724c98f66353af79d9e368f04d6c2c45bcbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//@ test-mir-pass: DataflowConstProp

// 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

// CHECK-LABEL: fn main(
fn main() {
    // CHECK: debug x => [[x:_.*]];
    // CHECK: debug y => [[y:_.*]];

    // CHECK: [[x]] = const I32(0_i32);
    let x = I32(0);

    // CHECK: [[y]] = const I32(0_i32);
    let y = I32(x.0 + x.0);
}