1
+ ! REQUIRES: flang-supports-f128-math
1
2
! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
2
3
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-PRECISE"
3
4
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
@@ -8,8 +9,7 @@ function test_real4(x)
8
9
end function
9
10
10
11
! CHECK-LABEL: @_QPtest_real4
11
- ! CHECK: %[[dfactor:.*]] = arith.constant 0.017453292519943295 : f64
12
- ! CHECK: %[[factor:.*]] = fir.convert %[[dfactor]] : (f64) -> f32
12
+ ! CHECK: %[[factor:.*]] = arith.constant 0.0174532924 : f32
13
13
! CHECK: %[[arg:.*]] = arith.mulf %{{[A-Za-z0-9._]+}}, %[[factor]] fastmath<contract> : f32
14
14
! CHECK-PRECISE: %{{.*}} = fir.call @sinf(%[[arg]]) fastmath<contract> : (f32) -> f32
15
15
! CHECK-FAST: %{{.*}} = math.sin %[[arg]] fastmath<contract> : f32
@@ -24,3 +24,13 @@ function test_real8(x)
24
24
! CHECK: %[[arg:.*]] = arith.mulf %{{[A-Za-z0-9._]+}}, %[[factor]] fastmath<contract> : f64
25
25
! CHECK-PRECISE: %{{.*}} = fir.call @sin(%[[arg]]) fastmath<contract> : (f64) -> f64
26
26
! CHECK-FAST: %{{.*}} = math.sin %[[arg]] fastmath<contract> : f64
27
+
28
+ function test_real16 (x )
29
+ real (16 ) :: x, test_real16
30
+ test_real16 = sind(x)
31
+ end function
32
+
33
+ ! CHECK-LABEL: @_QPtest_real16
34
+ ! CHECK: %[[factor:.*]] = arith.constant 0.0174532925199432957692369076848861{{.*}} : f128
35
+ ! CHECK: %[[arg:.*]] = arith.mulf %{{[A-Za-z0-9._]+}}, %[[factor]] fastmath<contract> : f128
36
+ ! CHECK: %[[result:.*]] = fir.call @_FortranASinF128({{.*}}) fastmath<contract> : (f128) -> f128
0 commit comments