1+ ! REQUIRES: flang-supports-f128-math
12! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK"
23
34function test_real4 (x )
@@ -6,9 +7,8 @@ function test_real4(x)
67end function
78
89! CHECK-LABEL: @_QPtest_real4
9- ! CHECK: %[[dfactor :.*]] = arith.constant 57.295779513082323 : f64
10+ ! CHECK: %[[factor :.*]] = arith.constant 57.2957763 : f32
1011! CHECK: %[[result:.*]] = math.asin %{{.*}} fastmath<contract> : f32
11- ! CHECK: %[[factor:.*]] = fir.convert %[[dfactor]] : (f64) -> f32
1212! CHECK: %[[arg:.*]] = arith.mulf %[[result]], %[[factor]] fastmath<contract> : f32
1313
1414function test_real8 (x )
@@ -17,6 +17,16 @@ function test_real8(x)
1717end function
1818
1919! CHECK-LABEL: @_QPtest_real8
20- ! CHECK: %[[dfactor :.*]] = arith.constant 57.295779513082323 : f64
20+ ! CHECK: %[[factor :.*]] = arith.constant 57.295779513082323 : f64
2121! CHECK: %[[result:.*]] = math.asin %{{.*}} 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 = asind(x)
27+ end function
28+
29+ ! CHECK-LABEL: @_QPtest_real16
30+ ! CHECK: %[[factor:.*]] = arith.constant 57.295779513082320876798154814105{{.*}} : f128
31+ ! CHECK: %[[result:.*]] = fir.call @_FortranAAsinF128({{.*}}) fastmath<contract> : (f128) -> f128
32+ ! CHECK: %[[arg:.*]] = arith.mulf %[[result]], %[[factor]] fastmath<contract> : f128
0 commit comments