summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/dataflow-const-prop/repr_transparent.rs
blob: 8cbed6fbb624da2d8f8bbbefa73fb00e48b982b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// skip-filecheck
// unit-test: 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
fn main() {
    let x = I32(0);
    let y = I32(x.0 + x.0);
}