[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Evaluate / folding21.f90
blob8306e988dc67afe704aead1049be70d03a47d487
1 ! RUN: %python %S/test_folding.py %s %flang_fc1
2 ! Check array sizes with varying extents, including extents where the upper
3 ! bound is less than the lower bound
4 module m
5 contains
6 subroutine s1(a,b)
7 real nada1(-2:-1) ! size = 2
8 real nada2(-1:-1) ! size = 1
9 real nada3( 0:-1) ! size = 0
10 real nada4( 1:-1) ! size = 0
11 real nada5( 2:-1) ! size = 0
12 real nada6( 3:-1) ! size = 0
13 real nada7( 5, 3:-1) ! size = 0
14 real nada8( -1) ! size = 0
16 integer, parameter :: size1 = size(nada1)
17 integer, parameter :: size2 = size(nada2)
18 integer, parameter :: size3 = size(nada3)
19 integer, parameter :: size4 = size(nada4)
20 integer, parameter :: size5 = size(nada5)
21 integer, parameter :: size6 = size(nada6)
22 integer, parameter :: size7 = size(nada7)
23 integer, parameter :: size8 = size(nada8)
25 logical, parameter :: test_size_1 = size1 == 2
26 logical, parameter :: test_size_2 = size2 == 1
27 logical, parameter :: test_size_3 = size3 == 0
28 logical, parameter :: test_size_4 = size4 == 0
29 logical, parameter :: test_size_5 = size5 == 0
30 logical, parameter :: test_size_6 = size6 == 0
31 logical, parameter :: test_size_7 = size7 == 0
32 logical, parameter :: test_size_8 = size8 == 0
33 end subroutine
34 end module