|
| 1 | +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -ast-dump -ast-dump-filter=case | FileCheck %s |
| 2 | + |
| 3 | +// CHECK-LABEL: FunctionDecl {{.*}} used case1 'uint32_t2 (uint32_t2)' |
| 4 | +// CHECK-NEXT: ParmVarDecl {{.*}} used b 'uint32_t2':'vector<uint32_t, 2>' |
| 5 | +// CHECK-NEXT: CompoundStmt |
| 6 | +// CHECK-NEXT: ReturnStmt |
| 7 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'vector<uint32_t, 2>' <IntegralCast> |
| 8 | +// CHECK-NEXT: UnaryOperator {{.*}} 'vector<bool, 2>' prefix '!' cannot overflow |
| 9 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'vector<bool, 2>' <IntegralToBoolean> |
| 10 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'uint32_t2':'vector<uint32_t, 2>' <LValueToRValue> |
| 11 | +// CHECK-NEXT: DeclRefExpr {{.*}} 'uint32_t2':'vector<uint32_t, 2>' lvalue ParmVar {{.*}} 'b' 'uint32_t2':'vector<uint32_t, 2>' |
| 12 | +export uint32_t2 case1(uint32_t2 b) { |
| 13 | + return !b; |
| 14 | +} |
| 15 | + |
| 16 | +// CHECK-LABEL: FunctionDecl {{.*}} used case2 'int32_t3 (int32_t3)' |
| 17 | +// CHECK-NEXT: ParmVarDecl {{.*}} used b 'int32_t3':'vector<int32_t, 3>' |
| 18 | +// CHECK-NEXT: CompoundStmt |
| 19 | +// CHECK-NEXT: ReturnStmt |
| 20 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'vector<int32_t, 3>' <IntegralCast> |
| 21 | +// CHECK-NEXT: UnaryOperator {{.*}} 'vector<bool, 3>' prefix '!' cannot overflow |
| 22 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'vector<bool, 3>' <IntegralToBoolean> |
| 23 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'int32_t3':'vector<int32_t, 3>' <LValueToRValue> |
| 24 | +// CHECK-NEXT: DeclRefExpr {{.*}} 'int32_t3':'vector<int32_t, 3>' lvalue ParmVar {{.*}} 'b' 'int32_t3':'vector<int32_t, 3>' |
| 25 | +export int32_t3 case2(int32_t3 b) { |
| 26 | + return !b; |
| 27 | +} |
| 28 | + |
| 29 | +// CHECK-LABEL: FunctionDecl {{.*}} used case3 'float16_t (float16_t)' |
| 30 | +// CHECK-NEXT: ParmVarDecl {{.*}} used b 'float16_t':'half' |
| 31 | +// CHECK-NEXT: CompoundStmt |
| 32 | +// CHECK-NEXT: ReturnStmt |
| 33 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float16_t':'half' <IntegralToFloating> |
| 34 | +// CHECK-NEXT: UnaryOperator {{.*}} 'bool' prefix '!' cannot overflow |
| 35 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'bool' <FloatingToBoolean> |
| 36 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float16_t':'half' <LValueToRValue> |
| 37 | +// CHECK-NEXT: DeclRefExpr {{.*}} 'float16_t':'half' lvalue ParmVar {{.*}} 'b' 'float16_t':'half' |
| 38 | +export float16_t case3(float16_t b) { |
| 39 | + return !b; |
| 40 | +} |
| 41 | + |
| 42 | +// CHECK-LABEL: FunctionDecl {{.*}} used case4 'float4 (float4)' |
| 43 | +// CHECK-NEXT: ParmVarDecl {{.*}} used b 'float4':'vector<float, 4>' |
| 44 | +// CHECK-NEXT: CompoundStmt |
| 45 | +// CHECK-NEXT: ReturnStmt |
| 46 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'vector<float, 4>' <IntegralToFloating> |
| 47 | +// CHECK-NEXT: UnaryOperator {{.*}} 'vector<bool, 4>' prefix '!' cannot overflow |
| 48 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'vector<bool, 4>' <FloatingToBoolean> |
| 49 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4':'vector<float, 4>' <LValueToRValue> |
| 50 | +// CHECK-NEXT: DeclRefExpr {{.*}} 'float4':'vector<float, 4>' lvalue ParmVar {{.*}} 'b' 'float4':'vector<float, 4>' |
| 51 | +export float4 case4(float4 b) { |
| 52 | + return !b; |
| 53 | +} |
0 commit comments