[OptTable] Fix typo VALUE => VALUES (NFCI) (#121523)
[llvm-project.git] / clang / test / CodeGenHLSL / builtins / trunc.hlsl
blob3da12c88aa7fecfb6a9f8c0246c72d6fb8d7122d
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
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
8 // NATIVE_HALF-LABEL: define noundef half @_Z15test_trunc_half
9 // NATIVE_HALF: call half @llvm.trunc.f16(
10 // NO_HALF-LABEL: define noundef float @_Z15test_trunc_half
11 // NO_HALF: call float @llvm.trunc.f32(
12 half test_trunc_half(half p0) { return trunc(p0); }
14 // NATIVE_HALF-LABEL: define noundef <2 x half> @_Z16test_trunc_half2
15 // NATIVE_HALF: call <2 x half> @llvm.trunc.v2f16
16 // NO_HALF-LABEL: define noundef <2 x float> @_Z16test_trunc_half2
17 // NO_HALF: call <2 x float> @llvm.trunc.v2f32(
18 half2 test_trunc_half2(half2 p0) { return trunc(p0); }
20 // NATIVE_HALF-LABEL: define noundef <3 x half> @_Z16test_trunc_half3
21 // NATIVE_HALF: call <3 x half> @llvm.trunc.v3f16
22 // NO_HALF-LABEL: define noundef <3 x float> @_Z16test_trunc_half3
23 // NO_HALF: call <3 x float> @llvm.trunc.v3f32(
24 half3 test_trunc_half3(half3 p0) { return trunc(p0); }
26 // NATIVE_HALF-LABEL: define noundef <4 x half> @_Z16test_trunc_half4
27 // NATIVE_HALF: call <4 x half> @llvm.trunc.v4f16
28 // NO_HALF-LABEL: define noundef <4 x float> @_Z16test_trunc_half4
29 // NO_HALF: call <4 x float> @llvm.trunc.v4f32(
30 half4 test_trunc_half4(half4 p0) { return trunc(p0); }
32 // CHECK-LABEL: define noundef float @_Z16test_trunc_float
33 // CHECK: call float @llvm.trunc.f32(
34 float test_trunc_float(float p0) { return trunc(p0); }
36 // CHECK-LABEL: define noundef <2 x float> @_Z17test_trunc_float2
37 // CHECK: call <2 x float> @llvm.trunc.v2f32
38 float2 test_trunc_float2(float2 p0) { return trunc(p0); }
40 // CHECK-LABEL: define noundef <3 x float> @_Z17test_trunc_float3
41 // CHECK: call <3 x float> @llvm.trunc.v3f32
42 float3 test_trunc_float3(float3 p0) { return trunc(p0); }
44 // CHECK-LABEL: define noundef <4 x float> @_Z17test_trunc_float4
45 // CHECK: call <4 x float> @llvm.trunc.v4f32
46 float4 test_trunc_float4(float4 p0) { return trunc(p0); }