1 ! RUN: bbc -pft-test -o %t %s | FileCheck %s
3 ! Test structure of the Pre-FIR tree
5 ! CHECK: Subroutine foo
7 ! CHECK: <<DoConstruct>>
8 ! CHECK: NonLabelDoStmt
12 ! CHECK: <<DoConstruct>>
13 ! CHECK: NonLabelDoStmt
16 print *, "hello", i
, j
19 ! CHECK: <<End DoConstruct>>
22 ! CHECK: <<End DoConstruct>>
23 ! CHECK: EndSubroutineStmt
25 ! CHECK: End Subroutine foo
29 integer, parameter :: n
= 100
30 integer, dimension(n
) :: a
, b
, c
31 common /arrays
/ a
, b
, c
33 ! CHECK: End BlockData
35 ! CHECK: Module test_mod
38 ! check specification parts are not part of the PFT.
40 module subroutine dump()
44 real, allocatable
:: pressure(:)
46 ! CHECK: Subroutine foo
48 ! CHECK: EndSubroutineStmt
50 ! CHECK: Subroutine subfoo
52 ! CHECK: EndSubroutineStmt
54 ! CHECK: End Subroutine subfoo
55 ! CHECK: Function subfoo2
57 ! CHECK: EndFunctionStmt
59 ! CHECK: End Function subfoo2
61 ! CHECK: End Subroutine foo
63 ! CHECK: Function foo2
66 ! CHECK: AssignmentStmt
68 ! CHECK: EndFunctionStmt
70 ! CHECK: Subroutine subfoo
72 ! CHECK: EndSubroutineStmt
74 ! CHECK: End Subroutine subfoo
76 ! CHECK: End Function foo2
78 ! CHECK: End Module test_mod
80 ! CHECK: Submodule test_mod_impl: submodule(test_mod) test_mod_impl
81 submodule (test_mod
) test_mod_impl
83 ! CHECK: Subroutine foo
85 ! CHECK: EndSubroutineStmt
87 ! CHECK: Subroutine subfoo
89 ! CHECK: EndSubroutineStmt
91 ! CHECK: End Subroutine subfoo
92 ! CHECK: Function subfoo2
94 ! CHECK: EndFunctionStmt
96 ! CHECK: End Function subfoo2
98 ! CHECK: End Subroutine foo
99 ! CHECK: MpSubprogram dump
100 module procedure dump
102 11 format (2E16
.4
, I6
)
103 ! CHECK: <<IfConstruct>>
107 print *, "test: ", xdim
111 write (*, 11) "test: ", xdim
, pressure
114 ! CHECK: <<End IfConstruct>>
117 ! CHECK: End Submodule test_mod_impl
120 block
data named_block
122 common /indexes
/ i
, j
, k
124 ! CHECK: End BlockData
126 ! CHECK: Function bar
128 ! CHECK: EndFunctionStmt
130 ! CHECK: End Function bar
132 ! Test top level directives
134 ! CHECK: CompilerDirective:
136 ! Test nested directive
137 ! CHECK: Subroutine test_directive
138 subroutine test_directive()
140 ! CHECK: CompilerDirective:
142 ! CHECK: EndSubroutine
144 ! CHECK: Program <anonymous>
145 ! check specification parts are not part of the PFT.
148 real, allocatable
:: x(:)
149 ! CHECK: AllocateStmt
150 allocate(x(foo2(10, 30)))