Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Lower / Intrinsics / fraction.f90
blobf9fff725eb27a5c73835cb9b7865632c1180f6d9
1 ! RUN: bbc -emit-fir %s -o - | FileCheck %s
3 ! FRACTION
4 ! CHECK-LABE: fraction_test
5 subroutine fraction_test
7 real(kind=4) :: x1 = 178.1387e-4
8 real(kind=8) :: x2 = 178.1387e-4
9 real(kind=10) :: x3 = 178.1387e-4
10 real(kind=16) :: x4 = 178.1387e-4
11 ! CHECK: %[[r0:.*]] = fir.address_of(@_QFfraction_testEx1) : !fir.ref<f32>
12 ! CHECK: %[[r1:.*]] = fir.address_of(@_QFfraction_testEx2) : !fir.ref<f64>
13 ! CHECK: %[[r2:.*]] = fir.address_of(@_QFfraction_testEx3) : !fir.ref<f80>
14 ! CHECK: %[[r3:.*]] = fir.address_of(@_QFfraction_testEx4) : !fir.ref<f128>
16 x1 = fraction(x1)
17 ! CHECK: %[[temp0:.*]] = fir.load %[[r0:.*]] : !fir.ref<f32>
18 ! CHECK: %[[result0:.*]] = fir.call @_FortranAFraction4(%[[temp0:.*]]) {{.*}}: (f32) -> f32
19 ! CHECK: fir.store %[[result0:.*]] to %[[r0:.*]] : !fir.ref<f32>
21 x2 = fraction(x2)
22 ! CHECK: %[[temp1:.*]] = fir.load %[[r1:.*]] : !fir.ref<f64>
23 ! CHECK: %[[result1:.*]] = fir.call @_FortranAFraction8(%[[temp1:.*]]) {{.*}}: (f64) -> f64
24 ! CHECK: fir.store %[[result1:.*]] to %[[r1:.*]] : !fir.ref<f64>
26 x3 = fraction(x3)
27 ! CHECK: %[[temp2:.*]] = fir.load %[[r2:.*]] : !fir.ref<f80>
28 ! CHECK: %[[result2:.*]] = fir.call @_FortranAFraction10(%[[temp2:.*]]) {{.*}}: (f80) -> f80
29 ! CHECK: fir.store %[[result2:.*]] to %[[r2:.*]] : !fir.ref<f80>
31 x4 = fraction(x4)
32 ! CHECK: %[[temp3:.*]] = fir.load %[[r3:.*]] : !fir.ref<f128>
33 ! CHECK: %[[result3:.*]] = fir.call @_FortranAFraction16(%[[temp3:.*]]) {{.*}}: (f128) -> f128
34 ! CHECK: fir.store %[[result3:.*]] to %[[r3:.*]] : !fir.ref<f128>
35 end subroutine fraction_test