]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/combine_array_len.rs
Render const pointers in MIR more compactly
[rust.git] / src / test / mir-opt / combine_array_len.rs
1 fn norm2(x: [f32; 2]) -> f32 {
2     let a = x[0];
3     let b = x[1];
4     a*a + b*b
5 }
6
7 fn main() {
8     assert_eq!(norm2([3.0, 4.0]), 5.0*5.0);
9 }
10
11 // END RUST SOURCE
12
13 // START rustc.norm2.InstCombine.before.mir
14 //     _4 = Len(_1);
15 //     ...
16 //     _8 = Len(_1);
17 // END rustc.norm2.InstCombine.before.mir
18
19 // START rustc.norm2.InstCombine.after.mir
20 //     _4 = const 2usize;
21 //     ...
22 //     _8 = const 2usize;
23 // END rustc.norm2.InstCombine.after.mir