1
+ ! REQUIRES: flang-supports-f128-math
1
2
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK"
2
3
3
4
function test_real4 (x )
@@ -6,9 +7,8 @@ function test_real4(x)
6
7
end function
7
8
8
9
! CHECK-LABEL: @_QPtest_real4
9
- ! CHECK: %[[dfactor :.*]] = arith.constant 57.295779513082323 : f64
10
+ ! CHECK: %[[factor :.*]] = arith.constant 57.2957763 : f32
10
11
! CHECK: %[[result:.*]] = math.acos %{{.*}} fastmath<contract> : f32
11
- ! CHECK: %[[factor:.*]] = fir.convert %[[dfactor]] : (f64) -> f32
12
12
! CHECK: %[[arg:.*]] = arith.mulf %[[result]], %[[factor]] fastmath<contract> : f32
13
13
14
14
function test_real8 (x )
@@ -17,6 +17,16 @@ function test_real8(x)
17
17
end function
18
18
19
19
! CHECK-LABEL: @_QPtest_real8
20
- ! CHECK: %[[dfactor :.*]] = arith.constant 57.295779513082323 : f64
20
+ ! CHECK: %[[factor :.*]] = arith.constant 57.295779513082323 : f64
21
21
! CHECK: %[[result:.*]] = math.acos %{{.*}} fastmath<contract> : f64
22
- ! CHECK: %[[arg:.*]] = arith.mulf %[[result]], %[[dfactor]] fastmath<contract> : f64
22
+ ! CHECK: %[[arg:.*]] = arith.mulf %[[result]], %[[factor]] fastmath<contract> : f64
23
+
24
+ function test_real16 (x )
25
+ real (16 ) :: x, test_real16
26
+ test_real16 = acosd(x)
27
+ end function
28
+
29
+ ! CHECK-LABEL: @_QPtest_real16
30
+ ! CHECK: %[[factor:.*]] = arith.constant 57.295779513082320876798154814105{{.*}} : f128
31
+ ! CHECK: %[[result:.*]] = fir.call @_FortranAAcosF128({{.*}}) fastmath<contract> : (f128) -> f128
32
+ ! CHECK: %[[arg:.*]] = arith.mulf %[[result]], %[[factor]] fastmath<contract> : f128
0 commit comments