aboutsummaryrefslogtreecommitdiff
path: root/flang/test/Parser/cuf-sanity-tree.CUF
blob: 2820441d5b5f0ae4c032a1bc7f64d5c0dfa82067 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
! RUN: %flang_fc1 -fdebug-dump-parse-tree %s 2>&1 | FileCheck %s
include "cuf-sanity-common"
!CHECK: Program -> ProgramUnit -> SubroutineSubprogram
!CHECK: | SubroutineStmt
!CHECK: | | Name = 'atcuf'
!CHECK: | SpecificationPart
!CHECK: | | ImplicitPart -> 
!CHECK: | ExecutionPart -> Block
!CHECK: | EndSubroutineStmt -> 
!CHECK: ProgramUnit -> SubroutineSubprogram
!CHECK: | SubroutineStmt
!CHECK: | | Name = 'cudadefd'
!CHECK: | SpecificationPart
!CHECK: | | ImplicitPart -> 
!CHECK: | ExecutionPart -> Block
!CHECK: | EndSubroutineStmt -> 
!CHECK: ProgramUnit -> Module
!CHECK: | ModuleStmt -> Name = 'm'
!CHECK: | SpecificationPart
!CHECK: | | ImplicitPart -> 
!CHECK: | | DeclarationConstruct -> SpecificationConstruct -> TypeDeclarationStmt
!CHECK: | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> Real
!CHECK: | | | AttrSpec -> Allocatable
!CHECK: | | | AttrSpec -> CUDADataAttr = Pinned
!CHECK: | | | EntityDecl
!CHECK: | | | | Name = 'pa'
!CHECK: | | | | ArraySpec -> DeferredShapeSpecList -> int
!CHECK: | ModuleSubprogramPart
!CHECK: | | ContainsStmt
!CHECK: | | ModuleSubprogram -> SubroutineSubprogram
!CHECK: | | | SubroutineStmt
!CHECK: | | | | PrefixSpec -> Attributes -> CUDASubprogramAttrs = Device
!CHECK: | | | | Name = 'devicesub'
!CHECK: | | | SpecificationPart
!CHECK: | | | | ImplicitPart -> 
!CHECK: | | | ExecutionPart -> Block
!CHECK: | | | EndSubroutineStmt -> 
!CHECK: | | ModuleSubprogram -> FunctionSubprogram
!CHECK: | | | FunctionStmt
!CHECK: | | | | PrefixSpec -> Attributes -> CUDASubprogramAttrs = Device
!CHECK: | | | | PrefixSpec -> DeclarationTypeSpec -> IntrinsicTypeSpec -> Real
!CHECK: | | | | Name = 'devicefunc'
!CHECK: | | | SpecificationPart
!CHECK: | | | | ImplicitPart -> 
!CHECK: | | | ExecutionPart -> Block
!CHECK: | | | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> AssignmentStmt = 'devicefunc=1._4'
!CHECK: | | | | | Variable = 'devicefunc'
!CHECK: | | | | | | Designator -> DataRef -> Name = 'devicefunc'
!CHECK: | | | | | Expr = '1._4'
!CHECK: | | | | | | LiteralConstant -> RealLiteralConstant
!CHECK: | | | | | | | Real = '1.'
!CHECK: | | | EndFunctionStmt -> 
!CHECK: | | ModuleSubprogram -> SubroutineSubprogram
!CHECK: | | | SubroutineStmt
!CHECK: | | | | PrefixSpec -> Attributes -> CUDASubprogramAttrs = Global
!CHECK: | | | | Name = 'globalsub'
!CHECK: | | | SpecificationPart
!CHECK: | | | | ImplicitPart -> 
!CHECK: | | | ExecutionPart -> Block
!CHECK: | | | EndSubroutineStmt -> 
!CHECK: | | ModuleSubprogram -> SubroutineSubprogram
!CHECK: | | | SubroutineStmt
!CHECK: | | | | PrefixSpec -> Attributes -> CUDASubprogramAttrs = Grid_Global
!CHECK: | | | | Name = 'gridglobalsub'
!CHECK: | | | SpecificationPart
!CHECK: | | | | ImplicitPart -> 
!CHECK: | | | ExecutionPart -> Block
!CHECK: | | | EndSubroutineStmt -> 
!CHECK: | | ModuleSubprogram -> SubroutineSubprogram
!CHECK: | | | SubroutineStmt
!CHECK: | | | | PrefixSpec -> Attributes -> CUDASubprogramAttrs = Host
!CHECK: | | | | Name = 'hostsub'
!CHECK: | | | SpecificationPart
!CHECK: | | | | ImplicitPart -> 
!CHECK: | | | ExecutionPart -> Block
!CHECK: | | | EndSubroutineStmt -> 
!CHECK: | | ModuleSubprogram -> SubroutineSubprogram
!CHECK: | | | SubroutineStmt
!CHECK: | | | | PrefixSpec -> Attributes -> CUDASubprogramAttrs = Global
!CHECK: | | | | PrefixSpec -> Launch_Bounds -> Scalar -> Integer -> Constant -> Expr = '1_4'
!CHECK: | | | | | LiteralConstant -> IntLiteralConstant = '1'
!CHECK: | | | | Scalar -> Integer -> Constant -> Expr = '2_4'
!CHECK: | | | | | LiteralConstant -> IntLiteralConstant = '2'
!CHECK: | | | | Name = 'lbsub'
!CHECK: | | | SpecificationPart
!CHECK: | | | | ImplicitPart -> 
!CHECK: | | | ExecutionPart -> Block
!CHECK: | | | EndSubroutineStmt -> 
!CHECK: | | ModuleSubprogram -> SubroutineSubprogram
!CHECK: | | | SubroutineStmt
!CHECK: | | | | PrefixSpec -> Attributes -> CUDASubprogramAttrs = Global
!CHECK: | | | | PrefixSpec -> Cluster_Dims -> Scalar -> Integer -> Constant -> Expr = '1_4'
!CHECK: | | | | | LiteralConstant -> IntLiteralConstant = '1'
!CHECK: | | | | Scalar -> Integer -> Constant -> Expr = '2_4'
!CHECK: | | | | | LiteralConstant -> IntLiteralConstant = '2'
!CHECK: | | | | Scalar -> Integer -> Constant -> Expr = '3_4'
!CHECK: | | | | | LiteralConstant -> IntLiteralConstant = '3'
!CHECK: | | | | Name = 'cdsub'
!CHECK: | | | SpecificationPart
!CHECK: | | | | ImplicitPart -> 
!CHECK: | | | ExecutionPart -> Block
!CHECK: | | | EndSubroutineStmt -> 
!CHECK: | | ModuleSubprogram -> SubroutineSubprogram
!CHECK: | | | SubroutineStmt
!CHECK: | | | | PrefixSpec -> Attributes -> CUDASubprogramAttrs = Device
!CHECK: | | | | Name = 'attrs'
!CHECK: | | | SpecificationPart
!CHECK: | | | | ImplicitPart -> 
!CHECK: | | | | DeclarationConstruct -> SpecificationConstruct -> OtherSpecificationStmt -> CUDAAttributesStmt
!CHECK: | | | | | CUDADataAttr = Device
!CHECK: | | | | | Name = 'devx1'
!CHECK: | | | | DeclarationConstruct -> SpecificationConstruct -> TypeDeclarationStmt
!CHECK: | | | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> Real
!CHECK: | | | | | AttrSpec -> CUDADataAttr = Device
!CHECK: | | | | | EntityDecl
!CHECK: | | | | | | Name = 'devx2'
!CHECK: | | | ExecutionPart -> Block
!CHECK: | | | EndSubroutineStmt -> 
!CHECK: | | ModuleSubprogram -> SubroutineSubprogram
!CHECK: | | | SubroutineStmt
!CHECK: | | | | Name = 'test'
!CHECK: | | | SpecificationPart
!CHECK: | | | | ImplicitPart -> 
!CHECK: | | | | DeclarationConstruct -> SpecificationConstruct -> TypeDeclarationStmt
!CHECK: | | | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> Logical
!CHECK: | | | | | EntityDecl
!CHECK: | | | | | | Name = 'ispinned'
!CHECK: | | | ExecutionPart -> Block
!CHECK: | | | | ExecutionPartConstruct -> ExecutableConstruct -> CUFKernelDoConstruct
!CHECK: | | | | | Directive
!CHECK: | | | | | | Scalar -> Integer -> Constant -> Expr = '1_4'
!CHECK: | | | | | | | LiteralConstant -> IntLiteralConstant = '1'
!CHECK: | | | | | | Scalar -> Integer -> Expr = '1_4'
!CHECK: | | | | | | | LiteralConstant -> IntLiteralConstant = '1'
!CHECK: | | | | | DoConstruct
!CHECK: | | | | | | NonLabelDoStmt
!CHECK: | | | | | | | LoopControl -> LoopBounds
!CHECK: | | | | | | | | Scalar -> Name = 'j'
!CHECK: | | | | | | | | Scalar -> Expr = '1_4'
!CHECK: | | | | | | | | | LiteralConstant -> IntLiteralConstant = '1'
!CHECK: | | | | | | | | Scalar -> Expr = '10_4'
!CHECK: | | | | | | | | | LiteralConstant -> IntLiteralConstant = '10'
!CHECK: | | | | | | Block
!CHECK: | | | | | | EndDoStmt -> 
!CHECK: | | | | ExecutionPartConstruct -> ExecutableConstruct -> CUFKernelDoConstruct
!CHECK: | | | | | Directive
!CHECK: | | | | | | StarOrExpr -> Scalar -> Integer -> Expr = '1_4'
!CHECK: | | | | | | | LiteralConstant -> IntLiteralConstant = '1'
!CHECK: | | | | | | StarOrExpr -> Scalar -> Integer -> Expr = '2_4'
!CHECK: | | | | | | | LiteralConstant -> IntLiteralConstant = '2'
!CHECK: | | | | | | StarOrExpr -> Scalar -> Integer -> Expr = '3_4'
!CHECK: | | | | | | | LiteralConstant -> IntLiteralConstant = '3'
!CHECK: | | | | | | Scalar -> Integer -> Expr = '1_4'
!CHECK: | | | | | | | LiteralConstant -> IntLiteralConstant = '1'
!CHECK: | | | | | DoConstruct
!CHECK: | | | | | | NonLabelDoStmt
!CHECK: | | | | | | | LoopControl -> LoopBounds
!CHECK: | | | | | | | | Scalar -> Name = 'j'
!CHECK: | | | | | | | | Scalar -> Expr = '1_4'
!CHECK: | | | | | | | | | LiteralConstant -> IntLiteralConstant = '1'
!CHECK: | | | | | | | | Scalar -> Expr = '10_4'
!CHECK: | | | | | | | | | LiteralConstant -> IntLiteralConstant = '10'
!CHECK: | | | | | | Block
!CHECK: | | | | | | EndDoStmt -> 
!CHECK: | | | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> CallStmt = 'CALL globalsub<<<1_4,2_4>>>()'
!CHECK: | | | | | Call
!CHECK: | | | | | | ProcedureDesignator -> Name = 'globalsub'
!CHECK: | | | | | Chevrons
!CHECK: | | | | | | Scalar -> Expr = '1_4'
!CHECK: | | | | | | | LiteralConstant -> IntLiteralConstant = '1'
!CHECK: | | | | | | Scalar -> Expr = '2_4'
!CHECK: | | | | | | | LiteralConstant -> IntLiteralConstant = '2'
!CHECK: | | | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> CallStmt = 'CALL globalsub<<<1_4,2_4,3_4>>>()'
!CHECK: | | | | | Call
!CHECK: | | | | | | ProcedureDesignator -> Name = 'globalsub'
!CHECK: | | | | | Chevrons
!CHECK: | | | | | | Scalar -> Expr = '1_4'
!CHECK: | | | | | | | LiteralConstant -> IntLiteralConstant = '1'
!CHECK: | | | | | | Scalar -> Expr = '2_4'
!CHECK: | | | | | | | LiteralConstant -> IntLiteralConstant = '2'
!CHECK: | | | | | | Scalar -> Integer -> Expr = '3_4'
!CHECK: | | | | | | | LiteralConstant -> IntLiteralConstant = '3'
!CHECK: | | | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> CallStmt = 'CALL globalsub<<<1_4,2_4,3_4,4_4>>>()'
!CHECK: | | | | | Call
!CHECK: | | | | | | ProcedureDesignator -> Name = 'globalsub'
!CHECK: | | | | | Chevrons
!CHECK: | | | | | | Scalar -> Expr = '1_4'
!CHECK: | | | | | | | LiteralConstant -> IntLiteralConstant = '1'
!CHECK: | | | | | | Scalar -> Expr = '2_4'
!CHECK: | | | | | | | LiteralConstant -> IntLiteralConstant = '2'
!CHECK: | | | | | | Scalar -> Integer -> Expr = '3_4'
!CHECK: | | | | | | | LiteralConstant -> IntLiteralConstant = '3'
!CHECK: | | | | | | Scalar -> Integer -> Expr = '4_4'
!CHECK: | | | | | | | LiteralConstant -> IntLiteralConstant = '4'
!CHECK: | | | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> AllocateStmt
!CHECK: | | | | | Allocation
!CHECK: | | | | | | AllocateObject = 'pa'
!CHECK: | | | | | | | Name = 'pa'
!CHECK: | | | | | | AllocateShapeSpec
!CHECK: | | | | | | | Scalar -> Integer -> Expr = '32_4'
!CHECK: | | | | | | | | LiteralConstant -> IntLiteralConstant = '32'
!CHECK: | | | | | AllocOpt -> Pinned -> Scalar -> Logical -> Variable = 'ispinned'
!CHECK: | | | | | | Designator -> DataRef -> Name = 'ispinned'
!CHECK: | | | EndSubroutineStmt -> 
!CHECK: | EndModuleStmt ->