[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGen / X86 / avx512fp16-abi.c
blob3d1b713a610a53b840d336d71ee9113d885a4e6f
1 // RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -target-feature +avx512fp16 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-C
2 // RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -target-feature +avx512fp16 -x c++ -std=c++11 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-CPP
4 struct half1 {
5 _Float16 a;
6 };
8 struct half1 h1(_Float16 a) {
9 // CHECK: define{{.*}}half @
10 struct half1 x;
11 x.a = a;
12 return x;
15 struct half2 {
16 _Float16 a;
17 _Float16 b;
20 struct half2 h2(_Float16 a, _Float16 b) {
21 // CHECK: define{{.*}}<2 x half> @
22 struct half2 x;
23 x.a = a;
24 x.b = b;
25 return x;
28 struct half3 {
29 _Float16 a;
30 _Float16 b;
31 _Float16 c;
34 struct half3 h3(_Float16 a, _Float16 b, _Float16 c) {
35 // CHECK: define{{.*}}<4 x half> @
36 struct half3 x;
37 x.a = a;
38 x.b = b;
39 x.c = c;
40 return x;
43 struct half4 {
44 _Float16 a;
45 _Float16 b;
46 _Float16 c;
47 _Float16 d;
50 struct half4 h4(_Float16 a, _Float16 b, _Float16 c, _Float16 d) {
51 // CHECK: define{{.*}}<4 x half> @
52 struct half4 x;
53 x.a = a;
54 x.b = b;
55 x.c = c;
56 x.d = d;
57 return x;
60 struct floathalf {
61 float a;
62 _Float16 b;
65 struct floathalf fh(float a, _Float16 b) {
66 // CHECK: define{{.*}}<4 x half> @
67 struct floathalf x;
68 x.a = a;
69 x.b = b;
70 return x;
73 struct floathalf2 {
74 float a;
75 _Float16 b;
76 _Float16 c;
79 struct floathalf2 fh2(float a, _Float16 b, _Float16 c) {
80 // CHECK: define{{.*}}<4 x half> @
81 struct floathalf2 x;
82 x.a = a;
83 x.b = b;
84 x.c = c;
85 return x;
88 struct halffloat {
89 _Float16 a;
90 float b;
93 struct halffloat hf(_Float16 a, float b) {
94 // CHECK: define{{.*}}<4 x half> @
95 struct halffloat x;
96 x.a = a;
97 x.b = b;
98 return x;
101 struct half2float {
102 _Float16 a;
103 _Float16 b;
104 float c;
107 struct half2float h2f(_Float16 a, _Float16 b, float c) {
108 // CHECK: define{{.*}}<4 x half> @
109 struct half2float x;
110 x.a = a;
111 x.b = b;
112 x.c = c;
113 return x;
116 struct floathalf3 {
117 float a;
118 _Float16 b;
119 _Float16 c;
120 _Float16 d;
123 struct floathalf3 fh3(float a, _Float16 b, _Float16 c, _Float16 d) {
124 // CHECK: define{{.*}}{ <4 x half>, half } @
125 struct floathalf3 x;
126 x.a = a;
127 x.b = b;
128 x.c = c;
129 x.d = d;
130 return x;
133 struct half5 {
134 _Float16 a;
135 _Float16 b;
136 _Float16 c;
137 _Float16 d;
138 _Float16 e;
141 struct half5 h5(_Float16 a, _Float16 b, _Float16 c, _Float16 d, _Float16 e) {
142 // CHECK: define{{.*}}{ <4 x half>, half } @
143 struct half5 x;
144 x.a = a;
145 x.b = b;
146 x.c = c;
147 x.d = d;
148 x.e = e;
149 return x;
152 struct float2 {
153 struct {} s;
154 float a;
155 float b;
158 float pr51813(struct float2 s) {
159 // CHECK-C: define{{.*}} @pr51813(<2 x float>
160 // CHECK-CPP: define{{.*}} @_Z7pr518136float2(double {{.*}}, float
161 return s.a;
164 struct float3 {
165 float a;
166 struct {} s;
167 float b;
170 float pr51813_2(struct float3 s) {
171 // CHECK-C: define{{.*}} @pr51813_2(<2 x float>
172 // CHECK-CPP: define{{.*}} @_Z9pr51813_26float3(double {{.*}}, float
173 return s.a;
176 struct shalf2 {
177 struct {} s;
178 _Float16 a;
179 _Float16 b;
182 _Float16 sf2(struct shalf2 s) {
183 // CHECK-C: define{{.*}} @sf2(<2 x half>
184 // CHECK-CPP: define{{.*}} @_Z3sf26shalf2(double {{.*}}
185 return s.a;
188 struct halfs2 {
189 _Float16 a;
190 struct {} s1;
191 _Float16 b;
192 struct {} s2;
195 _Float16 fs2(struct shalf2 s) {
196 // CHECK-C: define{{.*}} @fs2(<2 x half>
197 // CHECK-CPP: define{{.*}} @_Z3fs26shalf2(double {{.*}}
198 return s.a;
201 struct fsd {
202 float a;
203 struct {};
204 double b;
207 struct fsd pr52011(void) {
208 // CHECK: define{{.*}} { float, double } @
211 struct hsd {
212 _Float16 a;
213 struct {};
214 double b;
217 struct hsd pr52011_2(void) {
218 // CHECK: define{{.*}} { half, double } @
221 struct hsf {
222 _Float16 a;
223 struct {};
224 float b;
227 struct hsf pr52011_3(void) {
228 // CHECK: define{{.*}} <4 x half> @
231 struct fds {
232 float a;
233 double b;
234 struct {};
237 struct fds pr52011_4(void) {
238 // CHECK-C: define{{.*}} { float, double } @pr52011_4
239 // CHECK-CPP: define{{.*}} void @_Z9pr52011_4v({{.*}} sret