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