56 lines · plain
1! Check that correct runtime calls are used.2! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck --check-prefixes=CHECK-RUNTIME %s3! RUN: %flang_fc1 -mllvm -math-runtime=precise -emit-fir %s -o - | FileCheck --check-prefixes=CHECK-RUNTIME %s4 5! Check that the correct math dialect operations are used.6! RUN: bbc -emit-fir %s -o - | FileCheck --check-prefixes=CHECK-NORMAL %s7! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck --check-prefixes=CHECK-NORMAL %s8 9function test_real4(x)10 real :: x, test_real411 test_real4 = atan(x)12end function13 14! CHECK-RUNTIME: {{%[A-Za-z0-9._]+}} = fir.call @atanf({{.*}}) {{.*}}: (f32) -> f3215! CHECK-NORMAL: {{%[A-Za-z0-9._]+}} = math.atan {{.*}} {{.*}}: f3216 17function test_real8(x)18 real(8) :: x, test_real819 test_real8 = atan(x)20end function21 22! CHECK-RUNTIME: {{%[A-Za-z0-9._]+}} = fir.call @atan({{.*}}) {{.*}}: (f64) -> f6423! CHECK-NORMAL: {{%[A-Za-z0-9._]+}} = math.atan {{.*}} {{.*}}: f6424 25function test_complex4(x)26 complex :: x, test_complex427 test_complex4 = atan(x)28end function29 30! CHECK-RUNTIME: {{%[A-Za-z0-9._]+}} = fir.call @catanf({{.*}}) {{.*}}: (complex<f32>) -> complex<f32>31! CHECK-NORMAL: {{%[A-Za-z0-9._]+}} = fir.call @catanf({{.*}}) {{.*}}: (complex<f32>) -> complex<f32>32 33function test_complex8(x)34 complex(kind=8) :: x, test_complex835 test_complex8 = atan(x)36end function37 38! CHECK-RUNTIME: {{%[A-Za-z0-9._]+}} = fir.call @catan({{.*}}) {{.*}}: (complex<f64>) -> complex<f64>39! CHECK-NORMAL: {{%[A-Za-z0-9._]+}} = fir.call @catan({{.*}}) {{.*}}: (complex<f64>) -> complex<f64>40 41function test_real4_2(y, x)42 real :: y, x, test_real4_243 test_real4_2 = atan(y, x)44end function45 46! CHECK-RUNTIME: {{%[A-Za-z0-9._]+}} = fir.call @atan2f({{.*}}) {{.*}}: (f32, f32) -> f3247! CHECK-NORMAL: {{%[A-Za-z0-9._]+}} = math.atan2 {{.*}} {{.*}}: f3248 49function test_real8_2(y, x)50 real(8) :: y, x, test_real8_251 test_real8_2 = atan(y, x)52end function53 54! CHECK-RUNTIME: {{%[A-Za-z0-9._]+}} = fir.call @atan2({{.*}}) {{.*}}: (f64, f64) -> f6455! CHECK-NORMAL: {{%[A-Za-z0-9._]+}} = math.atan2 {{.*}} {{.*}}: f6456