[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / resolve49.f90
blobaa6d76e2298a591066bbcdf961c274d3f7346d99
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Test section subscript
3 subroutine p1
4 real :: a(10,10)
5 real :: b(5,5)
6 real :: c
7 integer :: n
8 n = 2
9 b = a(1:10:n,1:n+3)
10 end
12 ! Test substring
13 subroutine p2
14 type t1(n1,n2)
15 integer,kind :: n1,n2
16 integer :: c2(iachar('ABCDEFGHIJ'(n1:n1)))
17 end type
18 character :: a(10)
19 character :: b(5)
20 character :: c(0)
21 integer :: n
22 n = 3
23 b = a(n:7)
24 b = a(n+3:)
25 b = a(:n+2)
26 a(n:7) = b
27 a(n+3:) = b
28 a(:n+2) = b
29 n = iachar(1_'ABCDEFGHIJ'(1:1))
30 c = 'ABCDEFGHIJ'(1:0)
31 end
33 ! Test pointer assignment with bounds
34 subroutine p3
35 integer, pointer :: a(:,:)
36 integer, target :: b(2,2)
37 integer :: n
38 n = 2
39 a(n:,n:) => b
40 a(1:n,1:n) => b
41 end
43 ! Test pointer assignment to array element
44 subroutine p4
45 type :: t
46 real, pointer :: a
47 end type
48 type(t) :: x(10)
49 integer :: i
50 real, target :: y
51 x(i)%a => y
52 end subroutine