[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Evaluate / fold-spacing.f90
blob27834da6c23202140d80bfc8047f135d92f20f48
1 ! RUN: %python %S/test_folding.py %s %flang_fc1
2 ! Tests folding of SPACING() and RRSPACING
3 module m
4 logical, parameter :: test_1 = spacing(3.0) == scale(1.0, -22)
5 logical, parameter :: test_2 = spacing(-3.0) == scale(1.0, -22)
6 logical, parameter :: test_3 = spacing(3.0d0) == scale(1.0, -51)
7 logical, parameter :: test_4 = spacing(0.) == tiny(0.)
8 logical, parameter :: test_5 = spacing(tiny(0.)) == 1.e-45
9 logical, parameter :: test_6 = spacing(8388608.) == 1.
10 logical, parameter :: test_11 = rrspacing(3.0) == scale(0.75, 24)
11 logical, parameter :: test_12 = rrspacing(-3.0) == scale(0.75, 24)
12 logical, parameter :: test_13 = rrspacing(3.0d0) == scale(0.75, 53)
13 logical, parameter :: test_14 = rrspacing(0.) == 0.
14 end module