|
1 | 1 | // RUN: %clang_cc1 -triple dxil-unknown-shadermodel6.6-library -S -fnative-half-type -finclude-default-header -o - -ast-dump %s | FileCheck %s
|
| 2 | +// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm -disable-llvm-passes -O3 -o - | FileCheck %s --check-prefixes=CHECKIR |
2 | 3 | void Fn(double2 D);
|
3 | 4 | void Fn(half2 H);
|
4 | 5 |
|
@@ -28,3 +29,43 @@ void Fn2(int16_t2 S);
|
28 | 29 | void Call2(int2 I) {
|
29 | 30 | Fn2(I);
|
30 | 31 | }
|
| 32 | + |
| 33 | +void Fn3( int64_t2 p0); |
| 34 | + |
| 35 | +// CHECK: FunctionDecl {{.*}} Call3 'void (half2)' |
| 36 | +// CHECK: CallExpr {{.*}} 'void' |
| 37 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'void (*)(int64_t2)' <FunctionToPointerDecay> |
| 38 | +// CHECK-NEXT: DeclRefExpr {{.*}} 'void (int64_t2)' lvalue Function {{.*}} 'Fn3' 'void (int64_t2)' |
| 39 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'int64_t2':'long __attribute__((ext_vector_type(2)))' <FloatingToIntegral> |
| 40 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'half2':'half __attribute__((ext_vector_type(2)))' <LValueToRValue> |
| 41 | +// CHECK-NEXT: DeclRefExpr {{.*}} 'half2':'half __attribute__((ext_vector_type(2)))' lvalue ParmVar {{.*}} 'p0' 'half2':'half __attribute__((ext_vector_type(2)))' |
| 42 | +// CHECKIR: %conv = fptosi <2 x half> %0 to <2 x i64> |
| 43 | +void Call3(half2 p0) { |
| 44 | + Fn3(p0); |
| 45 | +} |
| 46 | + |
| 47 | +// CHECK: FunctionDecl {{.*}} Call4 'void (float2)' |
| 48 | +// CHECK: CallExpr {{.*}} 'void' |
| 49 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'void (*)(int64_t2)' <FunctionToPointerDecay> |
| 50 | +// CHECK-NEXT: DeclRefExpr {{.*}} 'void (int64_t2)' lvalue Function {{.*}} 'Fn3' 'void (int64_t2)' |
| 51 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'int64_t2':'long __attribute__((ext_vector_type(2)))' <FloatingToIntegral> |
| 52 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float2':'float __attribute__((ext_vector_type(2)))' <LValueToRValue> |
| 53 | +// CHECK-NEXT: DeclRefExpr {{.*}} 'float2':'float __attribute__((ext_vector_type(2)))' lvalue ParmVar {{.*}} 'p0' 'float2':'float __attribute__((ext_vector_type(2)))' |
| 54 | +// CHECKIR: %conv = fptosi <2 x float> %0 to <2 x i64> |
| 55 | +void Call4(float2 p0) { |
| 56 | + Fn3(p0); |
| 57 | +} |
| 58 | + |
| 59 | +void Fn4( float2 p0); |
| 60 | + |
| 61 | +// CHECK: FunctionDecl {{.*}} Call5 'void (int64_t2)' |
| 62 | +// CHECK: CallExpr {{.*}} 'void' |
| 63 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'void (*)(float2)' <FunctionToPointerDecay> |
| 64 | +// CHECK-NEXT: DeclRefExpr {{.*}} 'void (float2)' lvalue Function {{.*}} 'Fn4' 'void (float2)' |
| 65 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float2':'float __attribute__((ext_vector_type(2)))' <IntegralToFloating> |
| 66 | +// CHECK-NEXT: ImplicitCastExpr {{.*}} 'int64_t2':'long __attribute__((ext_vector_type(2)))' <LValueToRValue> |
| 67 | +// CHECK-NEXT: DeclRefExpr {{.*}} 'int64_t2':'long __attribute__((ext_vector_type(2)))' lvalue ParmVar {{.*}} 'p0' 'int64_t2':'long __attribute__((ext_vector_type(2)))' |
| 68 | +// CHECKIR: %conv = sitofp <2 x i64> %0 to <2 x float> |
| 69 | +void Call5(int64_t2 p0) { |
| 70 | + Fn4(p0); |
| 71 | +} |
0 commit comments