Skip to content

Commit ff96567

Browse files
committed
[NFC] Fix failing test introduced in #67700
This fixes the test to handle the changes in the AST printer. ../clang/test/SemaHLSL/Types/BuiltinVector/ScalarSwizzles.hlsl
1 parent f688e09 commit ff96567

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

clang/test/SemaHLSL/Types/BuiltinVector/ScalarSwizzles.hlsl

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// RUN: -finclude-default-header -ast-dump %s | FileCheck %s
33

44

5+
// CHECK-LABEL: ToTwoInts
56
// CHECK: ExtVectorElementExpr {{.*}} 'int __attribute__((ext_vector_type(2)))' xx
67
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'int __attribute__((ext_vector_type(1)))' lvalue <VectorSplat>
78
// CHECK-NEXT: DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'V' 'int'
@@ -10,6 +11,7 @@ int2 ToTwoInts(int V){
1011
return V.xx;
1112
}
1213

14+
// CHECK-LABEL: ToFourFloats
1315
// CHECK: ExtVectorElementExpr {{.*}} 'float __attribute__((ext_vector_type(4)))' rrrr
1416
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float __attribute__((ext_vector_type(1)))' lvalue <VectorSplat>
1517
// CHECK-NEXT: DeclRefExpr {{.*}} 'float' lvalue ParmVar {{.*}} 'V' 'float'
@@ -19,6 +21,7 @@ float4 ToFourFloats(float V){
1921
return V.rrrr;
2022
}
2123

24+
// CHECK-LABEL: FillOne
2225
// CHECK: ExtVectorElementExpr {{.*}} 'int __attribute__((ext_vector_type(2)))' xx
2326
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'int __attribute__((ext_vector_type(1)))' <VectorSplat>
2427
// CHECK-NEXT: IntegerLiteral {{.*}} 'int' 1
@@ -27,7 +30,7 @@ int2 FillOne(){
2730
return 1.xx;
2831
}
2932

30-
33+
// CHECK-LABEL: FillOneUnsigned
3134
// CHECK: ExtVectorElementExpr {{.*}} 'unsigned int __attribute__((ext_vector_type(3)))' xxx
3235
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'unsigned int __attribute__((ext_vector_type(1)))' <VectorSplat>
3336
// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned int' 1
@@ -36,6 +39,7 @@ uint3 FillOneUnsigned(){
3639
return 1u.xxx;
3740
}
3841

42+
// CHECK-LABEL: FillOneUnsignedLong
3943
// CHECK: ExtVectorElementExpr {{.*}} 'unsigned long __attribute__((ext_vector_type(4)))' xxxx
4044
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'unsigned long __attribute__((ext_vector_type(1)))' <VectorSplat>
4145
// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1
@@ -44,6 +48,7 @@ vector<uint64_t,4> FillOneUnsignedLong(){
4448
return 1ul.xxxx;
4549
}
4650

51+
// CHECK-LABEL: FillTwoPointFive
4752
// CHECK: ExtVectorElementExpr {{.*}} 'double __attribute__((ext_vector_type(2)))' rr
4853
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'double __attribute__((ext_vector_type(1)))' <VectorSplat>
4954
// CHECK-NEXT: FloatingLiteral {{.*}} 'double' 2.500000e+00
@@ -52,6 +57,7 @@ double2 FillTwoPointFive(){
5257
return 2.5.rr;
5358
}
5459

60+
// CHECK-LABEL: FillOneHalf
5561
// CHECK: ExtVectorElementExpr {{.*}} 'double __attribute__((ext_vector_type(3)))' rrr
5662
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'double __attribute__((ext_vector_type(1)))' <VectorSplat>
5763
// CHECK-NEXT: FloatingLiteral {{.*}} 'double' 5.000000e-01
@@ -60,6 +66,7 @@ double3 FillOneHalf(){
6066
return .5.rrr;
6167
}
6268

