378 lines · plain
1!RUN: %flang_fc1 -fdebug-unparse -fopenmp -fopenmp-version=52 %s | FileCheck --ignore-case --check-prefix="UNPARSE" %s2!RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp -fopenmp-version=52 %s | FileCheck --check-prefix="PARSE-TREE" %s3 4subroutine f00(x)5 integer :: x6 !$omp target map(ompx_hold, always, present, close, to: x)7 x = x + 18 !$omp end target9end10 11!UNPARSE: SUBROUTINE f00 (x)12!UNPARSE: INTEGER x13!UNPARSE: !$OMP TARGET MAP(OMPX_HOLD, ALWAYS, PRESENT, CLOSE, TO: x)14!UNPARSE: x=x+1_415!UNPARSE: !$OMP END TARGET16!UNPARSE: END SUBROUTINE17 18!PARSE-TREE: OmpBeginDirective19!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = target20!PARSE-TREE: | OmpClauseList -> OmpClause -> Map -> OmpMapClause21!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Ompx_Hold22!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Always23!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Present24!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Close25!PARSE-TREE: | | Modifier -> OmpMapType -> Value = To26!PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'x'27!PARSE-TREE: | | bool = 'true'28 29subroutine f01(x)30 integer :: x31 !$omp target map(ompx_hold, always, present, close: x)32 x = x + 133 !$omp end target34end35 36!UNPARSE: SUBROUTINE f01 (x)37!UNPARSE: INTEGER x38!UNPARSE: !$OMP TARGET MAP(OMPX_HOLD, ALWAYS, PRESENT, CLOSE: x)39!UNPARSE: x=x+1_440!UNPARSE: !$OMP END TARGET41!UNPARSE: END SUBROUTINE42 43!PARSE-TREE: OmpBeginDirective44!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = target45!PARSE-TREE: | OmpClauseList -> OmpClause -> Map -> OmpMapClause46!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Ompx_Hold47!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Always48!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Present49!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Close50!PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'x'51!PARSE-TREE: | | bool = 'true'52 53subroutine f02(x)54 integer :: x55 !$omp target map(from: x)56 x = x + 157 !$omp end target58end59 60!UNPARSE: SUBROUTINE f02 (x)61!UNPARSE: INTEGER x62!UNPARSE: !$OMP TARGET MAP(FROM: x)63!UNPARSE: x=x+1_464!UNPARSE: !$OMP END TARGET65!UNPARSE: END SUBROUTINE66 67!PARSE-TREE: OmpBeginDirective68!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = target69!PARSE-TREE: | OmpClauseList -> OmpClause -> Map -> OmpMapClause70!PARSE-TREE: | | Modifier -> OmpMapType -> Value = From71!PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'x'72!PARSE-TREE: | | bool = 'true'73 74subroutine f03(x)75 integer :: x76 !$omp target map(x)77 x = x + 178 !$omp end target79end80 81!UNPARSE: SUBROUTINE f03 (x)82!UNPARSE: INTEGER x83!UNPARSE: !$OMP TARGET MAP(x)84!UNPARSE: x=x+1_485!UNPARSE: !$OMP END TARGET86!UNPARSE: END SUBROUTINE87 88!PARSE-TREE: OmpBeginDirective89!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = target90!PARSE-TREE: | OmpClauseList -> OmpClause -> Map -> OmpMapClause91!PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'x'92!PARSE-TREE: | | bool = 'true'93 94subroutine f04(x)95 integer :: x96 !$omp target map(ompx_hold always, present, close, to: x)97 x = x + 198 !$omp end target99end100 101!UNPARSE: SUBROUTINE f04 (x)102!UNPARSE: INTEGER x103!UNPARSE: !$OMP TARGET MAP(OMPX_HOLD, ALWAYS, PRESENT, CLOSE, TO: x)104!UNPARSE: x=x+1_4105!UNPARSE: !$OMP END TARGET106!UNPARSE: END SUBROUTINE107 108!PARSE-TREE: OmpBeginDirective109!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = target110!PARSE-TREE: | OmpClauseList -> OmpClause -> Map -> OmpMapClause111!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Ompx_Hold112!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Always113!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Present114!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Close115!PARSE-TREE: | | Modifier -> OmpMapType -> Value = To116!PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'x'117!PARSE-TREE: | | bool = 'false'118 119subroutine f05(x)120 integer :: x121 !$omp target map(ompx_hold, always, present, close: x)122 x = x + 1123 !$omp end target124end125 126!UNPARSE: SUBROUTINE f05 (x)127!UNPARSE: INTEGER x128!UNPARSE: !$OMP TARGET MAP(OMPX_HOLD, ALWAYS, PRESENT, CLOSE: x)129!UNPARSE: x=x+1_4130!UNPARSE: !$OMP END TARGET131!UNPARSE: END SUBROUTINE132 133!PARSE-TREE: OmpBeginDirective134!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = target135!PARSE-TREE: | OmpClauseList -> OmpClause -> Map -> OmpMapClause136!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Ompx_Hold137!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Always138!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Present139!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Close140!PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'x'141 142!PARSE-TREE: | | bool = 'true'143 144subroutine f10(x)145 integer :: x(10)146 !$omp target map(present, iterator(integer :: i = 1:10), to: x(i))147 x = x + 1148 !$omp end target149end150 151!UNPARSE: SUBROUTINE f10 (x)152!UNPARSE: INTEGER x(10_4)153!UNPARSE: !$OMP TARGET MAP(PRESENT, ITERATOR(INTEGER i = 1_4:10_4), TO: x(i))154!UNPARSE: x=x+1_4155!UNPARSE: !$OMP END TARGET156!UNPARSE: END SUBROUTINE157 158!PARSE-TREE: OmpBeginDirective159!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = target160!PARSE-TREE: | OmpClauseList -> OmpClause -> Map -> OmpMapClause161!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Present162!PARSE-TREE: | | Modifier -> OmpIterator -> OmpIteratorSpecifier163!PARSE-TREE: | | | TypeDeclarationStmt164!PARSE-TREE: | | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec ->165!PARSE-TREE: | | | | EntityDecl166!PARSE-TREE: | | | | | Name = 'i'167!PARSE-TREE: | | | SubscriptTriplet168!PARSE-TREE: | | | | Scalar -> Integer -> Expr = '1_4'169!PARSE-TREE: | | | | | LiteralConstant -> IntLiteralConstant = '1'170!PARSE-TREE: | | | | Scalar -> Integer -> Expr = '10_4'171!PARSE-TREE: | | | | | LiteralConstant -> IntLiteralConstant = '10'172!PARSE-TREE: | | Modifier -> OmpMapType -> Value = To173!PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> ArrayElement174!PARSE-TREE: | | | DataRef -> Name = 'x'175!PARSE-TREE: | | | SectionSubscript -> Integer -> Expr = 'i'176!PARSE-TREE: | | | | Designator -> DataRef -> Name = 'i'177!PARSE-TREE: | | bool = 'true'178 179subroutine f11(x)180 integer :: x(10)181 !$omp target map(present, iterator(i = 1:10), to: x(i))182 x = x + 1183 !$omp end target184end185 186!UNPARSE: SUBROUTINE f11 (x)187!UNPARSE: INTEGER x(10_4)188!UNPARSE: !$OMP TARGET MAP(PRESENT, ITERATOR(INTEGER i = 1_4:10_4), TO: x(i))189!UNPARSE: x=x+1_4190!UNPARSE: !$OMP END TARGET191!UNPARSE: END SUBROUTINE192 193!PARSE-TREE: OmpBeginDirective194!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = target195!PARSE-TREE: | OmpClauseList -> OmpClause -> Map -> OmpMapClause196!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Present197!PARSE-TREE: | | Modifier -> OmpIterator -> OmpIteratorSpecifier198!PARSE-TREE: | | | TypeDeclarationStmt199!PARSE-TREE: | | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec ->200!PARSE-TREE: | | | | EntityDecl201!PARSE-TREE: | | | | | Name = 'i'202!PARSE-TREE: | | | SubscriptTriplet203!PARSE-TREE: | | | | Scalar -> Integer -> Expr = '1_4'204!PARSE-TREE: | | | | | LiteralConstant -> IntLiteralConstant = '1'205!PARSE-TREE: | | | | Scalar -> Integer -> Expr = '10_4'206!PARSE-TREE: | | | | | LiteralConstant -> IntLiteralConstant = '10'207!PARSE-TREE: | | Modifier -> OmpMapType -> Value = To208!PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> ArrayElement209!PARSE-TREE: | | | DataRef -> Name = 'x'210!PARSE-TREE: | | | SectionSubscript -> Integer -> Expr = 'i'211!PARSE-TREE: | | | | Designator -> DataRef -> Name = 'i'212!PARSE-TREE: | | bool = 'true'213 214subroutine f12(x)215 integer :: x(10)216 !$omp target map(present, iterator(i = 1:10, integer :: j = 1:10), to: x((i + j) / 2))217 x = x + 1218 !$omp end target219end220 221!UNPARSE: SUBROUTINE f12 (x)222!UNPARSE: INTEGER x(10_4)223!UNPARSE: !$OMP TARGET MAP(PRESENT, ITERATOR(INTEGER i = 1_4:10_4, INTEGER j = 1_4:10_4), TO: x((i+j)/2_4))224!UNPARSE: x=x+1_4225!UNPARSE: !$OMP END TARGET226!UNPARSE: END SUBROUTINE227 228!PARSE-TREE: OmpBeginDirective229!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = target230!PARSE-TREE: | OmpClauseList -> OmpClause -> Map -> OmpMapClause231!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Present232!PARSE-TREE: | | Modifier -> OmpIterator -> OmpIteratorSpecifier233!PARSE-TREE: | | | TypeDeclarationStmt234!PARSE-TREE: | | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec ->235!PARSE-TREE: | | | | EntityDecl236!PARSE-TREE: | | | | | Name = 'i'237!PARSE-TREE: | | | SubscriptTriplet238!PARSE-TREE: | | | | Scalar -> Integer -> Expr = '1_4'239!PARSE-TREE: | | | | | LiteralConstant -> IntLiteralConstant = '1'240!PARSE-TREE: | | | | Scalar -> Integer -> Expr = '10_4'241!PARSE-TREE: | | | | | LiteralConstant -> IntLiteralConstant = '10'242!PARSE-TREE: | | | OmpIteratorSpecifier243!PARSE-TREE: | | | | TypeDeclarationStmt244!PARSE-TREE: | | | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec ->245!PARSE-TREE: | | | | | EntityDecl246!PARSE-TREE: | | | | | | Name = 'j'247!PARSE-TREE: | | | | SubscriptTriplet248!PARSE-TREE: | | | | | Scalar -> Integer -> Expr = '1_4'249!PARSE-TREE: | | | | | | LiteralConstant -> IntLiteralConstant = '1'250!PARSE-TREE: | | | | | Scalar -> Integer -> Expr = '10_4'251!PARSE-TREE: | | | | | | LiteralConstant -> IntLiteralConstant = '10'252!PARSE-TREE: | | Modifier -> OmpMapType -> Value = To253!PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> ArrayElement254!PARSE-TREE: | | | DataRef -> Name = 'x'255!PARSE-TREE: | | | SectionSubscript -> Integer -> Expr = '(i+j)/2_4'256!PARSE-TREE: | | | | Divide257!PARSE-TREE: | | | | | Expr = '(i+j)'258!PARSE-TREE: | | | | | | Parentheses -> Expr = 'i+j'259!PARSE-TREE: | | | | | | | Add260!PARSE-TREE: | | | | | | | | Expr = 'i'261!PARSE-TREE: | | | | | | | | | Designator -> DataRef -> Name = 'i'262!PARSE-TREE: | | | | | | | | Expr = 'j'263!PARSE-TREE: | | | | | | | | | Designator -> DataRef -> Name = 'j'264!PARSE-TREE: | | | | | Expr = '2_4'265!PARSE-TREE: | | | | | | LiteralConstant -> IntLiteralConstant = '2'266!PARSE-TREE: | | bool = 'true'267 268subroutine f20(x, y)269 integer :: x(10)270 integer :: y271 integer, parameter :: p = 23272 !$omp target map(present, iterator(i, j = y:p, k = i:j), to: x(k))273 x = x + 1274 !$omp end target275end276 277!UNPARSE: SUBROUTINE f20 (x, y)278!UNPARSE: INTEGER x(10_4)279!UNPARSE: INTEGER y280!UNPARSE: INTEGER, PARAMETER :: p = 23_4281!UNPARSE: !$OMP TARGET MAP(PRESENT, ITERATOR(INTEGER i, j = y:23_4, INTEGER k = i:j), TO: x(k))282!UNPARSE: x=x+1_4283!UNPARSE: !$OMP END TARGET284!UNPARSE: END SUBROUTINE285 286!PARSE-TREE: OmpBeginDirective287!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = target288!PARSE-TREE: | OmpClauseList -> OmpClause -> Map -> OmpMapClause289!PARSE-TREE: | | Modifier -> OmpMapTypeModifier -> Value = Present290!PARSE-TREE: | | Modifier -> OmpIterator -> OmpIteratorSpecifier291!PARSE-TREE: | | | TypeDeclarationStmt292!PARSE-TREE: | | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec ->293!PARSE-TREE: | | | | EntityDecl294!PARSE-TREE: | | | | | Name = 'i'295!PARSE-TREE: | | | | EntityDecl296!PARSE-TREE: | | | | | Name = 'j'297!PARSE-TREE: | | | SubscriptTriplet298!PARSE-TREE: | | | | Scalar -> Integer -> Expr = 'y'299!PARSE-TREE: | | | | | Designator -> DataRef -> Name = 'y'300!PARSE-TREE: | | | | Scalar -> Integer -> Expr = '23_4'301!PARSE-TREE: | | | | | Designator -> DataRef -> Name = 'p'302!PARSE-TREE: | | | OmpIteratorSpecifier303!PARSE-TREE: | | | | TypeDeclarationStmt304!PARSE-TREE: | | | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec ->305!PARSE-TREE: | | | | | EntityDecl306!PARSE-TREE: | | | | | | Name = 'k'307!PARSE-TREE: | | | | SubscriptTriplet308!PARSE-TREE: | | | | | Scalar -> Integer -> Expr = 'i'309!PARSE-TREE: | | | | | | Designator -> DataRef -> Name = 'i'310!PARSE-TREE: | | | | | Scalar -> Integer -> Expr = 'j'311!PARSE-TREE: | | | | | | Designator -> DataRef -> Name = 'j'312!PARSE-TREE: | | Modifier -> OmpMapType -> Value = To313!PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> ArrayElement314!PARSE-TREE: | | | DataRef -> Name = 'x'315!PARSE-TREE: | | | SectionSubscript -> Integer -> Expr = 'k'316!PARSE-TREE: | | | | Designator -> DataRef -> Name = 'k'317!PARSE-TREE: | | bool = 'true'318 319subroutine f21(x, y)320 integer :: x(10)321 integer :: y322 integer, parameter :: p = 23323 !$omp target map(mapper(default), from: x)324 x = x + 1325 !$omp end target326end327 328!UNPARSE: SUBROUTINE f21 (x, y)329!UNPARSE: INTEGER x(10_4)330!UNPARSE: INTEGER y331!UNPARSE: INTEGER, PARAMETER :: p = 23_4332!UNPARSE: !$OMP TARGET MAP(MAPPER(DEFAULT), FROM: X)333!UNPARSE: x=x+1_4334!UNPARSE: !$OMP END TARGET335!UNPARSE: END SUBROUTINE336 337!PARSE-TREE: OmpBeginDirective338!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = target339!PARSE-TREE: | OmpClauseList -> OmpClause -> Map -> OmpMapClause340!PARSE-TREE: | | Modifier -> OmpMapper -> Name = 'default'341!PARSE-TREE: | | Modifier -> OmpMapType -> Value = From342!PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'x'343 344subroutine f22(x)345 integer :: x(10)346 !$omp target map(present, iterator(i = 1:10), always, from: x(i))347 x = x + 1348 !$omp end target349end350 351!UNPARSE: SUBROUTINE f22 (x)352!UNPARSE: INTEGER x(10_4)353!UNPARSE: !$OMP TARGET MAP(PRESENT, ITERATOR(INTEGER i = 1_4:10_4), ALWAYS, FROM: x(i))354!UNPARSE: x=x+1_4355!UNPARSE: !$OMP END TARGET356!UNPARSE: END SUBROUTINE357 358!PARSE-TREE: OmpDirectiveName -> llvm::omp::Directive = target359!PARSE-TREE: OmpClauseList -> OmpClause -> Map -> OmpMapClause360!PARSE-TREE: | Modifier -> OmpMapTypeModifier -> Value = Present361!PARSE-TREE: | Modifier -> OmpIterator -> OmpIteratorSpecifier362!PARSE-TREE: | | TypeDeclarationStmt363!PARSE-TREE: | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec ->364!PARSE-TREE: | | | EntityDecl365!PARSE-TREE: | | | | Name = 'i'366!PARSE-TREE: | | SubscriptTriplet367!PARSE-TREE: | | | Scalar -> Integer -> Expr = '1_4'368!PARSE-TREE: | | | | LiteralConstant -> IntLiteralConstant = '1'369!PARSE-TREE: | | | Scalar -> Integer -> Expr = '10_4'370!PARSE-TREE: | | | | LiteralConstant -> IntLiteralConstant = '10'371!PARSE-TREE: | Modifier -> OmpMapTypeModifier -> Value = Always372!PARSE-TREE: | Modifier -> OmpMapType -> Value = From373!PARSE-TREE: | OmpObjectList -> OmpObject -> Designator -> DataRef -> ArrayElement374!PARSE-TREE: | | DataRef -> Name = 'x'375!PARSE-TREE: | | SectionSubscript -> Integer -> Expr = 'i'376!PARSE-TREE: | | | Designator -> DataRef -> Name = 'i'377!PARSE-TREE: | bool = 'true'378