152 lines · plain
1!RUN: %flang_fc1 -fopenmp-version=51 -fopenmp -fdebug-unparse-no-sema %s | FileCheck --check-prefix="UNPARSE" %s2!RUN: %flang_fc1 -fopenmp-version=51 -fopenmp -fdebug-dump-parse-tree-no-sema %s | FileCheck --check-prefix="PARSE-TREE" %s3 4subroutine sub15 integer :: r6 !$omp assume no_openmp7 !$omp end assume8 9 !$omp assume no_parallelism10 !$omp end assume11 12 !$omp assume no_openmp_routines13 !$omp end assume14 15 !$omp assume absent(allocate), contains(workshare, task)16 block ! strictly-structured-block17 end block18 19 !$omp assume holds(1.eq.1)20 block21 end block22 print *, r23end subroutine sub124 25!UNPARSE: SUBROUTINE sub126!UNPARSE: INTEGER r27!UNPARSE: !$OMP ASSUME NO_OPENMP28!UNPARSE: !$OMP END ASSUME29!UNPARSE: !$OMP ASSUME NO_PARALLELISM30!UNPARSE: !$OMP END ASSUME31!UNPARSE: !$OMP ASSUME NO_OPENMP_ROUTINES32!UNPARSE: !$OMP END ASSUME33!UNPARSE: !$OMP ASSUME ABSENT(ALLOCATE) CONTAINS(WORKSHARE,TASK)34!UNPARSE: BLOCK35!UNPARSE: END BLOCK36!UNPARSE: !$OMP ASSUME HOLDS(1==1)37!UNPARSE: BLOCK38!UNPARSE: END BLOCK39!UNPARSE: PRINT *, r40!UNPARSE: END SUBROUTINE sub141 42!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPAssumeConstruct43!PARSE-TREE: | OmpBeginDirective44!PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = assume45!PARSE-TREE: | | OmpClauseList -> OmpClause -> NoOpenmp46!PARSE-TREE: | | Flags = {}47!PARSE-TREE: | Block48!PARSE-TREE: | OmpEndDirective49!PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = assume50!PARSE-TREE: | | OmpClauseList ->51!PARSE-TREE: | | Flags = {}52!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPAssumeConstruct53!PARSE-TREE: | OmpBeginDirective54!PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = assume55!PARSE-TREE: | | OmpClauseList -> OmpClause -> NoParallelism56!PARSE-TREE: | | Flags = {}57!PARSE-TREE: | Block58!PARSE-TREE: | OmpEndDirective59!PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = assume60!PARSE-TREE: | | OmpClauseList ->61!PARSE-TREE: | | Flags = {}62!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPAssumeConstruct63!PARSE-TREE: | OmpBeginDirective64!PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = assume65!PARSE-TREE: | | OmpClauseList -> OmpClause -> NoOpenmpRoutines66!PARSE-TREE: | | Flags = {}67!PARSE-TREE: | Block68!PARSE-TREE: | OmpEndDirective69!PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = assume70!PARSE-TREE: | | OmpClauseList ->71!PARSE-TREE: | | Flags = {}72!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPAssumeConstruct73!PARSE-TREE: | OmpBeginDirective74!PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = assume75!PARSE-TREE: | | OmpClauseList -> OmpClause -> Absent -> OmpAbsentClause -> llvm::omp::Directive = allocate76!PARSE-TREE: | | OmpClause -> Contains -> OmpContainsClause -> llvm::omp::Directive = workshare77!PARSE-TREE: | | llvm::omp::Directive = task78!PARSE-TREE: | | Flags = {}79!PARSE-TREE: | Block80!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> BlockConstruct81!PARSE-TREE: | | | BlockStmt ->82!PARSE-TREE: | | | BlockSpecificationPart -> SpecificationPart83!PARSE-TREE: | | | | ImplicitPart ->84!PARSE-TREE: | | | Block85!PARSE-TREE: | | | EndBlockStmt ->86!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPAssumeConstruct87!PARSE-TREE: | OmpBeginDirective88!PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = assume89!PARSE-TREE: | | OmpClauseList -> OmpClause -> Holds -> OmpHoldsClause -> Expr -> EQ90!PARSE-TREE: | | | Expr -> LiteralConstant -> IntLiteralConstant = '1'91!PARSE-TREE: | | | Expr -> LiteralConstant -> IntLiteralConstant = '1'92!PARSE-TREE: | | Flags = {}93!PARSE-TREE: | Block94!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> BlockConstruct95!PARSE-TREE: | | | BlockStmt ->96!PARSE-TREE: | | | BlockSpecificationPart -> SpecificationPart97!PARSE-TREE: | | | | ImplicitPart ->98!PARSE-TREE: | | | Block99!PARSE-TREE: | | | EndBlockStmt ->100 101 102subroutine sub2103 integer :: r104 integer :: v105 v = 87106 !$omp assume no_openmp107 r = r + 1108 !$omp end assume109end subroutine sub2110 111!UNPARSE: SUBROUTINE sub2112!UNPARSE: INTEGER r113!UNPARSE: INTEGER v114!UNPARSE: v = 87115!UNPARSE: !$OMP ASSUME NO_OPENMP116!UNPARSE: r = r+1117!UNPARSE: !$OMP END ASSUME118!UNPARSE: END SUBROUTINE sub2119 120!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> AssignmentStmt121!PARSE-TREE: | Variable -> Designator -> DataRef -> Name = 'v'122!PARSE-TREE: | Expr -> LiteralConstant -> IntLiteralConstant = '87'123!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPAssumeConstruct124!PARSE-TREE: | OmpBeginDirective125!PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = assume126!PARSE-TREE: | | OmpClauseList -> OmpClause -> NoOpenmp127!PARSE-TREE: | | Flags = {}128!PARSE-TREE: | Block129!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> AssignmentStmt130!PARSE-TREE: | | | Variable -> Designator -> DataRef -> Name = 'r'131!PARSE-TREE: | | | Expr -> Add132!PARSE-TREE: | | | | Expr -> Designator -> DataRef -> Name = 'r'133!PARSE-TREE: | | | | Expr -> LiteralConstant -> IntLiteralConstant = '1'134!PARSE-TREE: | OmpEndDirective135!PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = assume136!PARSE-TREE: | | OmpClauseList ->137!PARSE-TREE: | | Flags = {}138 139program p140 !$omp assumes no_openmp141end program p142 143!UNPARSE: PROGRAM p144!UNPARSE: !$OMP ASSUMES NO_OPENMP145!UNPARSE: END PROGRAM p146 147!PARSE-TREE: OpenMPDeclarativeConstruct -> OpenMPDeclarativeAssumes -> OmpDirectiveSpecification148!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = assumes149!PARSE-TREE: | OmpClauseList -> OmpClause -> NoOpenmp150!PARSE-TREE: | Flags = {}151!PARSE-TREE: ImplicitPart ->152