[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / data12.f90
blobfa6120c1b4282a01c9c8af53db2fd3848ec49b55
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 type :: t1
3 sequence
4 integer :: m = 123
5 integer :: pad
6 end type
7 type :: t2
8 sequence
9 integer :: n = 123
10 integer :: pad
11 end type
12 type :: t3
13 sequence
14 integer :: k = 234
15 integer :: pad
16 end type
17 !ERROR: Distinct default component initializations of equivalenced objects affect 'x1a%m' more than once
18 type(t1) :: x1a
19 !ERROR: Distinct default component initializations of equivalenced objects affect 'x2a%n' more than once
20 type(t2) :: x2a
21 !ERROR: Distinct default component initializations of equivalenced objects affect 'x3%k' more than once
22 type(t3), save :: x3
23 !ERROR: Explicit initializations of equivalenced objects affect 'ja(2_8)' more than once
24 !ERROR: Explicit initializations of equivalenced objects affect 'ka(1_8)' more than once
25 integer :: ja(2), ka(2)
26 data ja/345, 456/
27 data ka/456, 567/
28 equivalence(x1a, x2a, x3)
29 ! Same value: no error
30 type(t1) :: x1b
31 type(t2) :: x2b
32 equivalence(x1b, x2b)
33 equivalence(ja(2),ka(1))
34 end