29 lines · plain
1// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -finclude-default-header -fnative-half-type %s -ast-dump | FileCheck %s2 3// splat from vec1 to vec4// CHECK-LABEL: call15// CHECK: CStyleCastExpr {{.*}} 'int3':'vector<int, 3>' <HLSLAggregateSplatCast>6// CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' <FloatingToIntegral> part_of_explicit_cast7// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' <HLSLVectorTruncation> part_of_explicit_cast8// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float1':'vector<float, 1>' <LValueToRValue> part_of_explicit_cast9// CHECK-NEXT: DeclRefExpr {{.*}} 'float1':'vector<float, 1>' lvalue Var {{.*}} 'A' 'float1':'vector<float, 1>'10export void call1() {11 float1 A = {1.0};12 int3 B = (int3)A;13}14 15struct S {16 int A;17 float B;18 int C;19 float D;20};21 22// splat from scalar to aggregate23// CHECK-LABEL: call224// CHECK: CStyleCastExpr {{.*}} 'S' <HLSLAggregateSplatCast>25// CHECK-NEXT: IntegerLiteral {{.*}} 'int' 526export void call2() {27 S s = (S)5; 28}29