Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / symbol02.f90
blobe3f76c778e9bd2ca39ebf48654aa9525133c53e6
1 ! RUN: %python %S/test_symbols.py %s %flang_fc1
2 ! Test host association in module subroutine and internal subroutine.
4 !DEF: /m Module
5 module m
6 !DEF: /m/t PUBLIC DerivedType
7 type :: t
8 end type
9 !REF: /m/t
10 !DEF: /m/x PUBLIC ObjectEntity TYPE(t)
11 type(t) :: x
12 interface
13 !DEF: /m/s3 MODULE, PUBLIC (Subroutine) Subprogram
14 !DEF: /m/s3/y ObjectEntity TYPE(t)
15 module subroutine s3(y)
16 !REF: /m/t
17 !REF: /m/s3/y
18 type(t) :: y
19 end subroutine
20 end interface
21 contains
22 !DEF: /m/s PUBLIC (Subroutine) Subprogram
23 subroutine s
24 !REF: /m/t
25 !DEF: /m/s/y ObjectEntity TYPE(t)
26 type(t) :: y
27 !REF: /m/s/y
28 !REF: /m/x
29 y = x
30 !DEF: /m/s/s (Subroutine) HostAssoc
31 call s
32 contains
33 !DEF: /m/s/s2 (Subroutine) Subprogram
34 subroutine s2
35 !REF: /m/x
36 !REF: /m/s/y
37 !REF: /m/t
38 !REF: /m/s/s
39 import, only: x, y, t, s
40 !REF: /m/t
41 !DEF: /m/s/s2/z ObjectEntity TYPE(t)
42 type(t) :: z
43 !REF: /m/s/s2/z
44 !REF: /m/x
45 z = x
46 !REF: /m/s/s2/z
47 !DEF: /m/s/s2/y HostAssoc TYPE(t)
48 z = y
49 !REF: /m/s/s
50 call s
51 end subroutine
52 end subroutine
53 end module