1 ! RUN: bbc -emit-fir -outline-intrinsics %s -o - | FileCheck %s --check-prefixes="CHECK,CMPLX-PRECISE"
2 ! RUN: bbc --math-runtime=precise -emit-fir -outline-intrinsics %s -o - | FileCheck %s --check-prefixes="CMPLX-PRECISE"
3 ! RUN: %flang_fc1 -emit-fir -mllvm -outline-intrinsics %s -o - | FileCheck %s
4 ! RUN: %flang_fc1 -fapprox-func -emit-fir -mllvm -outline-intrinsics %s -o - | FileCheck %s --check-prefixes="CMPLX-FAST"
6 ! CHECK-LABEL: tan_testr
7 subroutine tan_testr(a
, b
)
9 ! CHECK: fir.call @fir.tan.contract.f32.f32
13 ! CHECK-LABEL: tan_testd
14 subroutine tan_testd(a
, b
)
16 ! CHECK: fir.call @fir.tan.contract.f64.f64
20 ! CHECK-LABEL: tan_testc
21 subroutine tan_testc(z
)
23 ! CHECK: fir.call @fir.tan.contract.z32.z32
27 ! CHECK-LABEL: tan_testcd
28 subroutine tan_testcd(z
)
30 ! CHECK: fir.call @fir.tan.contract.z64.z64
34 ! CHECK-LABEL: atan_testr
35 subroutine atan_testr(a
, b
)
37 ! CHECK: fir.call @fir.atan.contract.f32.f32
41 ! CHECK-LABEL: atan_testd
42 subroutine atan_testd(a
, b
)
44 ! CHECK: fir.call @fir.atan.contract.f64.f64
48 ! CHECK-LABEL: atan_testc
49 subroutine atan_testc(z
)
51 ! CHECK: fir.call @fir.atan.contract.z32.z32
55 ! CHECK-LABEL: atan_testcd
56 subroutine atan_testcd(z
)
58 ! CHECK: fir.call @fir.atan.contract.z64.z64
62 ! CHECK-LABEL: cos_testr
63 subroutine cos_testr(a
, b
)
65 ! CHECK: fir.call @fir.cos.contract.f32.f32
69 ! CHECK-LABEL: cos_testd
70 subroutine cos_testd(a
, b
)
72 ! CHECK: fir.call @fir.cos.contract.f64.f64
76 ! CHECK-LABEL: cos_testc
77 subroutine cos_testc(z
)
79 ! CHECK: fir.call @fir.cos.contract.z32.z32
83 ! CHECK-LABEL: cos_testcd
84 subroutine cos_testcd(z
)
86 ! CHECK: fir.call @fir.cos.contract.z64.z64
90 ! CHECK-LABEL: acos_testr
91 subroutine acos_testr(a
, b
)
93 ! CHECK: fir.call @fir.acos.contract.f32.f32
97 ! CHECK-LABEL: acos_testd
98 subroutine acos_testd(a
, b
)
100 ! CHECK: fir.call @fir.acos.contract.f64.f64
104 ! CHECK-LABEL: acos_testc
105 subroutine acos_testc(z
)
107 ! CHECK: fir.call @fir.acos.contract.z32.z32
111 ! CHECK-LABEL: acos_testcd
112 subroutine acos_testcd(z
)
114 ! CHECK: fir.call @fir.acos.contract.z64.z64
118 ! CHECK-LABEL: cosh_testr
119 subroutine cosh_testr(a
, b
)
121 ! CHECK: fir.call @fir.cosh.contract.f32.f32
125 ! CHECK-LABEL: cosh_testd
126 subroutine cosh_testd(a
, b
)
128 ! CHECK: fir.call @fir.cosh.contract.f64.f64
132 ! CHECK-LABEL: cosh_testc
133 subroutine cosh_testc(z
)
135 ! CHECK: fir.call @fir.cosh.contract.z32.z32
139 ! CHECK-LABEL: cosh_testcd
140 subroutine cosh_testcd(z
)
142 ! CHECK: fir.call @fir.cosh.contract.z64.z64
146 ! CHECK-LABEL: sin_testr
147 subroutine sin_testr(a
, b
)
149 ! CHECK: fir.call @fir.sin.contract.f32.f32
153 ! CHECK-LABEL: sin_testd
154 subroutine sin_testd(a
, b
)
156 ! CHECK: fir.call @fir.sin.contract.f64.f64
160 ! CHECK-LABEL: sin_testc
161 subroutine sin_testc(z
)
163 ! CHECK: fir.call @fir.sin.contract.z32.z32
167 ! CHECK-LABEL: sin_testcd
168 subroutine sin_testcd(z
)
170 ! CHECK: fir.call @fir.sin.contract.z64.z64
174 ! CHECK-LABEL: sinh_testr
175 subroutine sinh_testr(a
, b
)
177 ! CHECK: fir.call @fir.sinh.contract.f32.f32
181 ! CHECK-LABEL: sinh_testd
182 subroutine sinh_testd(a
, b
)
184 ! CHECK: fir.call @fir.sinh.contract.f64.f64
188 ! CHECK-LABEL: sinh_testc
189 subroutine sinh_testc(z
)
191 ! CHECK: fir.call @fir.sinh.contract.z32.z32
195 ! CHECK-LABEL: sinh_testcd
196 subroutine sinh_testcd(z
)
198 ! CHECK: fir.call @fir.sinh.contract.z64.z64
202 ! CHECK-LABEL: @fir.tan.contract.f32.f32
203 ! CHECK: math.tan %{{.*}} : f32
205 ! CHECK-LABEL: @fir.tan.contract.f64.f64
206 ! CHECK: math.tan %{{.*}} : f64
208 ! CHECK-LABEL: @fir.tan.contract.z32.z32
209 ! CMPLX-FAST: complex.tan %{{.*}} : complex<f32>
210 ! CMPLX-PRECISE: fir.call @ctanf
212 ! CHECK-LABEL: @fir.tan.contract.z64.z64
213 ! CMPLX-FAST: complex.tan %{{.*}} : complex<f64>
214 ! CMPLX-PRECISE: fir.call @ctan
216 ! CHECK-LABEL: @fir.atan.contract.f32.f32
217 ! CHECK: math.atan %{{.*}} : f32
219 ! CHECK-LABEL: @fir.atan.contract.f64.f64
220 ! CHECK: math.atan %{{.*}} : f64
222 ! CHECK-LABEL: @fir.atan.contract.z32.z32
223 ! CHECK: fir.call @catanf
225 ! CHECK-LABEL: @fir.atan.contract.z64.z64
226 ! CHECK: fir.call @catan
228 ! CHECK-LABEL: @fir.cos.contract.f32.f32
229 ! CHECK: math.cos %{{.*}} : f32
231 ! CHECK-LABEL: @fir.cos.contract.f64.f64
232 ! CHECK: math.cos %{{.*}} : f64
234 ! CHECK-LABEL: @fir.cos.contract.z32.z32
235 ! CMPLX-FAST: complex.cos %{{.*}} : complex<f32>
236 ! CMPLX-PRECISE: fir.call @ccosf
238 ! CHECK-LABEL: @fir.cos.contract.z64.z64
239 ! CMPLX-FAST: complex.cos %{{.*}} : complex<f64>
240 ! CMPLX-PRECISE: fir.call @ccos
242 ! CHECK-LABEL: @fir.acos.contract.f32.f32
243 ! CHECK: math.acos {{.*}} : f32
245 ! CHECK-LABEL: @fir.acos.contract.f64.f64
246 ! CHECK: math.acos {{.*}} : f64
248 ! CHECK-LABEL: @fir.acos.contract.z32.z32
249 ! CHECK: fir.call @cacosf
251 ! CHECK-LABEL: @fir.acos.contract.z64.z64
252 ! CHECK: fir.call @cacos
254 ! CHECK-LABEL: @fir.cosh.contract.f32.f32
255 ! CHECK: math.cosh {{.*}} : f32
257 ! CHECK-LABEL: @fir.cosh.contract.f64.f64
258 ! CHECK: math.cosh {{.*}} : f64
260 ! CHECK-LABEL: @fir.cosh.contract.z32.z32
261 ! CHECK: fir.call @ccoshf
263 ! CHECK-LABEL: @fir.cosh.contract.z64.z64
264 ! CHECK: fir.call @ccosh
266 ! CHECK-LABEL: @fir.sin.contract.f32.f32
267 ! CHECK: math.sin %{{.*}} : f32
269 ! CHECK-LABEL: @fir.sin.contract.f64.f64
270 ! CHECK: math.sin %{{.*}} : f64
272 ! CHECK-LABEL: @fir.sin.contract.z32.z32
273 ! CMPLX-FAST: complex.sin %{{.*}} : complex<f32>
274 ! CMPLX-PRECISE: fir.call @csinf
276 ! CHECK-LABEL: @fir.sin.contract.z64.z64
277 ! CMPLX-FAST: complex.sin %{{.*}} : complex<f64>
278 ! CMPLX-PRECISE: fir.call @csin
280 ! CHECK-LABEL: @fir.sinh.contract.f32.f32
281 ! CHECK: fir.call {{.*}}sinh
283 ! CHECK-LABEL: @fir.sinh.contract.f64.f64
284 ! CHECK: fir.call {{.*}}sinh
286 ! CHECK-LABEL: @fir.sinh.contract.z32.z32
287 ! CHECK: fir.call @csinhf
289 ! CHECK-LABEL: @fir.sinh.contract.z64.z64
290 ! CHECK: fir.call @csinh