Skip to content

Commit 316d08a

Browse files
committed
Added the spirv hlsl tests too
1 parent 08f0b8a commit 316d08a

File tree

1 file changed

+38
-26
lines changed

1 file changed

+38
-26
lines changed
Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,66 @@
11
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
22
// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
33
// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
4-
// RUN: --check-prefixes=CHECK,NATIVE_HALF
4+
// RUN: --check-prefixes=CHECK,NATIVE_HALF \
5+
// RUN: -DTARGET=dx -DFNATTRS=noundef
56
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
67
// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
7-
// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF
8+
// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF \
9+
// RUN: -DTARGET=dx -DFNATTRS=noundef
10+
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
11+
// RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \
12+
// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
13+
// RUN: --check-prefixes=CHECK,NATIVE_HALF \
14+
// RUN: -DTARGET=spv -DFNATTRS="spir_func noundef"
15+
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
16+
// RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \
17+
// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF \
18+
// RUN: -DTARGET=spv -DFNATTRS="spir_func noundef"
19+
820

9-
// NATIVE_HALF: define noundef half @
10-
// NATIVE_HALF: %{{.*}} = call half @llvm.dx.radians.f16(
21+
// NATIVE_HALF: define [[FNATTRS]] half @
22+
// NATIVE_HALF: %{{.*}} = call half @llvm.[[TARGET]].radians.f16(
1123
// NATIVE_HALF: ret half %{{.*}}
12-
// NO_HALF: define noundef float @"?test_radians_half@@YA$halff@$halff@@Z"(
13-
// NO_HALF: %{{.*}} = call float @llvm.dx.radians.f32(
24+
// NO_HALF: define [[FNATTRS]] float @
25+
// NO_HALF: %{{.*}} = call float @llvm.[[TARGET]].radians.f32(
1426
// NO_HALF: ret float %{{.*}}
1527
half test_radians_half(half p0) { return radians(p0); }
16-
// NATIVE_HALF: define noundef <2 x half> @
17-
// NATIVE_HALF: %{{.*}} = call <2 x half> @llvm.dx.radians.v2f16
28+
// NATIVE_HALF: define [[FNATTRS]] <2 x half> @
29+
// NATIVE_HALF: %{{.*}} = call <2 x half> @llvm.[[TARGET]].radians.v2f16
1830
// NATIVE_HALF: ret <2 x half> %{{.*}}
19-
// NO_HALF: define noundef <2 x float> @
20-
// NO_HALF: %{{.*}} = call <2 x float> @llvm.dx.radians.v2f32(
31+
// NO_HALF: define [[FNATTRS]] <2 x float> @
32+
// NO_HALF: %{{.*}} = call <2 x float> @llvm.[[TARGET]].radians.v2f32(
2133
// NO_HALF: ret <2 x float> %{{.*}}
2234
half2 test_radians_half2(half2 p0) { return radians(p0); }
23-
// NATIVE_HALF: define noundef <3 x half> @
24-
// NATIVE_HALF: %{{.*}} = call <3 x half> @llvm.dx.radians.v3f16
35+
// NATIVE_HALF: define [[FNATTRS]] <3 x half> @
36+
// NATIVE_HALF: %{{.*}} = call <3 x half> @llvm.[[TARGET]].radians.v3f16
2537
// NATIVE_HALF: ret <3 x half> %{{.*}}
26-
// NO_HALF: define noundef <3 x float> @
27-
// NO_HALF: %{{.*}} = call <3 x float> @llvm.dx.radians.v3f32(
38+
// NO_HALF: define [[FNATTRS]] <3 x float> @
39+
// NO_HALF: %{{.*}} = call <3 x float> @llvm.[[TARGET]].radians.v3f32(
2840
// NO_HALF: ret <3 x float> %{{.*}}
2941
half3 test_radians_half3(half3 p0) { return radians(p0); }
30-
// NATIVE_HALF: define noundef <4 x half> @
31-
// NATIVE_HALF: %{{.*}} = call <4 x half> @llvm.dx.radians.v4f16
42+
// NATIVE_HALF: define [[FNATTRS]] <4 x half> @
43+
// NATIVE_HALF: %{{.*}} = call <4 x half> @llvm.[[TARGET]].radians.v4f16
3244
// NATIVE_HALF: ret <4 x half> %{{.*}}
33-
// NO_HALF: define noundef <4 x float> @
34-
// NO_HALF: %{{.*}} = call <4 x float> @llvm.dx.radians.v4f32(
45+
// NO_HALF: define [[FNATTRS]] <4 x float> @
46+
// NO_HALF: %{{.*}} = call <4 x float> @llvm.[[TARGET]].radians.v4f32(
3547
// NO_HALF: ret <4 x float> %{{.*}}
3648
half4 test_radians_half4(half4 p0) { return radians(p0); }
3749

38-
// CHECK: define noundef float @
39-
// CHECK: %{{.*}} = call float @llvm.dx.radians.f32(
50+
// CHECK: define [[FNATTRS]] float @
51+
// CHECK: %{{.*}} = call float @llvm.[[TARGET]].radians.f32(
4052
// CHECK: ret float %{{.*}}
4153
float test_radians_float(float p0) { return radians(p0); }
42-
// CHECK: define noundef <2 x float> @
43-
// CHECK: %{{.*}} = call <2 x float> @llvm.dx.radians.v2f32
54+
// CHECK: define [[FNATTRS]] <2 x float> @
55+
// CHECK: %{{.*}} = call <2 x float> @llvm.[[TARGET]].radians.v2f32
4456
// CHECK: ret <2 x float> %{{.*}}
4557
float2 test_radians_float2(float2 p0) { return radians(p0); }
46-
// CHECK: define noundef <3 x float> @
47-
// CHECK: %{{.*}} = call <3 x float> @llvm.dx.radians.v3f32
58+
// CHECK: define [[FNATTRS]] <3 x float> @
59+
// CHECK: %{{.*}} = call <3 x float> @llvm.[[TARGET]].radians.v3f32
4860
// CHECK: ret <3 x float> %{{.*}}
4961
float3 test_radians_float3(float3 p0) { return radians(p0); }
50-
// CHECK: define noundef <4 x float> @
51-
// CHECK: %{{.*}} = call <4 x float> @llvm.dx.radians.v4f32
62+
// CHECK: define [[FNATTRS]] <4 x float> @
63+
// CHECK: %{{.*}} = call <4 x float> @llvm.[[TARGET]].radians.v4f32
5264
// CHECK: ret <4 x float> %{{.*}}
5365
float4 test_radians_float4(float4 p0) { return radians(p0); }
5466

0 commit comments

Comments
 (0)