37 lines · plain
1! REQUIRES: flang-supports-f128-math2! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"3! RUN: bbc --math-runtime=precise -emit-fir -hlfir=false %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-PRECISE"4! RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"5 6function test_real4(x)7 real :: x, test_real48 test_real4 = asinpi(x)9end function10 11! CHECK-LABEL: @_QPtest_real412! CHECK-PRECISE: %[[asin:.*]] = fir.call @asinf({{%[A-Za-z0-9._]+}}) fastmath<contract> : (f32) -> f3213! CHECK-FAST: %[[asin:.*]] = math.asin %{{.*}} : f3214! CHECK: %[[inv_pi:.*]] = arith.constant 0.318309873 : f3215! CHECK: %{{.*}} = arith.mulf %[[asin]], %[[inv_pi]] fastmath<contract> : f3216 17function test_real8(x)18 real(8) :: x, test_real819 test_real8 = asinpi(x)20end function21 22! CHECK-LABEL: @_QPtest_real823! CHECK-PRECISE: %[[asin:.*]] = fir.call @asin({{%[A-Za-z0-9._]+}}) fastmath<contract> : (f64) -> f6424! CHECK-FAST: %[[asin:.*]] = math.asin %{{.*}} : f6425! CHECK: %[[inv_pi:.*]] = arith.constant 0.31830988618379069 : f6426! CHECK: %{{.*}} = arith.mulf %[[asin]], %[[inv_pi]] fastmath<contract> : f6427 28function test_real16(x)29 real(16) :: x, test_real1630 test_real16 = asinpi(x)31end function32 33! CHECK-LABEL: @_QPtest_real1634! CHECK: %[[asin:.*]] = fir.call @_FortranAAsinF128({{.*}}) fastmath<contract> : (f128) -> f12835! CHECK: %[[inv_pi:.*]] = arith.constant 0.3183098861837906715377675267450{{.*}} : f12836! CHECK: %{{.*}} = arith.mulf %[[asin]], %[[inv_pi]] fastmath<contract> : f12837