Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Lower / Intrinsics / atand.f90
blobeea9c79773cf055c1efa50f7052365638822b733
1 ! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
2 ! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-PRECISE"
3 ! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
5 function test_real4(x)
6 real :: x, test_real4
7 test_real4 = atand(x)
8 end function
10 ! CHECK-LABEL: @_QPtest_real4
11 ! CHECK-PRECISE: %[[atan:.*]] = fir.call @atanf({{%[A-Za-z0-9._]+}}) fastmath<contract> : (f32) -> f32
12 ! CHECK-FAST: %[[atan:.*]] = math.atan %{{.*}} : f32
13 ! CHECK: %[[dfactor:.*]] = arith.constant 57.295779513082323 : f64
14 ! CHECK: %[[factor:.*]] = fir.convert %[[dfactor]] : (f64) -> f32
15 ! CHECK: %{{.*}} = arith.mulf %[[atan]], %[[factor]] fastmath<contract> : f32
17 function test_real8(x)
18 real(8) :: x, test_real8
19 test_real8 = atand(x)
20 end function
22 ! CHECK-LABEL: @_QPtest_real8
23 ! CHECK-PRECISE: %[[atan:.*]] = fir.call @atan({{%[A-Za-z0-9._]+}}) fastmath<contract> : (f64) -> f64
24 ! CHECK-FAST: %[[atan:.*]] = math.atan %{{.*}} : f64
25 ! CHECK: %[[factor:.*]] = arith.constant 57.295779513082323 : f64
26 ! CHECK: %{{.*}} = arith.mulf %[[atan]], %[[factor]] fastmath<contract> : f64