@@ -6,17 +6,37 @@ struct F32x8([f32; 8]);
6
6
7
7
// EMIT_MIR const_array_locals.main.GVN.diff
8
8
// CHECK-LABEL: fn main(
9
+ // CHECK: debug _arr => [[_arr:_[0-9]+]];
10
+ // CHECK: debug _duplicated_arr => [[_duplicated_arr:_[0-9]+]];
11
+ // CHECK: debug _foo => [[_foo:_[0-9]+]];
12
+ // CHECK: debug _darr => [[_darr:_[0-9]+]];
13
+ // CHECK: debug _f => [[_f:_[0-9]+]];
9
14
pub fn main ( ) {
15
+ // CHECK: [[_arr]] = const [255_i32, 105_i32, 15_i32, 39_i32, 62_i32];
10
16
let _arr = [ 255 , 105 , 15 , 39 , 62 ] ;
17
+ // CHECK: [[_duplicated_arr]] = [[_arr]];
11
18
let _duplicated_arr = [ 255 , 105 , 15 , 39 , 62 ] ;
19
+ // CHECK: [[subarray1:_[0-9]+]] = const [178_i32, 9_i32, 4_i32, 56_i32, 221_i32];
20
+ // CHECK: [[subarray2:_[0-9]+]] = const [193_i32, 164_i32, 194_i32, 197_i32, 6_i32];
21
+ // CHECK: [[_foo]] = [move [[subarray1]], move [[subarray2]]];
12
22
let _foo = [ [ 178 , 9 , 4 , 56 , 221 ] , [ 193 , 164 , 194 , 197 , 6 ] ] ;
23
+ // CHECK: [[PROMOTED:_[0-9]+]] = const main::promoted[0];
24
+ // CHECK: [[_darr]] = (*[[PROMOTED]]);
13
25
let _darr = * & [ 254 , 42 , 15 , 39 , 62 ] ;
14
26
27
+ // CHECK: [[ARG:_[0-9]+]] = const [31_u32, 96_u32, 173_u32, 50_u32, 1_u32];
28
+ // CHECK: consume(move [[ARG]])
15
29
consume ( [ 31 , 96 , 173 , 50 , 1 ] ) ;
16
30
31
+ // CHECK: [[OP:_[0-9]+]] = const [1f32, 2f32, 3f32, 1f32, 1f32, 1f32, 1f32, 42f32];
32
+ // CHECK: [[_f]] = F32x8(move [[OP]]);
17
33
let _f = F32x8 ( [ 1.0 , 2.0 , 3.0 , 1.0 , 1.0 , 1.0 , 1.0 , 42.0 ] ) ;
18
34
19
- // ice
35
+ // ice with small arrays
36
+ // CHECK: [[A:_[0-9]+]] = [const 1_i32, const 0_i32, const 0_i32];
37
+ // CHECK: [[B:_[0-9]+]] = [const 0_i32, const 1_i32, const 0_i32];
38
+ // CHECK: [[C:_[0-9]+]] = [const 0_i32, const 0_i32, const 1_i32];
39
+ // CHECK: {{_[0-9]+}} = [move [[A]], move [[B]], move [[C]]];
20
40
[ [ 1 , 0 , 0 ] , [ 0 , 1 , 0 ] , [ 0 , 0 , 1 ] ] ; // 2D array
21
41
}
22
42
0 commit comments