33 lines · plain
1! REQUIRES: flang-supports-f128-math2! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK"3 4function test_real4(x)5 real :: x, test_real46 test_real4 = tanpi(x)7end function8 9! CHECK-LABEL: @_QPtest_real410! CHECK: %[[factor:.*]] = arith.constant 3.14159274 : f3211! CHECK: %[[mul:.*]] = arith.mulf %{{.*}}, %[[factor]] fastmath<contract> : f3212! CHECK: %[[tan:.*]] = math.tan %[[mul]] fastmath<contract> : f3213 14function test_real8(x)15 real(8) :: x, test_real816 test_real8 = tanpi(x)17end function18 19! CHECK-LABEL: @_QPtest_real820! CHECK: %[[dfactor:.*]] = arith.constant 3.1415926535897931 : f6421! CHECK: %[[mul:.*]] = arith.mulf %{{.*}}, %[[dfactor]] fastmath<contract> : f6422! CHECK: %[[tan:.*]] = math.tan %[[mul]] fastmath<contract> : f6423 24function test_real16(x)25 real(16) :: x, test_real1626 test_real16 = tanpi(x)27end function28 29! CHECK-LABEL: @_QPtest_real1630! CHECK: %[[factor:.*]] = arith.constant 3.141592653589793238462643383279{{.*}} : f12831! CHECK: %[[mul:.*]] = arith.mulf %{{.*}}, %[[factor]] fastmath<contract> : f12832! CHECK: %[[tan:.*]] = fir.call @_FortranATanF128(%[[mul]]) fastmath<contract> : (f128) -> f12833