rust/src/test/mir-opt/const_prop/optimizes_into_variable.rs
2020-07-29 13:41:11 +02:00

15 lines
343 B
Rust

// compile-flags: -C overflow-checks=on
struct Point {
x: u32,
y: u32,
}
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR optimizes_into_variable.main.ConstProp.diff
// EMIT_MIR optimizes_into_variable.main.SimplifyLocals.after.mir
fn main() {
let x = 2 + 2;
let y = [0, 1, 2, 3, 4, 5][3];
let z = (Point { x: 12, y: 42}).y;
}