1 ! RUN: bbc -emit-fir -outline-intrinsics %s -o - | FileCheck %s --check-prefixes="CHECK,CMPLX-FAST"
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
5 ! CHECK-LABEL: tan_testr
6 subroutine tan_testr(a
, b
)
8 ! CHECK: fir.call @fir.tan.f32.f32
12 ! CHECK-LABEL: tan_testd
13 subroutine tan_testd(a
, b
)
15 ! CHECK: fir.call @fir.tan.f64.f64
19 ! CHECK-LABEL: tan_testc
20 subroutine tan_testc(z
)
22 ! CHECK: fir.call @fir.tan.z4.z4
26 ! CHECK-LABEL: tan_testcd
27 subroutine tan_testcd(z
)
29 ! CHECK: fir.call @fir.tan.z8.z8
33 ! CHECK-LABEL: atan_testr
34 subroutine atan_testr(a
, b
)
36 ! CHECK: fir.call @fir.atan.f32.f32
40 ! CHECK-LABEL: atan_testd
41 subroutine atan_testd(a
, b
)
43 ! CHECK: fir.call @fir.atan.f64.f64
47 ! CHECK-LABEL: atan_testc
48 subroutine atan_testc(z
)
50 ! CHECK: fir.call @fir.atan.z4.z4
54 ! CHECK-LABEL: atan_testcd
55 subroutine atan_testcd(z
)
57 ! CHECK: fir.call @fir.atan.z8.z8
61 ! CHECK-LABEL: cos_testr
62 subroutine cos_testr(a
, b
)
64 ! CHECK: fir.call @fir.cos.f32.f32
68 ! CHECK-LABEL: cos_testd
69 subroutine cos_testd(a
, b
)
71 ! CHECK: fir.call @fir.cos.f64.f64
75 ! CHECK-LABEL: cos_testc
76 subroutine cos_testc(z
)
78 ! CHECK: fir.call @fir.cos.z4.z4
82 ! CHECK-LABEL: cos_testcd
83 subroutine cos_testcd(z
)
85 ! CHECK: fir.call @fir.cos.z8.z8
89 ! CHECK-LABEL: cosh_testr
90 subroutine cosh_testr(a
, b
)
92 ! CHECK: fir.call @fir.cosh.f32.f32
96 ! CHECK-LABEL: cosh_testd
97 subroutine cosh_testd(a
, b
)
99 ! CHECK: fir.call @fir.cosh.f64.f64
103 ! CHECK-LABEL: cosh_testc
104 subroutine cosh_testc(z
)
106 ! CHECK: fir.call @fir.cosh.z4.z4
110 ! CHECK-LABEL: cosh_testcd
111 subroutine cosh_testcd(z
)
113 ! CHECK: fir.call @fir.cosh.z8.z8
117 ! CHECK-LABEL: sin_testr
118 subroutine sin_testr(a
, b
)
120 ! CHECK: fir.call @fir.sin.f32.f32
124 ! CHECK-LABEL: sin_testd
125 subroutine sin_testd(a
, b
)
127 ! CHECK: fir.call @fir.sin.f64.f64
131 ! CHECK-LABEL: sin_testc
132 subroutine sin_testc(z
)
134 ! CHECK: fir.call @fir.sin.z4.z4
138 ! CHECK-LABEL: sin_testcd
139 subroutine sin_testcd(z
)
141 ! CHECK: fir.call @fir.sin.z8.z8
145 ! CHECK-LABEL: sinh_testr
146 subroutine sinh_testr(a
, b
)
148 ! CHECK: fir.call @fir.sinh.f32.f32
152 ! CHECK-LABEL: sinh_testd
153 subroutine sinh_testd(a
, b
)
155 ! CHECK: fir.call @fir.sinh.f64.f64
159 ! CHECK-LABEL: sinh_testc
160 subroutine sinh_testc(z
)
162 ! CHECK: fir.call @fir.sinh.z4.z4
166 ! CHECK-LABEL: sinh_testcd
167 subroutine sinh_testcd(z
)
169 ! CHECK: fir.call @fir.sinh.z8.z8
173 ! CHECK-LABEL: @fir.tan.f32.f32
174 ! CHECK: math.tan %{{.*}} : f32
176 ! CHECK-LABEL: @fir.tan.f64.f64
177 ! CHECK: math.tan %{{.*}} : f64
179 ! CHECK-LABEL: @fir.tan.z4.z4
180 ! CMPLX-FAST: complex.tan %{{.*}} : complex<f32>
181 ! CMPLX-PRECISE: fir.call @ctanf
183 ! CHECK-LABEL: @fir.tan.z8.z8
184 ! CMPLX-FAST: complex.tan %{{.*}} : complex<f64>
185 ! CMPLX-PRECISE: fir.call @ctan
187 ! CHECK-LABEL: @fir.atan.f32.f32
188 ! CHECK: math.atan %{{.*}} : f32
190 ! CHECK-LABEL: @fir.atan.f64.f64
191 ! CHECK: math.atan %{{.*}} : f64
193 ! CHECK-LABEL: @fir.atan.z4.z4
194 ! CHECK: fir.call @catanf
196 ! CHECK-LABEL: @fir.atan.z8.z8
197 ! CHECK: fir.call @catan
199 ! CHECK-LABEL: @fir.cos.f32.f32
200 ! CHECK: math.cos %{{.*}} : f32
202 ! CHECK-LABEL: @fir.cos.f64.f64
203 ! CHECK: math.cos %{{.*}} : f64
205 ! CHECK-LABEL: @fir.cos.z4.z4
206 ! CMPLX-FAST: complex.cos %{{.*}} : complex<f32>
207 ! CMPLX-PRECISE: fir.call @ccosf
209 ! CHECK-LABEL: @fir.cos.z8.z8
210 ! CMPLX-FAST: complex.cos %{{.*}} : complex<f64>
211 ! CMPLX-PRECISE: fir.call @ccos
213 ! CHECK-LABEL: @fir.cosh.f32.f32
214 ! CHECK: fir.call {{.*}}cosh
216 ! CHECK-LABEL: @fir.cosh.f64.f64
217 ! CHECK: fir.call {{.*}}cosh
219 ! CHECK-LABEL: @fir.cosh.z4.z4
220 ! CHECK: fir.call @ccoshf
222 ! CHECK-LABEL: @fir.cosh.z8.z8
223 ! CHECK: fir.call @ccosh
225 ! CHECK-LABEL: @fir.sin.f32.f32
226 ! CHECK: math.sin %{{.*}} : f32
228 ! CHECK-LABEL: @fir.sin.f64.f64
229 ! CHECK: math.sin %{{.*}} : f64
231 ! CHECK-LABEL: @fir.sin.z4.z4
232 ! CMPLX-FAST: complex.sin %{{.*}} : complex<f32>
233 ! CMPLX-PRECISE: fir.call @csinf
235 ! CHECK-LABEL: @fir.sin.z8.z8
236 ! CMPLX-FAST: complex.sin %{{.*}} : complex<f64>
237 ! CMPLX-PRECISE: fir.call @csin
239 ! CHECK-LABEL: @fir.sinh.f32.f32
240 ! CHECK: fir.call {{.*}}sinh
242 ! CHECK-LABEL: @fir.sinh.f64.f64
243 ! CHECK: fir.call {{.*}}sinh
245 ! CHECK-LABEL: @fir.sinh.z4.z4
246 ! CHECK: fir.call @csinhf
248 ! CHECK-LABEL: @fir.sinh.z8.z8
249 ! CHECK: fir.call @csinh