69+
// CHECK-LABEL: FillTwoPointFiveFloat
6370
// CHECK: ExtVectorElementExpr {{.*}} 'float __attribute__((ext_vector_type(4)))' rrrr
6471
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float __attribute__((ext_vector_type(1)))' <VectorSplat>
6572
// CHECK-NEXT: FloatingLiteral {{.*}} 'float' 2.500000e+00
@@ -72,6 +79,7 @@ float4 FillTwoPointFiveFloat(){
7279
// truncated vector, this AST formulation has an initialization list to
7380
// initialze the returned vector.
7481

82+
// CHECK-LABEL: FillOneHalfFloat
7583
// CHECK: InitListExpr {{.*}} 'vector<float, 1>':'float __attribute__((ext_vector_type(1)))'
7684
// CHECK-NEXT: ExtVectorElementExpr {{.*}} 'float' r
7785
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float __attribute__((ext_vector_type(1)))' <VectorSplat>
@@ -81,6 +89,7 @@ vector<float, 1> FillOneHalfFloat(){
8189
return .5f.r;
8290
}
8391

92+
// CHECK-LABEL: HowManyFloats
8493
// CHECK: ExtVectorElementExpr {{.*}} 'float __attribute__((ext_vector_type(2)))' rr
8594
// CHECK-NEXT: ExtVectorElementExpr {{.*}} 'float __attribute__((ext_vector_type(2)))' rr
8695
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float __attribute__((ext_vector_type(1)))' lvalue <VectorSplat>
@@ -90,6 +99,7 @@ float2 HowManyFloats(float V) {
9099
return V.rr.rr;
91100
}
92101

102+
// CHECK-LABEL: HooBoy
93103
// CHECK: ExtVectorElementExpr {{.*}} 'long __attribute__((ext_vector_type(4)))' xxxx
94104
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'long __attribute__((ext_vector_type(1)))' <VectorSplat>
95105
// CHECK-NEXT: IntegerLiteral {{.*}} 'long' 4
@@ -102,27 +112,27 @@ int64_t4 HooBoy() {
102112
// is a double->float conversion, which results in generating an initializtion
103113
// list with float truncation casts.
104114

105-
115+
// CHECK-LABEL: AllRighty
106116
// CHECK: InitListExpr {{.*}} 'float3':'float __attribute__((ext_vector_type(3)))'
107117

108118
// Vector element 0:
109-
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float':'float' <FloatingCast>
119+
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' <FloatingCast>
110120
// CHECK-NEXT: ArraySubscriptExpr {{.*}} 'double'
111121
// CHECK-NEXT: ExtVectorElementExpr {{.*}} 'double __attribute__((ext_vector_type(3)))' rrr
112122
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'double __attribute__((ext_vector_type(1)))' <VectorSplat>
113123
// CHECK-NEXT: FloatingLiteral {{.*}} 'double' 1.000000e+00
114124
// CHECK-NEXT: IntegerLiteral {{.*}} 'int' 0
115125

116126
// Vector element 1:
117-
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float':'float' <FloatingCast>
127+
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' <FloatingCast>
118128
// CHECK-NEXT: ArraySubscriptExpr {{.*}} 'double'
119129
// CHECK-NEXT: ExtVectorElementExpr {{.*}} 'double __attribute__((ext_vector_type(3)))' rrr
120130
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'double __attribute__((ext_vector_type(1)))' <VectorSplat>
121131
// CHECK-NEXT: FloatingLiteral {{.*}} 'double' 1.000000e+00
122132
// CHECK-NEXT: IntegerLiteral {{.*}} 'int' 1
123133

124134
// Vector element 2:
125-
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float':'float' <FloatingCast>
135+
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' <FloatingCast>
126136
// CHECK-NEXT: ArraySubscriptExpr {{.*}} 'double'
127137
// CHECK-NEXT: ExtVectorElementExpr {{.*}} 'double __attribute__((ext_vector_type(3)))' rrr
128138
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'double __attribute__((ext_vector_type(1)))' <VectorSplat>

0 commit comments

Comments
 (0)