[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Evaluate / folding09.f90
blob58ddc44925e494187f2244c02e65048a29239439
1 ! RUN: %python %S/test_folding.py %s %flang_fc1
2 ! Test folding of IS_CONTIGUOUS on simply contiguous items (9.5.4)
3 ! When IS_CONTIGUOUS() is constant, it's .TRUE.
5 module m
6 real, target :: hosted(2)
7 contains
8 function f()
9 real, pointer, contiguous :: f(:)
10 f => hosted
11 end function
12 subroutine test(arr1, arr2, arr3, mat, alloc)
13 real, intent(in) :: arr1(:), arr2(10), mat(10, 10)
14 real, intent(in), contiguous :: arr3(:)
15 real, allocatable :: alloc(:)
16 real :: scalar
17 logical, parameter :: test_isc01 = is_contiguous(0)
18 logical, parameter :: test_isc02 = is_contiguous(scalar)
19 logical, parameter :: test_isc03 = is_contiguous(scalar + scalar)
20 logical, parameter :: test_isc04 = is_contiguous([0, 1, 2])
21 logical, parameter :: test_isc05 = is_contiguous(arr1 + 1.0)
22 logical, parameter :: test_isc06 = is_contiguous(arr2)
23 logical, parameter :: test_isc07 = is_contiguous(mat)
24 logical, parameter :: test_isc08 = is_contiguous(mat(1:10,1))
25 logical, parameter :: test_isc09 = is_contiguous(arr2(1:10:1))
26 logical, parameter :: test_isc10 = is_contiguous(arr3)
27 logical, parameter :: test_isc11 = is_contiguous(f())
28 logical, parameter :: test_isc12 = is_contiguous(alloc)
29 end subroutine
30 end module