2
2
// RUN: -finclude-default-header -ast-dump %s | FileCheck %s
3
3
4
4
5
+ // CHECK-LABEL: ToTwoInts
5
6
// CHECK: ExtVectorElementExpr {{.*}} 'int __attribute__((ext_vector_type(2)))' xx
6
7
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'int __attribute__((ext_vector_type(1)))' lvalue <VectorSplat>
7
8
// CHECK-NEXT: DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'V' 'int'
@@ -10,6 +11,7 @@ int2 ToTwoInts(int V){
10
11
return V.xx;
11
12
}
12
13
14
+ // CHECK-LABEL: ToFourFloats
13
15
// CHECK: ExtVectorElementExpr {{.*}} 'float __attribute__((ext_vector_type(4)))' rrrr
14
16
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float __attribute__((ext_vector_type(1)))' lvalue <VectorSplat>
15
17
// CHECK-NEXT: DeclRefExpr {{.*}} 'float' lvalue ParmVar {{.*}} 'V' 'float'
@@ -19,6 +21,7 @@ float4 ToFourFloats(float V){
19
21
return V.rrrr;
20
22
}
21
23
24
+ // CHECK-LABEL: FillOne
22
25
// CHECK: ExtVectorElementExpr {{.*}} 'int __attribute__((ext_vector_type(2)))' xx
23
26
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'int __attribute__((ext_vector_type(1)))' <VectorSplat>
24
27
// CHECK-NEXT: IntegerLiteral {{.*}} 'int' 1
@@ -27,7 +30,7 @@ int2 FillOne(){
27
30
return 1. xx;
28
31
}
29
32
30
-
33
+ // CHECK-LABEL: FillOneUnsigned
31
34
// CHECK: ExtVectorElementExpr {{.*}} 'unsigned int __attribute__((ext_vector_type(3)))' xxx
32
35
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'unsigned int __attribute__((ext_vector_type(1)))' <VectorSplat>
33
36
// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned int' 1
@@ -36,6 +39,7 @@ uint3 FillOneUnsigned(){
36
39
return 1u.xxx;
37
40
}
38
41
42
+ // CHECK-LABEL: FillOneUnsignedLong
39
43
// CHECK: ExtVectorElementExpr {{.*}} 'unsigned long __attribute__((ext_vector_type(4)))' xxxx
40
44
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'unsigned long __attribute__((ext_vector_type(1)))' <VectorSplat>
41
45
// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1
@@ -44,6 +48,7 @@ vector<uint64_t,4> FillOneUnsignedLong(){
44
48
return 1ul.xxxx;
45
49
}
46
50
51
+ // CHECK-LABEL: FillTwoPointFive
47
52
// CHECK: ExtVectorElementExpr {{.*}} 'double __attribute__((ext_vector_type(2)))' rr
48
53
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'double __attribute__((ext_vector_type(1)))' <VectorSplat>
49
54
// CHECK-NEXT: FloatingLiteral {{.*}} 'double' 2.500000e+00
@@ -52,6 +57,7 @@ double2 FillTwoPointFive(){
52
57
return 2.5 .rr;
53
58
}
54
59
60
+ // CHECK-LABEL: FillOneHalf
55
61
// CHECK: ExtVectorElementExpr {{.*}} 'double __attribute__((ext_vector_type(3)))' rrr
56
62
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'double __attribute__((ext_vector_type(1)))' <VectorSplat>
57
63
// CHECK-NEXT: FloatingLiteral {{.*}} 'double' 5.000000e-01
@@ -60,6 +66,7 @@ double3 FillOneHalf(){
60
66
return .5 .rrr;
61
67
}
62
68
69
+ // CHECK-LABEL: FillTwoPointFiveFloat
63
70
// CHECK: ExtVectorElementExpr {{.*}} 'float __attribute__((ext_vector_type(4)))' rrrr
64
71
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float __attribute__((ext_vector_type(1)))' <VectorSplat>
65
72
// CHECK-NEXT: FloatingLiteral {{.*}} 'float' 2.500000e+00
@@ -72,6 +79,7 @@ float4 FillTwoPointFiveFloat(){
72
79
// truncated vector, this AST formulation has an initialization list to
73
80
// initialze the returned vector.
74
81
82
+ // CHECK-LABEL: FillOneHalfFloat
75
83
// CHECK: InitListExpr {{.*}} 'vector<float, 1>':'float __attribute__((ext_vector_type(1)))'
76
84
// CHECK-NEXT: ExtVectorElementExpr {{.*}} 'float' r
77
85
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float __attribute__((ext_vector_type(1)))' <VectorSplat>
@@ -81,6 +89,7 @@ vector<float, 1> FillOneHalfFloat(){
81
89
return .5f .r;
82
90
}
83
91
92
+ // CHECK-LABEL: HowManyFloats
84
93
// CHECK: ExtVectorElementExpr {{.*}} 'float __attribute__((ext_vector_type(2)))' rr
85
94
// CHECK-NEXT: ExtVectorElementExpr {{.*}} 'float __attribute__((ext_vector_type(2)))' rr
86
95
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float __attribute__((ext_vector_type(1)))' lvalue <VectorSplat>
@@ -90,6 +99,7 @@ float2 HowManyFloats(float V) {
90
99
return V.rr.rr;
91
100
}
92
101
102
+ // CHECK-LABEL: HooBoy
93
103
// CHECK: ExtVectorElementExpr {{.*}} 'long __attribute__((ext_vector_type(4)))' xxxx
94
104
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'long __attribute__((ext_vector_type(1)))' <VectorSplat>
95
105
// CHECK-NEXT: IntegerLiteral {{.*}} 'long' 4
@@ -102,27 +112,27 @@ int64_t4 HooBoy() {
102
112
// is a double->float conversion, which results in generating an initializtion
103
113
// list with float truncation casts.
104
114
105
-
115
+ // CHECK-LABEL: AllRighty
106
116
// CHECK: InitListExpr {{.*}} 'float3':'float __attribute__((ext_vector_type(3)))'
107
117
108
118
// Vector element 0:
109
- // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float':'float' <FloatingCast>
119
+ // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' <FloatingCast>
110
120
// CHECK-NEXT: ArraySubscriptExpr {{.*}} 'double'
111
121
// CHECK-NEXT: ExtVectorElementExpr {{.*}} 'double __attribute__((ext_vector_type(3)))' rrr
112
122
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'double __attribute__((ext_vector_type(1)))' <VectorSplat>
113
123
// CHECK-NEXT: FloatingLiteral {{.*}} 'double' 1.000000e+00
114
124
// CHECK-NEXT: IntegerLiteral {{.*}} 'int' 0
115
125
116
126
// Vector element 1:
117
- // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float':'float' <FloatingCast>
127
+ // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' <FloatingCast>
118
128
// CHECK-NEXT: ArraySubscriptExpr {{.*}} 'double'
119
129
// CHECK-NEXT: ExtVectorElementExpr {{.*}} 'double __attribute__((ext_vector_type(3)))' rrr
120
130
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'double __attribute__((ext_vector_type(1)))' <VectorSplat>
121
131
// CHECK-NEXT: FloatingLiteral {{.*}} 'double' 1.000000e+00
122
132
// CHECK-NEXT: IntegerLiteral {{.*}} 'int' 1
123
133
124
134
// Vector element 2:
125
- // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float':'float' <FloatingCast>
135
+ // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' <FloatingCast>
126
136
// CHECK-NEXT: ArraySubscriptExpr {{.*}} 'double'
127
137
// CHECK-NEXT: ExtVectorElementExpr {{.*}} 'double __attribute__((ext_vector_type(3)))' rrr
128
138
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'double __attribute__((ext_vector_type(1)))' <VectorSplat>
0 commit comments