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