@@ -10,16 +10,26 @@ int test_select_bool_int(bool cond0, int tVal, int fVal) {
10
10
}
11
11
12
12
struct S { int a; };
13
- // CHECK-LABEL: test_select_infer
13
+ // CHECK-LABEL: test_select_infer_struct
14
14
// CHECK: [[TRUE_VAL:%.*]] = load %struct.S, ptr {{%.*}}, align 1
15
15
// CHECK: [[FALSE_VAL:%.*]] = load %struct.S, ptr {{%.*}}, align 1
16
16
// CHECK: [[SELECT:%.*]] = select i1 {{%.*}}, %struct.S [[TRUE_VAL]], %struct.S [[FALSE_VAL]]
17
17
// CHECK: store %struct.S [[SELECT]], ptr {{%.*}}, align 1
18
18
// CHECK: ret void
19
- struct S test_select_infer (bool cond0, struct S tVal, struct S fVal) {
19
+ struct S test_select_infer_struct (bool cond0, struct S tVal, struct S fVal) {
20
20
return select (cond0, tVal, fVal);
21
21
}
22
22
23
+ // CHECK-LABEL: test_select_infer_array
24
+ // CHECK: [[TRUE_VAL:%.*]] = load [3 x i32], ptr {{%.*}}, align 4
25
+ // CHECK: [[FALSE_VAL:%.*]] = load [3 x i32], ptr {{%.*}}, align 4
26
+ // CHECK: [[SELECT:%.*]] = select i1 {{%.*}}, [3 x i32] [[TRUE_VAL]], [3 x i32] [[FALSE_VAL]]
27
+ // CHECK: store [3 x i32] [[SELECT]], ptr {{%.*}}, align 4
28
+ // CHECK: ret void
29
+ int test_select_infer_array (bool cond, int tVal[3 ], int fVal[3 ])[3 ] {
30
+ return select (cond, tVal, fVal);
31
+ }
32
+
23
33
// CHECK-LABEL: test_select_bool_vector
24
34
// CHECK: [[SELECT:%.*]] = select i1 {{%.*}}, <2 x i32> {{%.*}}, <2 x i32> {{%.*}}
25
35
// CHECK: ret <2 x i32> [[SELECT]]
0 commit comments