[OptTable] Fix typo VALUE => VALUES (NFCI) (#121523)
[llvm-project.git] / clang / test / CodeGenHLSL / builtins / saturate.hlsl
blobc221f6e0f2c36fe5a2712f7456757f3efb425cec
1 // RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
2 // RUN:  -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \
3 // RUN:  FileCheck %s --check-prefixes=CHECK,NATIVE_HALF -Dtar=dx
4 // RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
5 // RUN:  -emit-llvm -disable-llvm-passes -o - | \
6 // RUN:  FileCheck %s --check-prefixes=CHECK,NO_HALF -Dtar=dx
8 // RUN: %clang_cc1 -finclude-default-header -triple spirv-unknown-vulkan-library %s \
9 // RUN:  -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \
10 // RUN:  FileCheck %s --check-prefixes=CHECK,NATIVE_HALF -Dtar=spv
11 // RUN: %clang_cc1 -finclude-default-header -triple spirv-unknown-vulkan-library %s \
12 // RUN:  -emit-llvm -disable-llvm-passes -o - | \
13 // RUN:  FileCheck %s --check-prefixes=CHECK,NO_HALF -Dtar=spv
15 // NATIVE_HALF-LABEL: define{{.*}} half @_Z18test_saturate_halfDh
16 // NATIVE_HALF: call half @llvm.[[tar]].saturate.f16(
17 // NO_HALF-LABEL: define{{.*}} float @_Z18test_saturate_halfDh
18 // NO_HALF: call float @llvm.[[tar]].saturate.f32(
19 half test_saturate_half(half p0) { return saturate(p0); }
20 // NATIVE_HALF-LABEL: define{{.*}} <2 x half> @_Z19test_saturate_half2Dv2_Dh
21 // NATIVE_HALF: call <2 x half> @llvm.[[tar]].saturate.v2f16
22 // NO_HALF-LABEL: define{{.*}} <2 x float> @_Z19test_saturate_half2Dv2_Dh
23 // NO_HALF: call <2 x float> @llvm.[[tar]].saturate.v2f32(
24 half2 test_saturate_half2(half2 p0) { return saturate(p0); }
25 // NATIVE_HALF-LABEL: define{{.*}} <3 x half> @_Z19test_saturate_half3Dv3_Dh(
26 // NATIVE_HALF: call <3 x half> @llvm.[[tar]].saturate.v3f16
27 // NO_HALF-LABEL: define{{.*}} <3 x float> @_Z19test_saturate_half3Dv3_Dh(<3 x float>
28 // NO_HALF: call <3 x float> @llvm.[[tar]].saturate.v3f32(
29 half3 test_saturate_half3(half3 p0) { return saturate(p0); }
30 // NATIVE_HALF-LABEL: define{{.*}} <4 x half> @_Z19test_saturate_half4Dv4_Dh(
31 // NATIVE_HALF: call <4 x half> @llvm.[[tar]].saturate.v4f16
32 // NO_HALF-LABEL: define{{.*}} <4 x float> @_Z19test_saturate_half4Dv4_Dh(<4 x float>
33 // NO_HALF: call <4 x float> @llvm.[[tar]].saturate.v4f32(
34 half4 test_saturate_half4(half4 p0) { return saturate(p0); }
36 // CHECK-LABEL: define{{.*}} float @_Z19test_saturate_floatf(
37 // CHECK: call float @llvm.[[tar]].saturate.f32(
38 float test_saturate_float(float p0) { return saturate(p0); }
39 // CHECK-LABEL: define{{.*}} <2 x float> @_Z20test_saturate_float2Dv2_f(<2 x float>
40 // CHECK: call <2 x float> @llvm.[[tar]].saturate.v2f32
41 float2 test_saturate_float2(float2 p0) { return saturate(p0); }
42 // CHECK-LABEL: define{{.*}} <3 x float> @_Z20test_saturate_float3Dv3_f(<3 x float>
43 // CHECK: call <3 x float> @llvm.[[tar]].saturate.v3f32
44 float3 test_saturate_float3(float3 p0) { return saturate(p0); }
45 // CHECK-LABEL: define{{.*}} <4 x float> @_Z20test_saturate_float4Dv4_f(<4 x float>
46 // CHECK: call <4 x float> @llvm.[[tar]].saturate.v4f32
47 float4 test_saturate_float4(float4 p0) { return saturate(p0); }
49 // CHECK-LABEL: define{{.*}} double @_Z20test_saturate_doubled(double
50 // CHECK: call double @llvm.[[tar]].saturate.f64(
51 double test_saturate_double(double p0) { return saturate(p0); }
52 // CHECK-LABEL: define{{.*}} <2 x double> @_Z21test_saturate_double2Dv2_d(<2 x double>
53 // CHECK: call <2 x double> @llvm.[[tar]].saturate.v2f64
54 double2 test_saturate_double2(double2 p0) { return saturate(p0); }
55 // CHECK-LABEL: define{{.*}} <3 x double> @_Z21test_saturate_double3Dv3_d(<3 x double>
56 // CHECK: call <3 x double> @llvm.[[tar]].saturate.v3f64
57 double3 test_saturate_double3(double3 p0) { return saturate(p0); }
58 // CHECK-LABEL: define{{.*}} <4 x double> @_Z21test_saturate_double4Dv4_d(<4 x double>
59 // CHECK: call <4 x double> @llvm.[[tar]].saturate.v4f64
60 double4 test_saturate_double4(double4 p0) { return saturate(p0); }