]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/const_prop/optimizes_into_variable.rs
Rollup merge of #107770 - notriddle:notriddle/br2nl, r=GuillaumeGomez
[rust.git] / tests / mir-opt / const_prop / optimizes_into_variable.rs
1 // unit-test
2 // compile-flags: -C overflow-checks=on
3
4 struct Point {
5     x: u32,
6     y: u32,
7 }
8
9 // EMIT_MIR_FOR_EACH_BIT_WIDTH
10 // EMIT_MIR optimizes_into_variable.main.ScalarReplacementOfAggregates.diff
11 // EMIT_MIR optimizes_into_variable.main.ConstProp.diff
12 // EMIT_MIR optimizes_into_variable.main.SimplifyLocals-final.after.mir
13 // EMIT_MIR optimizes_into_variable.main.PreCodegen.after.mir
14 fn main() {
15     let x = 2 + 2;
16     let y = [0, 1, 2, 3, 4, 5][3];
17     let z = (Point { x: 12, y: 42}).y;
18 }