brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.7 KiB · 8465b9e Raw
291 lines · plain
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 %s4! RUN: %flang_fc1 -fapprox-func -emit-fir -mllvm -outline-intrinsics %s -o - | FileCheck %s --check-prefixes="CMPLX-FAST"5 6! CHECK-LABEL: tan_testr7subroutine tan_testr(a, b)8  real :: a, b9! CHECK: fir.call @fir.tan.contract.f32.f3210  b = tan(a)11end subroutine12 13! CHECK-LABEL: tan_testd14subroutine tan_testd(a, b)15  real(kind=8) :: a, b16! CHECK: fir.call @fir.tan.contract.f64.f6417  b = tan(a)18end subroutine19 20! CHECK-LABEL: tan_testc21subroutine tan_testc(z)22  complex :: z23! CHECK: fir.call @fir.tan.contract.z32.z3224  z = tan(z)25end subroutine26 27! CHECK-LABEL: tan_testcd28subroutine tan_testcd(z)29  complex(kind=8) :: z30! CHECK: fir.call @fir.tan.contract.z64.z6431  z = tan(z)32end subroutine33 34! CHECK-LABEL: atan_testr35subroutine atan_testr(a, b)36  real :: a, b37! CHECK: fir.call @fir.atan.contract.f32.f3238  b = atan(a)39end subroutine40 41! CHECK-LABEL: atan_testd42subroutine atan_testd(a, b)43  real(kind=8) :: a, b44! CHECK: fir.call @fir.atan.contract.f64.f6445  b = atan(a)46end subroutine47 48! CHECK-LABEL: atan_testc49subroutine atan_testc(z)50  complex :: z51! CHECK: fir.call @fir.atan.contract.z32.z3252  z = atan(z)53end subroutine54 55! CHECK-LABEL: atan_testcd56subroutine atan_testcd(z)57  complex(kind=8) :: z58! CHECK: fir.call @fir.atan.contract.z64.z6459  z = atan(z)60end subroutine61 62! CHECK-LABEL: cos_testr63subroutine cos_testr(a, b)64  real :: a, b65! CHECK: fir.call @fir.cos.contract.f32.f3266  b = cos(a)67end subroutine68 69! CHECK-LABEL: cos_testd70subroutine cos_testd(a, b)71  real(kind=8) :: a, b72! CHECK: fir.call @fir.cos.contract.f64.f6473  b = cos(a)74end subroutine75 76! CHECK-LABEL: cos_testc77subroutine cos_testc(z)78  complex :: z79! CHECK: fir.call @fir.cos.contract.z32.z3280  z = cos(z)81end subroutine82 83! CHECK-LABEL: cos_testcd84subroutine cos_testcd(z)85  complex(kind=8) :: z86! CHECK: fir.call @fir.cos.contract.z64.z6487  z = cos(z)88end subroutine89 90! CHECK-LABEL: acos_testr91subroutine acos_testr(a, b)92  real :: a, b93! CHECK: fir.call @fir.acos.contract.f32.f3294  b = acos(a)95end subroutine96 97! CHECK-LABEL: acos_testd98subroutine acos_testd(a, b)99  real(kind=8) :: a, b100! CHECK: fir.call @fir.acos.contract.f64.f64101  b = acos(a)102end subroutine103 104! CHECK-LABEL: acos_testc105subroutine acos_testc(z)106  complex :: z107! CHECK: fir.call @fir.acos.contract.z32.z32108  z = acos(z)109end subroutine110 111! CHECK-LABEL: acos_testcd112subroutine acos_testcd(z)113  complex(kind=8) :: z114! CHECK: fir.call @fir.acos.contract.z64.z64115  z = acos(z)116end subroutine117 118! CHECK-LABEL: cosh_testr119subroutine cosh_testr(a, b)120  real :: a, b121! CHECK: fir.call @fir.cosh.contract.f32.f32122  b = cosh(a)123end subroutine124 125! CHECK-LABEL: cosh_testd126subroutine cosh_testd(a, b)127  real(kind=8) :: a, b128! CHECK: fir.call @fir.cosh.contract.f64.f64129  b = cosh(a)130end subroutine131 132! CHECK-LABEL: cosh_testc133subroutine cosh_testc(z)134  complex :: z135! CHECK: fir.call @fir.cosh.contract.z32.z32136  z = cosh(z)137end subroutine138 139! CHECK-LABEL: cosh_testcd140subroutine cosh_testcd(z)141  complex(kind=8) :: z142! CHECK: fir.call @fir.cosh.contract.z64.z64143  z = cosh(z)144end subroutine145 146! CHECK-LABEL: sin_testr147subroutine sin_testr(a, b)148  real :: a, b149! CHECK: fir.call @fir.sin.contract.f32.f32150  b = sin(a)151end subroutine152 153! CHECK-LABEL: sin_testd154subroutine sin_testd(a, b)155  real(kind=8) :: a, b156! CHECK: fir.call @fir.sin.contract.f64.f64157  b = sin(a)158end subroutine159 160! CHECK-LABEL: sin_testc161subroutine sin_testc(z)162  complex :: z163! CHECK: fir.call @fir.sin.contract.z32.z32164  z = sin(z)165end subroutine166 167! CHECK-LABEL: sin_testcd168subroutine sin_testcd(z)169  complex(kind=8) :: z170! CHECK: fir.call @fir.sin.contract.z64.z64171  z = sin(z)172end subroutine173 174! CHECK-LABEL: sinh_testr175subroutine sinh_testr(a, b)176  real :: a, b177! CHECK: fir.call @fir.sinh.contract.f32.f32178  b = sinh(a)179end subroutine180 181! CHECK-LABEL: sinh_testd182subroutine sinh_testd(a, b)183  real(kind=8) :: a, b184! CHECK: fir.call @fir.sinh.contract.f64.f64185  b = sinh(a)186end subroutine187 188! CHECK-LABEL: sinh_testc189subroutine sinh_testc(z)190  complex :: z191! CHECK: fir.call @fir.sinh.contract.z32.z32192  z = sinh(z)193end subroutine194 195! CHECK-LABEL: sinh_testcd196subroutine sinh_testcd(z)197  complex(kind=8) :: z198! CHECK: fir.call @fir.sinh.contract.z64.z64199  z = sinh(z)200end subroutine201 202! CHECK-LABEL: @fir.tan.contract.f32.f32203! CHECK: math.tan %{{.*}} : f32204 205! CHECK-LABEL: @fir.tan.contract.f64.f64206! CHECK: math.tan %{{.*}} : f64207 208! CHECK-LABEL: @fir.tan.contract.z32.z32209! CMPLX-FAST: complex.tan %{{.*}} : complex<f32>210! CMPLX-PRECISE: fir.call @ctanf211 212! CHECK-LABEL: @fir.tan.contract.z64.z64213! CMPLX-FAST: complex.tan %{{.*}} : complex<f64>214! CMPLX-PRECISE: fir.call @ctan215 216! CHECK-LABEL: @fir.atan.contract.f32.f32217! CHECK: math.atan %{{.*}} : f32218 219! CHECK-LABEL: @fir.atan.contract.f64.f64220! CHECK: math.atan %{{.*}} : f64221 222! CHECK-LABEL: @fir.atan.contract.z32.z32223! CHECK: fir.call @catanf224 225! CHECK-LABEL: @fir.atan.contract.z64.z64226! CHECK: fir.call @catan227 228! CHECK-LABEL: @fir.cos.contract.f32.f32229! CHECK: math.cos %{{.*}} : f32230 231! CHECK-LABEL: @fir.cos.contract.f64.f64232! CHECK: math.cos %{{.*}} : f64233 234! CHECK-LABEL: @fir.cos.contract.z32.z32235! CMPLX-FAST: complex.cos %{{.*}} : complex<f32>236! CMPLX-PRECISE: fir.call @ccosf237 238! CHECK-LABEL: @fir.cos.contract.z64.z64239! CMPLX-FAST: complex.cos %{{.*}} : complex<f64>240! CMPLX-PRECISE: fir.call @ccos241 242! CHECK-LABEL: @fir.acos.contract.f32.f32243! CHECK: math.acos {{.*}} : f32244 245! CHECK-LABEL: @fir.acos.contract.f64.f64246! CHECK: math.acos {{.*}} : f64247 248! CHECK-LABEL: @fir.acos.contract.z32.z32249! CHECK: fir.call @cacosf250 251! CHECK-LABEL: @fir.acos.contract.z64.z64252! CHECK: fir.call @cacos253 254! CHECK-LABEL: @fir.cosh.contract.f32.f32255! CHECK: math.cosh {{.*}} : f32256 257! CHECK-LABEL: @fir.cosh.contract.f64.f64258! CHECK: math.cosh {{.*}} : f64259 260! CHECK-LABEL: @fir.cosh.contract.z32.z32261! CHECK: fir.call @ccoshf262 263! CHECK-LABEL: @fir.cosh.contract.z64.z64264! CHECK: fir.call @ccosh265 266! CHECK-LABEL: @fir.sin.contract.f32.f32267! CHECK: math.sin %{{.*}} : f32268 269! CHECK-LABEL: @fir.sin.contract.f64.f64270! CHECK: math.sin %{{.*}} : f64271 272! CHECK-LABEL: @fir.sin.contract.z32.z32273! CMPLX-FAST: complex.sin %{{.*}} : complex<f32>274! CMPLX-PRECISE: fir.call @csinf275 276! CHECK-LABEL: @fir.sin.contract.z64.z64277! CMPLX-FAST: complex.sin %{{.*}} : complex<f64>278! CMPLX-PRECISE: fir.call @csin279 280! CHECK-LABEL: @fir.sinh.contract.f32.f32281! CHECK: math.sinh {{.*}} : f32282 283! CHECK-LABEL: @fir.sinh.contract.f64.f64284! CHECK: math.sinh {{.*}} : f64285 286! CHECK-LABEL: @fir.sinh.contract.z32.z32287! CHECK: fir.call @csinhf288 289! CHECK-LABEL: @fir.sinh.contract.z64.z64290! CHECK: fir.call @csinh291