aboutsummaryrefslogtreecommitdiff
path: root/flang/test/Lower/Intrinsics/tanpi.f90
diff options
context:
space:
mode:
Diffstat (limited to 'flang/test/Lower/Intrinsics/tanpi.f90')
-rw-r--r--flang/test/Lower/Intrinsics/tanpi.f9022
1 files changed, 22 insertions, 0 deletions
diff --git a/flang/test/Lower/Intrinsics/tanpi.f90 b/flang/test/Lower/Intrinsics/tanpi.f90
new file mode 100644
index 0000000..9cc3ae6
--- /dev/null
+++ b/flang/test/Lower/Intrinsics/tanpi.f90
@@ -0,0 +1,22 @@
+! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK"
+
+function test_real4(x)
+ real :: x, test_real4
+ test_real4 = tanpi(x)
+end function
+
+! CHECK-LABEL: @_QPtest_real4
+! CHECK: %[[dfactor:.*]] = arith.constant 3.1415926535897931 : f64
+! CHECK: %[[factor:.*]] = fir.convert %[[dfactor]] : (f64) -> f32
+! CHECK: %[[mul:.*]] = arith.mulf %{{.*}}, %[[factor]] fastmath<contract> : f32
+! CHECK: %[[tan:.*]] = math.tan %[[mul]] fastmath<contract> : f32
+
+function test_real8(x)
+ real(8) :: x, test_real8
+ test_real8 = tanpi(x)
+end function
+
+! CHECK-LABEL: @_QPtest_real8
+! CHECK: %[[dfactor:.*]] = arith.constant 3.1415926535897931 : f64
+! CHECK: %[[mul:.*]] = arith.mulf %{{.*}}, %[[dfactor]] fastmath<contract> : f64
+! CHECK: %[[tan:.*]] = math.tan %[[mul]] fastmath<contract> : f64