Debian Codegraph @

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

raw
1 // RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
2 // RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \
3 // RUN: -o - | FileCheck %s --check-prefixes=CHECK
4
5 // CHECK-LABEL: test_atan2_double
6 // CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.atan2.f32
7 float test_atan2_double (double p0, double p1) {
8 return atan2(p0, p1);
9 }
10
11 // CHECK-LABEL: test_atan2_double2
12 // CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.atan2.v2f32
13 float2 test_atan2_double2 (double2 p0, double2 p1) {
14 return atan2(p0, p1);
15 }
16
17 // CHECK-LABEL: test_atan2_double3
18 // CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.atan2.v3f32
19 float3 test_atan2_double3 (double3 p0, double3 p1) {
20 return atan2(p0, p1);
21 }
22
23 // CHECK-LABEL: test_atan2_double4
24 // CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.atan2.v4f32
25 float4 test_atan2_double4 (double4 p0, double4 p1) {
26 return atan2(p0, p1);
27 }
28
29 // CHECK-LABEL: test_atan2_int
30 // CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.atan2.f32
31 float test_atan2_int (int p0, int p1) {
32 return atan2(p0, p1);
33 }
34
35 // CHECK-LABEL: test_atan2_int2
36 // CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.atan2.v2f32
37 float2 test_atan2_int2 (int2 p0, int2 p1) {
38 return atan2(p0, p1);
39 }
40
41 // CHECK-LABEL: test_atan2_int3
42 // CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.atan2.v3f32
43 float3 test_atan2_int3 (int3 p0, int3 p1) {
44 return atan2(p0, p1);
45 }
46
47 // CHECK-LABEL: test_atan2_int4
48 // CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.atan2.v4f32
49 float4 test_atan2_int4 (int4 p0, int4 p1) {
50 return atan2(p0, p1);
51 }
52
53 // CHECK-LABEL: test_atan2_uint
54 // CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.atan2.f32
55 float test_atan2_uint (uint p0, uint p1) {
56 return atan2(p0, p1);
57 }
58
59 // CHECK-LABEL: test_atan2_uint2
60 // CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.atan2.v2f32
61 float2 test_atan2_uint2 (uint2 p0, uint2 p1) {
62 return atan2(p0, p1);
63 }
64
65 // CHECK-LABEL: test_atan2_uint3
66 // CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.atan2.v3f32
67 float3 test_atan2_uint3 (uint3 p0, uint3 p1) {
68 return atan2(p0, p1);
69 }
70
71 // CHECK-LABEL: test_atan2_uint4
72 // CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.atan2.v4f32
73 float4 test_atan2_uint4 (uint4 p0, uint4 p1) {
74 return atan2(p0, p1);
75 }
76
77 // CHECK-LABEL: test_atan2_int64_t
78 // CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.atan2.f32
79 float test_atan2_int64_t (int64_t p0, int64_t p1) {
80 return atan2(p0, p1);
81 }
82
83 // CHECK-LABEL: test_atan2_int64_t2
84 // CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.atan2.v2f32
85 float2 test_atan2_int64_t2 (int64_t2 p0, int64_t2 p1) {
86 return atan2(p0, p1);
87 }
88
89 // CHECK-LABEL: test_atan2_int64_t3
90 // CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.atan2.v3f32
91 float3 test_atan2_int64_t3 (int64_t3 p0, int64_t3 p1) {
92 return atan2(p0, p1);
93 }
94
95 // CHECK-LABEL: test_atan2_int64_t4
96 // CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.atan2.v4f32
97 float4 test_atan2_int64_t4 (int64_t4 p0, int64_t4 p1) {
98 return atan2(p0, p1);
99 }
100
101 // CHECK-LABEL: test_atan2_uint64_t
102 // CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.atan2.f32
103 float test_atan2_uint64_t (uint64_t p0, uint64_t p1) {
104 return atan2(p0, p1);
105 }
106
107 // CHECK-LABEL: test_atan2_uint64_t2
108 // CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.atan2.v2f32
109 float2 test_atan2_uint64_t2 (uint64_t2 p0, uint64_t2 p1) {
110 return atan2(p0, p1);
111 }
112
113 // CHECK-LABEL: test_atan2_uint64_t3
114 // CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.atan2.v3f32
115 float3 test_atan2_uint64_t3 (uint64_t3 p0, uint64_t3 p1) {
116 return atan2(p0, p1);
117 }
118
119 // CHECK-LABEL: test_atan2_uint64_t4
120 // CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.atan2.v4f32
121 float4 test_atan2_uint64_t4 (uint64_t4 p0, uint64_t4 p1) {
122 return atan2(p0, p1);
123 }