Revert "[lldb][test] Remove compiler version check and use regex" (#124101)
[llvm-project.git] / clang / test / C / C11 / n1396.c
blob6f76cfe959496181d813ae36f1c825ac482b124d
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5
2 // RUN: %clang_cc1 -triple=x86_64 -emit-llvm -o - %s | FileCheck --check-prefixes=CHECK-X64 %s
3 // RUN: %clang_cc1 -triple=aarch64 -emit-llvm -o - %s | FileCheck --check-prefixes=CHECK-AARCH64 %s
4 // RUN: %clang_cc1 -triple=arm -emit-llvm -o - %s | FileCheck --check-prefixes=CHECK-ARM %s
5 // RUN: %clang_cc1 -triple=ppc32 -emit-llvm -o - %s | FileCheck --check-prefixes=CHECK-PPC32 %s
6 // RUN: %clang_cc1 -triple=ppc64 -emit-llvm -o - %s | FileCheck --check-prefixes=CHECK-PPC64 %s
7 // RUN: %clang_cc1 -triple=sparcv9 -emit-llvm -o - %s | FileCheck --check-prefixes=CHECK-SPARCV9 %s
9 /* WG14 N1396: Partial
10 * Wide function returns (alternate proposal)
12 * This only applies if attempting to conform to Annex F. Clang is not claiming
13 * conformance to Annex F, but we do aim for conformance. This means that the
14 * return statement converts the value to the return type of the function
15 * rather than return the result in a wider evaluation format. We test this by
16 * using a return statement without a cast and ensure it produces the same IR
17 * as a return statement with an explicit cast.
19 * Clang conforms on targets other than 32-bit x86 (without SSE2), which is why
20 * support is only partial. Once support for that target is dropped, Clang
21 * should be conforming to this paper on all targets. See
22 * https://github.com/llvm/llvm-project/issues/44218 and other linked issues
23 * for further details.
27 // CHECK-X64-LABEL: define dso_local float @extended_float_func(
28 // CHECK-X64-SAME: float noundef [[X:%.*]]) #[[ATTR0:[0-9]+]] {
29 // CHECK-X64-NEXT: [[ENTRY:.*:]]
30 // CHECK-X64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
31 // CHECK-X64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
32 // CHECK-X64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
33 // CHECK-X64-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to x86_fp80
34 // CHECK-X64-NEXT: [[MUL:%.*]] = fmul x86_fp80 [[CONV]], 0xK3FFF8000000000000000
35 // CHECK-X64-NEXT: [[CONV1:%.*]] = fptrunc x86_fp80 [[MUL]] to float
36 // CHECK-X64-NEXT: ret float [[CONV1]]
38 // CHECK-AARCH64-LABEL: define dso_local float @extended_float_func(
39 // CHECK-AARCH64-SAME: float noundef [[X:%.*]]) #[[ATTR0:[0-9]+]] {
40 // CHECK-AARCH64-NEXT: [[ENTRY:.*:]]
41 // CHECK-AARCH64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
42 // CHECK-AARCH64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
43 // CHECK-AARCH64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
44 // CHECK-AARCH64-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to fp128
45 // CHECK-AARCH64-NEXT: [[MUL:%.*]] = fmul fp128 [[CONV]], 0xL00000000000000003FFF000000000000
46 // CHECK-AARCH64-NEXT: [[CONV1:%.*]] = fptrunc fp128 [[MUL]] to float
47 // CHECK-AARCH64-NEXT: ret float [[CONV1]]
49 // CHECK-ARM-LABEL: define dso_local arm_aapcscc float @extended_float_func(
50 // CHECK-ARM-SAME: float noundef [[X:%.*]]) #[[ATTR0:[0-9]+]] {
51 // CHECK-ARM-NEXT: [[ENTRY:.*:]]
52 // CHECK-ARM-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
53 // CHECK-ARM-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
54 // CHECK-ARM-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
55 // CHECK-ARM-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to double
56 // CHECK-ARM-NEXT: [[MUL:%.*]] = fmul double [[CONV]], 1.000000e+00
57 // CHECK-ARM-NEXT: [[CONV1:%.*]] = fptrunc double [[MUL]] to float
58 // CHECK-ARM-NEXT: ret float [[CONV1]]
60 // CHECK-PPC32-LABEL: define dso_local float @extended_float_func(
61 // CHECK-PPC32-SAME: float noundef [[X:%.*]]) #[[ATTR0:[0-9]+]] {
62 // CHECK-PPC32-NEXT: [[ENTRY:.*:]]
63 // CHECK-PPC32-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
64 // CHECK-PPC32-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
65 // CHECK-PPC32-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
66 // CHECK-PPC32-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to ppc_fp128
67 // CHECK-PPC32-NEXT: [[MUL:%.*]] = fmul ppc_fp128 [[CONV]], 0xM3FF00000000000000000000000000000
68 // CHECK-PPC32-NEXT: [[CONV1:%.*]] = fptrunc ppc_fp128 [[MUL]] to float
69 // CHECK-PPC32-NEXT: ret float [[CONV1]]
71 // CHECK-PPC64-LABEL: define dso_local float @extended_float_func(
72 // CHECK-PPC64-SAME: float noundef [[X:%.*]]) #[[ATTR0:[0-9]+]] {
73 // CHECK-PPC64-NEXT: [[ENTRY:.*:]]
74 // CHECK-PPC64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
75 // CHECK-PPC64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
76 // CHECK-PPC64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
77 // CHECK-PPC64-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to ppc_fp128
78 // CHECK-PPC64-NEXT: [[MUL:%.*]] = fmul ppc_fp128 [[CONV]], 0xM3FF00000000000000000000000000000
79 // CHECK-PPC64-NEXT: [[CONV1:%.*]] = fptrunc ppc_fp128 [[MUL]] to float
80 // CHECK-PPC64-NEXT: ret float [[CONV1]]
82 // CHECK-SPARCV9-LABEL: define dso_local float @extended_float_func(
83 // CHECK-SPARCV9-SAME: float noundef [[X:%.*]]) #[[ATTR0:[0-9]+]] {
84 // CHECK-SPARCV9-NEXT: [[ENTRY:.*:]]
85 // CHECK-SPARCV9-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
86 // CHECK-SPARCV9-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
87 // CHECK-SPARCV9-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
88 // CHECK-SPARCV9-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to fp128
89 // CHECK-SPARCV9-NEXT: [[MUL:%.*]] = fmul fp128 [[CONV]], 0xL00000000000000003FFF000000000000
90 // CHECK-SPARCV9-NEXT: [[CONV1:%.*]] = fptrunc fp128 [[MUL]] to float
91 // CHECK-SPARCV9-NEXT: ret float [[CONV1]]
93 float extended_float_func(float x) {
94 #pragma clang fp eval_method(extended)
95 return x * 1.0f;
98 // CHECK-X64-LABEL: define dso_local float @extended_float_func_cast(
99 // CHECK-X64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
100 // CHECK-X64-NEXT: [[ENTRY:.*:]]
101 // CHECK-X64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
102 // CHECK-X64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
103 // CHECK-X64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
104 // CHECK-X64-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to x86_fp80
105 // CHECK-X64-NEXT: [[MUL:%.*]] = fmul x86_fp80 [[CONV]], 0xK3FFF8000000000000000
106 // CHECK-X64-NEXT: [[CONV1:%.*]] = fptrunc x86_fp80 [[MUL]] to float
107 // CHECK-X64-NEXT: ret float [[CONV1]]
109 // CHECK-AARCH64-LABEL: define dso_local float @extended_float_func_cast(
110 // CHECK-AARCH64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
111 // CHECK-AARCH64-NEXT: [[ENTRY:.*:]]
112 // CHECK-AARCH64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
113 // CHECK-AARCH64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
114 // CHECK-AARCH64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
115 // CHECK-AARCH64-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to fp128
116 // CHECK-AARCH64-NEXT: [[MUL:%.*]] = fmul fp128 [[CONV]], 0xL00000000000000003FFF000000000000
117 // CHECK-AARCH64-NEXT: [[CONV1:%.*]] = fptrunc fp128 [[MUL]] to float
118 // CHECK-AARCH64-NEXT: ret float [[CONV1]]
120 // CHECK-ARM-LABEL: define dso_local arm_aapcscc float @extended_float_func_cast(
121 // CHECK-ARM-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
122 // CHECK-ARM-NEXT: [[ENTRY:.*:]]
123 // CHECK-ARM-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
124 // CHECK-ARM-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
125 // CHECK-ARM-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
126 // CHECK-ARM-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to double
127 // CHECK-ARM-NEXT: [[MUL:%.*]] = fmul double [[CONV]], 1.000000e+00
128 // CHECK-ARM-NEXT: [[CONV1:%.*]] = fptrunc double [[MUL]] to float
129 // CHECK-ARM-NEXT: ret float [[CONV1]]
131 // CHECK-PPC32-LABEL: define dso_local float @extended_float_func_cast(
132 // CHECK-PPC32-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
133 // CHECK-PPC32-NEXT: [[ENTRY:.*:]]
134 // CHECK-PPC32-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
135 // CHECK-PPC32-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
136 // CHECK-PPC32-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
137 // CHECK-PPC32-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to ppc_fp128
138 // CHECK-PPC32-NEXT: [[MUL:%.*]] = fmul ppc_fp128 [[CONV]], 0xM3FF00000000000000000000000000000
139 // CHECK-PPC32-NEXT: [[CONV1:%.*]] = fptrunc ppc_fp128 [[MUL]] to float
140 // CHECK-PPC32-NEXT: ret float [[CONV1]]
142 // CHECK-PPC64-LABEL: define dso_local float @extended_float_func_cast(
143 // CHECK-PPC64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
144 // CHECK-PPC64-NEXT: [[ENTRY:.*:]]
145 // CHECK-PPC64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
146 // CHECK-PPC64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
147 // CHECK-PPC64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
148 // CHECK-PPC64-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to ppc_fp128
149 // CHECK-PPC64-NEXT: [[MUL:%.*]] = fmul ppc_fp128 [[CONV]], 0xM3FF00000000000000000000000000000
150 // CHECK-PPC64-NEXT: [[CONV1:%.*]] = fptrunc ppc_fp128 [[MUL]] to float
151 // CHECK-PPC64-NEXT: ret float [[CONV1]]
153 // CHECK-SPARCV9-LABEL: define dso_local float @extended_float_func_cast(
154 // CHECK-SPARCV9-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
155 // CHECK-SPARCV9-NEXT: [[ENTRY:.*:]]
156 // CHECK-SPARCV9-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
157 // CHECK-SPARCV9-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
158 // CHECK-SPARCV9-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
159 // CHECK-SPARCV9-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to fp128
160 // CHECK-SPARCV9-NEXT: [[MUL:%.*]] = fmul fp128 [[CONV]], 0xL00000000000000003FFF000000000000
161 // CHECK-SPARCV9-NEXT: [[CONV1:%.*]] = fptrunc fp128 [[MUL]] to float
162 // CHECK-SPARCV9-NEXT: ret float [[CONV1]]
164 float extended_float_func_cast(float x) {
165 #pragma clang fp eval_method(extended)
166 return (float)(x * 1.0f);
169 // CHECK-X64-LABEL: define dso_local float @extended_double_func(
170 // CHECK-X64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
171 // CHECK-X64-NEXT: [[ENTRY:.*:]]
172 // CHECK-X64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
173 // CHECK-X64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
174 // CHECK-X64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
175 // CHECK-X64-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to x86_fp80
176 // CHECK-X64-NEXT: [[MUL:%.*]] = fmul x86_fp80 [[CONV]], 0xK3FFF8000000000000000
177 // CHECK-X64-NEXT: [[CONV1:%.*]] = fptrunc x86_fp80 [[MUL]] to float
178 // CHECK-X64-NEXT: ret float [[CONV1]]
180 // CHECK-AARCH64-LABEL: define dso_local float @extended_double_func(
181 // CHECK-AARCH64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
182 // CHECK-AARCH64-NEXT: [[ENTRY:.*:]]
183 // CHECK-AARCH64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
184 // CHECK-AARCH64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
185 // CHECK-AARCH64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
186 // CHECK-AARCH64-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to fp128
187 // CHECK-AARCH64-NEXT: [[MUL:%.*]] = fmul fp128 [[CONV]], 0xL00000000000000003FFF000000000000
188 // CHECK-AARCH64-NEXT: [[CONV1:%.*]] = fptrunc fp128 [[MUL]] to float
189 // CHECK-AARCH64-NEXT: ret float [[CONV1]]
191 // CHECK-ARM-LABEL: define dso_local arm_aapcscc float @extended_double_func(
192 // CHECK-ARM-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
193 // CHECK-ARM-NEXT: [[ENTRY:.*:]]
194 // CHECK-ARM-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
195 // CHECK-ARM-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
196 // CHECK-ARM-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
197 // CHECK-ARM-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to double
198 // CHECK-ARM-NEXT: [[MUL:%.*]] = fmul double [[CONV]], 1.000000e+00
199 // CHECK-ARM-NEXT: [[CONV1:%.*]] = fptrunc double [[MUL]] to float
200 // CHECK-ARM-NEXT: ret float [[CONV1]]
202 // CHECK-PPC32-LABEL: define dso_local float @extended_double_func(
203 // CHECK-PPC32-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
204 // CHECK-PPC32-NEXT: [[ENTRY:.*:]]
205 // CHECK-PPC32-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
206 // CHECK-PPC32-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
207 // CHECK-PPC32-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
208 // CHECK-PPC32-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to ppc_fp128
209 // CHECK-PPC32-NEXT: [[MUL:%.*]] = fmul ppc_fp128 [[CONV]], 0xM3FF00000000000000000000000000000
210 // CHECK-PPC32-NEXT: [[CONV1:%.*]] = fptrunc ppc_fp128 [[MUL]] to float
211 // CHECK-PPC32-NEXT: ret float [[CONV1]]
213 // CHECK-PPC64-LABEL: define dso_local float @extended_double_func(
214 // CHECK-PPC64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
215 // CHECK-PPC64-NEXT: [[ENTRY:.*:]]
216 // CHECK-PPC64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
217 // CHECK-PPC64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
218 // CHECK-PPC64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
219 // CHECK-PPC64-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to ppc_fp128
220 // CHECK-PPC64-NEXT: [[MUL:%.*]] = fmul ppc_fp128 [[CONV]], 0xM3FF00000000000000000000000000000
221 // CHECK-PPC64-NEXT: [[CONV1:%.*]] = fptrunc ppc_fp128 [[MUL]] to float
222 // CHECK-PPC64-NEXT: ret float [[CONV1]]
224 // CHECK-SPARCV9-LABEL: define dso_local float @extended_double_func(
225 // CHECK-SPARCV9-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
226 // CHECK-SPARCV9-NEXT: [[ENTRY:.*:]]
227 // CHECK-SPARCV9-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
228 // CHECK-SPARCV9-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
229 // CHECK-SPARCV9-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
230 // CHECK-SPARCV9-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to fp128
231 // CHECK-SPARCV9-NEXT: [[MUL:%.*]] = fmul fp128 [[CONV]], 0xL00000000000000003FFF000000000000
232 // CHECK-SPARCV9-NEXT: [[CONV1:%.*]] = fptrunc fp128 [[MUL]] to float
233 // CHECK-SPARCV9-NEXT: ret float [[CONV1]]
235 float extended_double_func(float x) {
236 #pragma clang fp eval_method(extended)
237 return x * 1.0;
240 // CHECK-X64-LABEL: define dso_local float @extended_double_func_cast(
241 // CHECK-X64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
242 // CHECK-X64-NEXT: [[ENTRY:.*:]]
243 // CHECK-X64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
244 // CHECK-X64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
245 // CHECK-X64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
246 // CHECK-X64-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to x86_fp80
247 // CHECK-X64-NEXT: [[MUL:%.*]] = fmul x86_fp80 [[CONV]], 0xK3FFF8000000000000000
248 // CHECK-X64-NEXT: [[CONV1:%.*]] = fptrunc x86_fp80 [[MUL]] to float
249 // CHECK-X64-NEXT: ret float [[CONV1]]
251 // CHECK-AARCH64-LABEL: define dso_local float @extended_double_func_cast(
252 // CHECK-AARCH64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
253 // CHECK-AARCH64-NEXT: [[ENTRY:.*:]]
254 // CHECK-AARCH64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
255 // CHECK-AARCH64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
256 // CHECK-AARCH64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
257 // CHECK-AARCH64-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to fp128
258 // CHECK-AARCH64-NEXT: [[MUL:%.*]] = fmul fp128 [[CONV]], 0xL00000000000000003FFF000000000000
259 // CHECK-AARCH64-NEXT: [[CONV1:%.*]] = fptrunc fp128 [[MUL]] to float
260 // CHECK-AARCH64-NEXT: ret float [[CONV1]]
262 // CHECK-ARM-LABEL: define dso_local arm_aapcscc float @extended_double_func_cast(
263 // CHECK-ARM-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
264 // CHECK-ARM-NEXT: [[ENTRY:.*:]]
265 // CHECK-ARM-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
266 // CHECK-ARM-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
267 // CHECK-ARM-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
268 // CHECK-ARM-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to double
269 // CHECK-ARM-NEXT: [[MUL:%.*]] = fmul double [[CONV]], 1.000000e+00
270 // CHECK-ARM-NEXT: [[CONV1:%.*]] = fptrunc double [[MUL]] to float
271 // CHECK-ARM-NEXT: ret float [[CONV1]]
273 // CHECK-PPC32-LABEL: define dso_local float @extended_double_func_cast(
274 // CHECK-PPC32-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
275 // CHECK-PPC32-NEXT: [[ENTRY:.*:]]
276 // CHECK-PPC32-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
277 // CHECK-PPC32-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
278 // CHECK-PPC32-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
279 // CHECK-PPC32-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to ppc_fp128
280 // CHECK-PPC32-NEXT: [[MUL:%.*]] = fmul ppc_fp128 [[CONV]], 0xM3FF00000000000000000000000000000
281 // CHECK-PPC32-NEXT: [[CONV1:%.*]] = fptrunc ppc_fp128 [[MUL]] to float
282 // CHECK-PPC32-NEXT: ret float [[CONV1]]
284 // CHECK-PPC64-LABEL: define dso_local float @extended_double_func_cast(
285 // CHECK-PPC64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
286 // CHECK-PPC64-NEXT: [[ENTRY:.*:]]
287 // CHECK-PPC64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
288 // CHECK-PPC64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
289 // CHECK-PPC64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
290 // CHECK-PPC64-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to ppc_fp128
291 // CHECK-PPC64-NEXT: [[MUL:%.*]] = fmul ppc_fp128 [[CONV]], 0xM3FF00000000000000000000000000000
292 // CHECK-PPC64-NEXT: [[CONV1:%.*]] = fptrunc ppc_fp128 [[MUL]] to float
293 // CHECK-PPC64-NEXT: ret float [[CONV1]]
295 // CHECK-SPARCV9-LABEL: define dso_local float @extended_double_func_cast(
296 // CHECK-SPARCV9-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
297 // CHECK-SPARCV9-NEXT: [[ENTRY:.*:]]
298 // CHECK-SPARCV9-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
299 // CHECK-SPARCV9-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
300 // CHECK-SPARCV9-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
301 // CHECK-SPARCV9-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to fp128
302 // CHECK-SPARCV9-NEXT: [[MUL:%.*]] = fmul fp128 [[CONV]], 0xL00000000000000003FFF000000000000
303 // CHECK-SPARCV9-NEXT: [[CONV1:%.*]] = fptrunc fp128 [[MUL]] to float
304 // CHECK-SPARCV9-NEXT: ret float [[CONV1]]
306 float extended_double_func_cast(float x) {
307 #pragma clang fp eval_method(extended)
308 return (float)(x * 1.0);
311 // CHECK-X64-LABEL: define dso_local float @float_source_func(
312 // CHECK-X64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
313 // CHECK-X64-NEXT: [[ENTRY:.*:]]
314 // CHECK-X64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
315 // CHECK-X64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
316 // CHECK-X64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
317 // CHECK-X64-NEXT: [[MUL:%.*]] = fmul float [[TMP0]], 1.000000e+00
318 // CHECK-X64-NEXT: ret float [[MUL]]
320 // CHECK-AARCH64-LABEL: define dso_local float @float_source_func(
321 // CHECK-AARCH64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
322 // CHECK-AARCH64-NEXT: [[ENTRY:.*:]]
323 // CHECK-AARCH64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
324 // CHECK-AARCH64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
325 // CHECK-AARCH64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
326 // CHECK-AARCH64-NEXT: [[MUL:%.*]] = fmul float [[TMP0]], 1.000000e+00
327 // CHECK-AARCH64-NEXT: ret float [[MUL]]
329 // CHECK-ARM-LABEL: define dso_local arm_aapcscc float @float_source_func(
330 // CHECK-ARM-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
331 // CHECK-ARM-NEXT: [[ENTRY:.*:]]
332 // CHECK-ARM-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
333 // CHECK-ARM-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
334 // CHECK-ARM-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
335 // CHECK-ARM-NEXT: [[MUL:%.*]] = fmul float [[TMP0]], 1.000000e+00
336 // CHECK-ARM-NEXT: ret float [[MUL]]
338 // CHECK-PPC32-LABEL: define dso_local float @float_source_func(
339 // CHECK-PPC32-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
340 // CHECK-PPC32-NEXT: [[ENTRY:.*:]]
341 // CHECK-PPC32-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
342 // CHECK-PPC32-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
343 // CHECK-PPC32-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
344 // CHECK-PPC32-NEXT: [[MUL:%.*]] = fmul float [[TMP0]], 1.000000e+00
345 // CHECK-PPC32-NEXT: ret float [[MUL]]
347 // CHECK-PPC64-LABEL: define dso_local float @float_source_func(
348 // CHECK-PPC64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
349 // CHECK-PPC64-NEXT: [[ENTRY:.*:]]
350 // CHECK-PPC64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
351 // CHECK-PPC64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
352 // CHECK-PPC64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
353 // CHECK-PPC64-NEXT: [[MUL:%.*]] = fmul float [[TMP0]], 1.000000e+00
354 // CHECK-PPC64-NEXT: ret float [[MUL]]
356 // CHECK-SPARCV9-LABEL: define dso_local float @float_source_func(
357 // CHECK-SPARCV9-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
358 // CHECK-SPARCV9-NEXT: [[ENTRY:.*:]]
359 // CHECK-SPARCV9-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
360 // CHECK-SPARCV9-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
361 // CHECK-SPARCV9-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
362 // CHECK-SPARCV9-NEXT: [[MUL:%.*]] = fmul float [[TMP0]], 1.000000e+00
363 // CHECK-SPARCV9-NEXT: ret float [[MUL]]
365 float float_source_func(float x) {
366 #pragma clang fp eval_method(source)
367 return x * 1.0f;
370 // CHECK-X64-LABEL: define dso_local float @float_source_func_cast(
371 // CHECK-X64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
372 // CHECK-X64-NEXT: [[ENTRY:.*:]]
373 // CHECK-X64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
374 // CHECK-X64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
375 // CHECK-X64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
376 // CHECK-X64-NEXT: [[MUL:%.*]] = fmul float [[TMP0]], 1.000000e+00
377 // CHECK-X64-NEXT: ret float [[MUL]]
379 // CHECK-AARCH64-LABEL: define dso_local float @float_source_func_cast(
380 // CHECK-AARCH64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
381 // CHECK-AARCH64-NEXT: [[ENTRY:.*:]]
382 // CHECK-AARCH64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
383 // CHECK-AARCH64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
384 // CHECK-AARCH64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
385 // CHECK-AARCH64-NEXT: [[MUL:%.*]] = fmul float [[TMP0]], 1.000000e+00
386 // CHECK-AARCH64-NEXT: ret float [[MUL]]
388 // CHECK-ARM-LABEL: define dso_local arm_aapcscc float @float_source_func_cast(
389 // CHECK-ARM-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
390 // CHECK-ARM-NEXT: [[ENTRY:.*:]]
391 // CHECK-ARM-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
392 // CHECK-ARM-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
393 // CHECK-ARM-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
394 // CHECK-ARM-NEXT: [[MUL:%.*]] = fmul float [[TMP0]], 1.000000e+00
395 // CHECK-ARM-NEXT: ret float [[MUL]]
397 // CHECK-PPC32-LABEL: define dso_local float @float_source_func_cast(
398 // CHECK-PPC32-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
399 // CHECK-PPC32-NEXT: [[ENTRY:.*:]]
400 // CHECK-PPC32-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
401 // CHECK-PPC32-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
402 // CHECK-PPC32-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
403 // CHECK-PPC32-NEXT: [[MUL:%.*]] = fmul float [[TMP0]], 1.000000e+00
404 // CHECK-PPC32-NEXT: ret float [[MUL]]
406 // CHECK-PPC64-LABEL: define dso_local float @float_source_func_cast(
407 // CHECK-PPC64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
408 // CHECK-PPC64-NEXT: [[ENTRY:.*:]]
409 // CHECK-PPC64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
410 // CHECK-PPC64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
411 // CHECK-PPC64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
412 // CHECK-PPC64-NEXT: [[MUL:%.*]] = fmul float [[TMP0]], 1.000000e+00
413 // CHECK-PPC64-NEXT: ret float [[MUL]]
415 // CHECK-SPARCV9-LABEL: define dso_local float @float_source_func_cast(
416 // CHECK-SPARCV9-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
417 // CHECK-SPARCV9-NEXT: [[ENTRY:.*:]]
418 // CHECK-SPARCV9-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
419 // CHECK-SPARCV9-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
420 // CHECK-SPARCV9-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
421 // CHECK-SPARCV9-NEXT: [[MUL:%.*]] = fmul float [[TMP0]], 1.000000e+00
422 // CHECK-SPARCV9-NEXT: ret float [[MUL]]
424 float float_source_func_cast(float x) {
425 #pragma clang fp eval_method(source)
426 return (float)(x * 1.0f);
429 // CHECK-X64-LABEL: define dso_local float @double_source_func(
430 // CHECK-X64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
431 // CHECK-X64-NEXT: [[ENTRY:.*:]]
432 // CHECK-X64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
433 // CHECK-X64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
434 // CHECK-X64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
435 // CHECK-X64-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to double
436 // CHECK-X64-NEXT: [[MUL:%.*]] = fmul double [[CONV]], 1.000000e+00
437 // CHECK-X64-NEXT: [[CONV1:%.*]] = fptrunc double [[MUL]] to float
438 // CHECK-X64-NEXT: ret float [[CONV1]]
440 // CHECK-AARCH64-LABEL: define dso_local float @double_source_func(
441 // CHECK-AARCH64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
442 // CHECK-AARCH64-NEXT: [[ENTRY:.*:]]
443 // CHECK-AARCH64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
444 // CHECK-AARCH64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
445 // CHECK-AARCH64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
446 // CHECK-AARCH64-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to double
447 // CHECK-AARCH64-NEXT: [[MUL:%.*]] = fmul double [[CONV]], 1.000000e+00
448 // CHECK-AARCH64-NEXT: [[CONV1:%.*]] = fptrunc double [[MUL]] to float
449 // CHECK-AARCH64-NEXT: ret float [[CONV1]]
451 // CHECK-ARM-LABEL: define dso_local arm_aapcscc float @double_source_func(
452 // CHECK-ARM-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
453 // CHECK-ARM-NEXT: [[ENTRY:.*:]]
454 // CHECK-ARM-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
455 // CHECK-ARM-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
456 // CHECK-ARM-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
457 // CHECK-ARM-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to double
458 // CHECK-ARM-NEXT: [[MUL:%.*]] = fmul double [[CONV]], 1.000000e+00
459 // CHECK-ARM-NEXT: [[CONV1:%.*]] = fptrunc double [[MUL]] to float
460 // CHECK-ARM-NEXT: ret float [[CONV1]]
462 // CHECK-PPC32-LABEL: define dso_local float @double_source_func(
463 // CHECK-PPC32-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
464 // CHECK-PPC32-NEXT: [[ENTRY:.*:]]
465 // CHECK-PPC32-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
466 // CHECK-PPC32-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
467 // CHECK-PPC32-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
468 // CHECK-PPC32-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to double
469 // CHECK-PPC32-NEXT: [[MUL:%.*]] = fmul double [[CONV]], 1.000000e+00
470 // CHECK-PPC32-NEXT: [[CONV1:%.*]] = fptrunc double [[MUL]] to float
471 // CHECK-PPC32-NEXT: ret float [[CONV1]]
473 // CHECK-PPC64-LABEL: define dso_local float @double_source_func(
474 // CHECK-PPC64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
475 // CHECK-PPC64-NEXT: [[ENTRY:.*:]]
476 // CHECK-PPC64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
477 // CHECK-PPC64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
478 // CHECK-PPC64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
479 // CHECK-PPC64-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to double
480 // CHECK-PPC64-NEXT: [[MUL:%.*]] = fmul double [[CONV]], 1.000000e+00
481 // CHECK-PPC64-NEXT: [[CONV1:%.*]] = fptrunc double [[MUL]] to float
482 // CHECK-PPC64-NEXT: ret float [[CONV1]]
484 // CHECK-SPARCV9-LABEL: define dso_local float @double_source_func(
485 // CHECK-SPARCV9-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
486 // CHECK-SPARCV9-NEXT: [[ENTRY:.*:]]
487 // CHECK-SPARCV9-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
488 // CHECK-SPARCV9-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
489 // CHECK-SPARCV9-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
490 // CHECK-SPARCV9-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to double
491 // CHECK-SPARCV9-NEXT: [[MUL:%.*]] = fmul double [[CONV]], 1.000000e+00
492 // CHECK-SPARCV9-NEXT: [[CONV1:%.*]] = fptrunc double [[MUL]] to float
493 // CHECK-SPARCV9-NEXT: ret float [[CONV1]]
495 float double_source_func(float x) {
496 #pragma clang fp eval_method(source)
497 return x * 1.0;
500 // CHECK-X64-LABEL: define dso_local float @double_source_func_cast(
501 // CHECK-X64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
502 // CHECK-X64-NEXT: [[ENTRY:.*:]]
503 // CHECK-X64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
504 // CHECK-X64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
505 // CHECK-X64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
506 // CHECK-X64-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to double
507 // CHECK-X64-NEXT: [[MUL:%.*]] = fmul double [[CONV]], 1.000000e+00
508 // CHECK-X64-NEXT: [[CONV1:%.*]] = fptrunc double [[MUL]] to float
509 // CHECK-X64-NEXT: ret float [[CONV1]]
511 // CHECK-AARCH64-LABEL: define dso_local float @double_source_func_cast(
512 // CHECK-AARCH64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
513 // CHECK-AARCH64-NEXT: [[ENTRY:.*:]]
514 // CHECK-AARCH64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
515 // CHECK-AARCH64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
516 // CHECK-AARCH64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
517 // CHECK-AARCH64-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to double
518 // CHECK-AARCH64-NEXT: [[MUL:%.*]] = fmul double [[CONV]], 1.000000e+00
519 // CHECK-AARCH64-NEXT: [[CONV1:%.*]] = fptrunc double [[MUL]] to float
520 // CHECK-AARCH64-NEXT: ret float [[CONV1]]
522 // CHECK-ARM-LABEL: define dso_local arm_aapcscc float @double_source_func_cast(
523 // CHECK-ARM-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
524 // CHECK-ARM-NEXT: [[ENTRY:.*:]]
525 // CHECK-ARM-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
526 // CHECK-ARM-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
527 // CHECK-ARM-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
528 // CHECK-ARM-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to double
529 // CHECK-ARM-NEXT: [[MUL:%.*]] = fmul double [[CONV]], 1.000000e+00
530 // CHECK-ARM-NEXT: [[CONV1:%.*]] = fptrunc double [[MUL]] to float
531 // CHECK-ARM-NEXT: ret float [[CONV1]]
533 // CHECK-PPC32-LABEL: define dso_local float @double_source_func_cast(
534 // CHECK-PPC32-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
535 // CHECK-PPC32-NEXT: [[ENTRY:.*:]]
536 // CHECK-PPC32-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
537 // CHECK-PPC32-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
538 // CHECK-PPC32-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
539 // CHECK-PPC32-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to double
540 // CHECK-PPC32-NEXT: [[MUL:%.*]] = fmul double [[CONV]], 1.000000e+00
541 // CHECK-PPC32-NEXT: [[CONV1:%.*]] = fptrunc double [[MUL]] to float
542 // CHECK-PPC32-NEXT: ret float [[CONV1]]
544 // CHECK-PPC64-LABEL: define dso_local float @double_source_func_cast(
545 // CHECK-PPC64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
546 // CHECK-PPC64-NEXT: [[ENTRY:.*:]]
547 // CHECK-PPC64-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
548 // CHECK-PPC64-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
549 // CHECK-PPC64-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
550 // CHECK-PPC64-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to double
551 // CHECK-PPC64-NEXT: [[MUL:%.*]] = fmul double [[CONV]], 1.000000e+00
552 // CHECK-PPC64-NEXT: [[CONV1:%.*]] = fptrunc double [[MUL]] to float
553 // CHECK-PPC64-NEXT: ret float [[CONV1]]
555 // CHECK-SPARCV9-LABEL: define dso_local float @double_source_func_cast(
556 // CHECK-SPARCV9-SAME: float noundef [[X:%.*]]) #[[ATTR0]] {
557 // CHECK-SPARCV9-NEXT: [[ENTRY:.*:]]
558 // CHECK-SPARCV9-NEXT: [[X_ADDR:%.*]] = alloca float, align 4
559 // CHECK-SPARCV9-NEXT: store float [[X]], ptr [[X_ADDR]], align 4
560 // CHECK-SPARCV9-NEXT: [[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4
561 // CHECK-SPARCV9-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to double
562 // CHECK-SPARCV9-NEXT: [[MUL:%.*]] = fmul double [[CONV]], 1.000000e+00
563 // CHECK-SPARCV9-NEXT: [[CONV1:%.*]] = fptrunc double [[MUL]] to float
564 // CHECK-SPARCV9-NEXT: ret float [[CONV1]]
566 float double_source_func_cast(float x) {
567 #pragma clang fp eval_method(source)
568 return (float)(x * 1.0);