================ @@ -0,0 +1,78 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library -x hlsl \ +// RUN: -finclude-default-header -ast-dump %s | FileCheck %s + + +// CHECK: ExtVectorElementExpr {{.*}} 'int __attribute__((ext_vector_type(2)))' xx +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'int __attribute__((ext_vector_type(1)))' lvalue <VectorSplat> +// CHECK-NEXT: DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'V' 'int' + +int2 ToTwoInts(int V){ + return V.xx; +} + +// CHECK: ExtVectorElementExpr {{.*}} 'float __attribute__((ext_vector_type(4)))' rrrr +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float __attribute__((ext_vector_type(1)))' lvalue <VectorSplat> +// CHECK-NEXT: DeclRefExpr {{.*}} 'float' lvalue ParmVar {{.*}} 'V' 'float' + + +float4 ToThreeFloats(float V){ + return V.rrrr; +} + +// CHECK: ExtVectorElementExpr {{.*}} 'int __attribute__((ext_vector_type(2)))' xx +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'int __attribute__((ext_vector_type(1)))' <VectorSplat> +// CHECK-NEXT: IntegerLiteral {{.*}} 'int' 1 + +int2 FillOne(){ + return 1.xx; +} + + +// CHECK: ExtVectorElementExpr {{.*}} 'unsigned int __attribute__((ext_vector_type(3)))' xxx +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'unsigned int __attribute__((ext_vector_type(1)))' <VectorSplat> +// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned int' 1 + +uint3 FillOneUnsigned(){ + return 1u.xxx; +} ---------------- AaronBallman wrote:
What happens with: ``` auto HooBoy() { return 4wb.xxxx; } ``` or with a float that has a trailing period followed by this Very Specialâ„¢ suffix? ``` float3 err() { return 1..rrr; } ``` https://github.com/llvm/llvm-project/pull/67700 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits