199 lines · plain
1!REQUIRES: amdgpu-registered-target2!RUN: %flang_fc1 -triple amdgcn-amd-amdhsa -emit-llvm -fopenmp -fopenmp-is-target-device %s -o - | FileCheck %s3 4subroutine omp_pow_f32(x, y)5!$omp declare target6 real :: x, y7!CHECK: call float @__ocml_pow_f32(float {{.*}}, float {{.*}})8 y = x ** x9end subroutine omp_pow_f3210 11subroutine omp_pow_f64(x, y)12!$omp declare target13 real(8) :: x, y14!CHECK: call double @__ocml_pow_f64(double {{.*}}, double {{.*}})15 y = x ** x16end subroutine omp_pow_f6417 18subroutine omp_sin_f32(x, y)19!$omp declare target20 real :: x, y21!CHECK: call float @__ocml_sin_f32(float {{.*}})22 y = sin(x)23end subroutine omp_sin_f3224 25subroutine omp_sin_f64(x, y)26!$omp declare target27 real(8) :: x, y28!CHECK: call double @__ocml_sin_f64(double {{.*}})29 y = sin(x)30end subroutine omp_sin_f6431 32subroutine omp_abs_f32(x, y)33!$omp declare target34 real :: x, y35!CHECK: call contract float @llvm.fabs.f32(float {{.*}})36 y = abs(x)37end subroutine omp_abs_f3238 39subroutine omp_abs_f64(x, y)40!$omp declare target41 real(8) :: x, y42!CHECK: call contract double @llvm.fabs.f64(double {{.*}})43 y = abs(x)44end subroutine omp_abs_f6445 46subroutine omp_atan_f32(x, y)47!$omp declare target48 real :: x, y49!CHECK: call float @__ocml_atan_f32(float {{.*}})50 y = atan(x)51end subroutine omp_atan_f3252 53subroutine omp_atan_f64(x, y)54!$omp declare target55 real(8) :: x, y56!CHECK: call double @__ocml_atan_f64(double {{.*}})57 y = atan(x)58end subroutine omp_atan_f6459 60subroutine omp_atan2_f32(x, y)61!$omp declare target62 real :: x, y63!CHECK: call float @__ocml_atan2_f32(float {{.*}}, float {{.*}})64 y = atan2(x, x)65end subroutine omp_atan2_f3266 67subroutine omp_atan2_f64(x, y)68!$omp declare target69 real(8) :: x, y70!CHECK: call double @__ocml_atan2_f64(double {{.*}}, double {{.*}})71 y = atan2(x ,x)72end subroutine omp_atan2_f6473 74subroutine omp_cos_f32(x, y)75!$omp declare target76 real :: x, y77!CHECK: call float @__ocml_cos_f32(float {{.*}})78 y = cos(x)79end subroutine omp_cos_f3280 81subroutine omp_cos_f64(x, y)82!$omp declare target83 real(8) :: x, y84!CHECK: call double @__ocml_cos_f64(double {{.*}})85 y = cos(x)86end subroutine omp_cos_f6487 88subroutine omp_erf_f32(x, y)89!$omp declare target90 real :: x, y91!CHECK: call float @__ocml_erf_f32(float {{.*}})92 y = erf(x)93end subroutine omp_erf_f3294 95subroutine omp_erf_f64(x, y)96!$omp declare target97 real(8) :: x, y98!CHECK: call double @__ocml_erf_f64(double {{.*}})99 y = erf(x)100end subroutine omp_erf_f64101 102subroutine omp_erfc_f32(x, y)103!$omp declare target104 real :: x, y105!CHECK: call float @__ocml_erfc_f32(float {{.*}})106 y = erfc(x)107end subroutine omp_erfc_f32108 109subroutine omp_erfc_f64(x, y)110!$omp declare target111 real(8) :: x, y112!CHECK: call double @__ocml_erfc_f64(double {{.*}})113 y = erfc(x)114end subroutine omp_erfc_f64115 116subroutine omp_exp_f32(x, y)117!$omp declare target118 real :: x, y119!CHECK: call contract float @llvm.exp.f32(float {{.*}})120 y = exp(x)121end subroutine omp_exp_f32122 123subroutine omp_exp_f64(x, y)124!$omp declare target125 real(8) :: x, y126!CHECK: call double @__ocml_exp_f64(double {{.*}})127 y = exp(x)128end subroutine omp_exp_f64129 130subroutine omp_log_f32(x, y)131!$omp declare target132 real :: x, y133!CHECK: call contract float @llvm.log.f32(float {{.*}})134 y = log(x)135end subroutine omp_log_f32136 137subroutine omp_log_f64(x, y)138!$omp declare target139 real(8) :: x, y140!CHECK: call double @__ocml_log_f64(double {{.*}})141 y = log(x)142end subroutine omp_log_f64143 144subroutine omp_log10_f32(x, y)145!$omp declare target146 real :: x, y147!CHECK: call float @__ocml_log10_f32(float {{.*}})148 y = log10(x)149end subroutine omp_log10_f32150 151subroutine omp_log10_f64(x, y)152!$omp declare target153 real(8) :: x, y154!CHECK: call double @__ocml_log10_f64(double {{.*}})155 y = log10(x)156end subroutine omp_log10_f64157 158subroutine omp_sqrt_f32(x, y)159!$omp declare target160 real :: x, y161!CHECK: call contract float @llvm.sqrt.f32(float {{.*}})162 y = sqrt(x)163end subroutine omp_sqrt_f32164 165subroutine omp_sqrt_f64(x, y)166!$omp declare target167 real(8) :: x, y168!CHECK: call contract double @llvm.sqrt.f64(double {{.*}})169 y = sqrt(x)170end subroutine omp_sqrt_f64171 172subroutine omp_tan_f32(x, y)173!$omp declare target174 real :: x, y175!CHECK: call float @__ocml_tan_f32(float {{.*}})176 y = tan(x)177end subroutine omp_tan_f32178 179subroutine omp_tan_f64(x, y)180!$omp declare target181 real(8) :: x, y182!CHECK: call double @__ocml_tan_f64(double {{.*}})183 y = tan(x)184end subroutine omp_tan_f64185 186subroutine omp_tanh_f32(x, y)187!$omp declare target188 real :: x, y189!CHECK: call float @__ocml_tanh_f32(float {{.*}})190 y = tanh(x)191end subroutine omp_tanh_f32192 193subroutine omp_tanh_f64(x, y)194!$omp declare target195 real(8) :: x, y196!CHECK: call double @__ocml_tanh_f64(double {{.*}})197 y = tanh(x)198end subroutine omp_tanh_f64199