Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / symbol22.f90
blob6a85b37a15aea8bc7ad5de0d5d015a4788659799
1 ! RUN: %python %S/test_symbols.py %s %flang_fc1
2 ! Allow redeclaration of inherited inaccessible components
3 !DEF: /m1 Module
4 module m1
5 !DEF: /m1/t0 PRIVATE DerivedType
6 type, private :: t0
7 end type
8 !REF: /m1/t0
9 !DEF: /m1/t1 PUBLIC DerivedType
10 type, extends(t0) :: t1
11 !DEF: /m1/t1/n1a PRIVATE ObjectEntity INTEGER(4)
12 !DEF: /m1/t1/n1b PRIVATE ObjectEntity INTEGER(4)
13 integer, private :: n1a = 1, n1b = 2
14 end type
15 end module
16 !DEF: /m2 Module
17 module m2
18 !REF: /m1
19 use :: m1
20 !DEF: /m2/t1 PUBLIC Use
21 !DEF: /m2/t2 PUBLIC DerivedType
22 type, extends(t1) :: t2
23 !DEF: /m2/t2/t0 ObjectEntity REAL(4)
24 real :: t0
25 !DEF: /m2/t2/n1a ObjectEntity REAL(4)
26 real :: n1a
27 end type
28 !REF: /m2/t2
29 !DEF: /m2/t3 PUBLIC DerivedType
30 type, extends(t2) :: t3
31 !DEF: /m2/t3/n1b ObjectEntity REAL(4)
32 real :: n1b
33 end type
34 end module
35 !DEF: /test (Subroutine) Subprogram
36 subroutine test
37 !REF: /m2
38 use :: m2
39 !DEF: /test/t3 Use
40 !DEF: /test/x ObjectEntity TYPE(t3)
41 type(t3) :: x
42 !REF: /test/x
43 !REF: /m2/t3/n1b
44 x%n1b = 1.
45 !REF: /test/x
46 !DEF: /m2/t3/t2 (ParentComp) ObjectEntity TYPE(t2)
47 !DEF: /test/t2 Use
48 x%t2 = t2(t0=2., n1a=3.)
49 !REF: /test/x
50 !REF: /m2/t2/t0
51 x%t0 = 4.
52 !REF: /test/x
53 !REF: /m2/t2/n1a
54 x%n1a = 5.
55 end subroutine