Debian Codegraph @

clang/test/CodeGenHLSL/builtins/trunc-overloads.hlsl

raw
1 // RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
2 // RUN: -emit-llvm -disable-llvm-passes -o - | \
3 // RUN: FileCheck %s --check-prefixes=CHECK
4
5 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_trunc_double
6 // CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.trunc.f32(
7 float test_trunc_double(double p0) { return trunc(p0); }
8
9 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_trunc_double2
10 // CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.trunc.v2f32
11 float2 test_trunc_double2(double2 p0) { return trunc(p0); }
12
13 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_trunc_double3
14 // CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.trunc.v3f32
15 float3 test_trunc_double3(double3 p0) { return trunc(p0); }
16
17 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_trunc_double4
18 // CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.trunc.v4f32
19 float4 test_trunc_double4(double4 p0) { return trunc(p0); }
20
21 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_trunc_int
22 // CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.trunc.f32(
23 float test_trunc_int(int p0) { return trunc(p0); }
24
25 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_trunc_int2
26 // CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.trunc.v2f32
27 float2 test_trunc_int2(int2 p0) { return trunc(p0); }
28
29 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_trunc_int3
30 // CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.trunc.v3f32
31 float3 test_trunc_int3(int3 p0) { return trunc(p0); }
32
33 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_trunc_int4
34 // CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.trunc.v4f32
35 float4 test_trunc_int4(int4 p0) { return trunc(p0); }
36
37 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_trunc_uint
38 // CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.trunc.f32(
39 float test_trunc_uint(uint p0) { return trunc(p0); }
40
41 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_trunc_uint2
42 // CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.trunc.v2f32
43 float2 test_trunc_uint2(uint2 p0) { return trunc(p0); }
44
45 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_trunc_uint3
46 // CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.trunc.v3f32
47 float3 test_trunc_uint3(uint3 p0) { return trunc(p0); }
48
49 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_trunc_uint4
50 // CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.trunc.v4f32
51 float4 test_trunc_uint4(uint4 p0) { return trunc(p0); }
52
53 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_trunc_int64_t
54 // CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.trunc.f32(
55 float test_trunc_int64_t(int64_t p0) { return trunc(p0); }
56
57 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_trunc_int64_t2
58 // CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.trunc.v2f32
59 float2 test_trunc_int64_t2(int64_t2 p0) { return trunc(p0); }
60
61 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_trunc_int64_t3
62 // CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.trunc.v3f32
63 float3 test_trunc_int64_t3(int64_t3 p0) { return trunc(p0); }
64
65 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_trunc_int64_t4
66 // CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.trunc.v4f32
67 float4 test_trunc_int64_t4(int64_t4 p0) { return trunc(p0); }
68
69 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_trunc_uint64_t
70 // CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.trunc.f32(
71 float test_trunc_uint64_t(uint64_t p0) { return trunc(p0); }
72
73 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_trunc_uint64_t2
74 // CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.trunc.v2f32
75 float2 test_trunc_uint64_t2(uint64_t2 p0) { return trunc(p0); }
76
77 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_trunc_uint64_t3
78 // CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.trunc.v3f32
79 float3 test_trunc_uint64_t3(uint64_t3 p0) { return trunc(p0); }
80
81 // CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_trunc_uint64_t4
82 // CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.trunc.v4f32
83 float4 test_trunc_uint64_t4(uint64_t4 p0) { return trunc(p0); }