]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/combine_array_len.rs
Rollup merge of #106427 - mejrs:translation_errors, r=davidtwco
[rust.git] / tests / mir-opt / combine_array_len.rs
1 // unit-test: InstCombine
2 // EMIT_MIR combine_array_len.norm2.InstCombine.diff
3
4 fn norm2(x: [f32; 2]) -> f32 {
5     let a = x[0];
6     let b = x[1];
7     a*a + b*b
8 }
9
10 fn main() {
11     assert_eq!(norm2([3.0, 4.0]), 5.0*5.0);
12 }