|
| 1 | +!RUN: %flang_fc1 -fdebug-unparse -fopenmp %s | FileCheck --ignore-case --check-prefix="UNPARSE" %s |
| 2 | +!RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp %s | FileCheck --check-prefix="PARSE-TREE" %s |
| 3 | + |
| 4 | +! Check that this is parsed correctly. Specifically, that the "10 continue" |
| 5 | +! terminates both do-loops, and both "parallel do" directives. |
| 6 | + |
| 7 | +subroutine f |
| 8 | + !$omp parallel do lastprivate(i) |
| 9 | + do 10 i=1,2 |
| 10 | + !$omp parallel do lastprivate(j) |
| 11 | + do 10 j=1,2 |
| 12 | + 10 continue |
| 13 | + !$omp parallel |
| 14 | + !$omp end parallel |
| 15 | + print *,'pass' |
| 16 | +end |
| 17 | + |
| 18 | +!UNPARSE: SUBROUTINE f |
| 19 | +!UNPARSE: !$OMP PARALLEL DO LASTPRIVATE(i) |
| 20 | +!UNPARSE: DO i=1_4,2_4 |
| 21 | +!UNPARSE: !$OMP PARALLEL DO LASTPRIVATE(j) |
| 22 | +!UNPARSE: DO j=1_4,2_4 |
| 23 | +!UNPARSE: 10 CONTINUE |
| 24 | +!UNPARSE: END DO |
| 25 | +!UNPARSE: END DO |
| 26 | +!UNPARSE: !$OMP PARALLEL |
| 27 | +!UNPARSE: !$OMP END PARALLEL |
| 28 | +!UNPARSE: PRINT *, "pass" |
| 29 | +!UNPARSE: END SUBROUTINE |
| 30 | + |
| 31 | +!PARSE-TREE: Program -> ProgramUnit -> SubroutineSubprogram |
| 32 | +!PARSE-TREE: | SubroutineStmt |
| 33 | +!PARSE-TREE: | | Name = 'f' |
| 34 | +!PARSE-TREE: | SpecificationPart |
| 35 | +!PARSE-TREE: | | ImplicitPart -> |
| 36 | +!PARSE-TREE: | ExecutionPart -> Block |
| 37 | +!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct |
| 38 | +!PARSE-TREE: | | | OmpBeginLoopDirective |
| 39 | +!PARSE-TREE: | | | | OmpDirectiveName -> llvm::omp::Directive = parallel do |
| 40 | +!PARSE-TREE: | | | | OmpClauseList -> OmpClause -> Lastprivate -> OmpLastprivateClause |
| 41 | +!PARSE-TREE: | | | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'i' |
| 42 | +!PARSE-TREE: | | | | Flags = {} |
| 43 | +!PARSE-TREE: | | | Block |
| 44 | +!PARSE-TREE: | | | | ExecutionPartConstruct -> ExecutableConstruct -> DoConstruct |
| 45 | +!PARSE-TREE: | | | | | NonLabelDoStmt |
| 46 | +!PARSE-TREE: | | | | | | LoopControl -> LoopBounds |
| 47 | +!PARSE-TREE: | | | | | | | Scalar -> Name = 'i' |
| 48 | +!PARSE-TREE: | | | | | | | Scalar -> Expr = '1_4' |
| 49 | +!PARSE-TREE: | | | | | | | | LiteralConstant -> IntLiteralConstant = '1' |
| 50 | +!PARSE-TREE: | | | | | | | Scalar -> Expr = '2_4' |
| 51 | +!PARSE-TREE: | | | | | | | | LiteralConstant -> IntLiteralConstant = '2' |
| 52 | +!PARSE-TREE: | | | | | Block |
| 53 | +!PARSE-TREE: | | | | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct |
| 54 | +!PARSE-TREE: | | | | | | | OmpBeginLoopDirective |
| 55 | +!PARSE-TREE: | | | | | | | | OmpDirectiveName -> llvm::omp::Directive = parallel do |
| 56 | +!PARSE-TREE: | | | | | | | | OmpClauseList -> OmpClause -> Lastprivate -> OmpLastprivateClause |
| 57 | +!PARSE-TREE: | | | | | | | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'j' |
| 58 | +!PARSE-TREE: | | | | | | | | Flags = {CrossesLabelDo} |
| 59 | +!PARSE-TREE: | | | | | | | Block |
| 60 | +!PARSE-TREE: | | | | | | | | ExecutionPartConstruct -> ExecutableConstruct -> DoConstruct |
| 61 | +!PARSE-TREE: | | | | | | | | | NonLabelDoStmt |
| 62 | +!PARSE-TREE: | | | | | | | | | | LoopControl -> LoopBounds |
| 63 | +!PARSE-TREE: | | | | | | | | | | | Scalar -> Name = 'j' |
| 64 | +!PARSE-TREE: | | | | | | | | | | | Scalar -> Expr = '1_4' |
| 65 | +!PARSE-TREE: | | | | | | | | | | | | LiteralConstant -> IntLiteralConstant = '1' |
| 66 | +!PARSE-TREE: | | | | | | | | | | | Scalar -> Expr = '2_4' |
| 67 | +!PARSE-TREE: | | | | | | | | | | | | LiteralConstant -> IntLiteralConstant = '2' |
| 68 | +!PARSE-TREE: | | | | | | | | | Block |
| 69 | +!PARSE-TREE: | | | | | | | | | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> ContinueStmt |
| 70 | +!PARSE-TREE: | | | | | | | | | EndDoStmt -> |
| 71 | +!PARSE-TREE: | | | | | EndDoStmt -> |
| 72 | +!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OmpBlockConstruct |
| 73 | +!PARSE-TREE: | | | OmpBeginDirective |
| 74 | +!PARSE-TREE: | | | | OmpDirectiveName -> llvm::omp::Directive = parallel |
| 75 | +!PARSE-TREE: | | | | OmpClauseList -> |
| 76 | +!PARSE-TREE: | | | | Flags = {} |
| 77 | +!PARSE-TREE: | | | Block |
| 78 | +!PARSE-TREE: | | | OmpEndDirective |
| 79 | +!PARSE-TREE: | | | | OmpDirectiveName -> llvm::omp::Directive = parallel |
| 80 | +!PARSE-TREE: | | | | OmpClauseList -> |
| 81 | +!PARSE-TREE: | | | | Flags = {} |
| 82 | +!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> PrintStmt |
| 83 | +!PARSE-TREE: | | | Format -> Star |
| 84 | +!PARSE-TREE: | | | OutputItem -> Expr = '"pass"' |
| 85 | +!PARSE-TREE: | | | | LiteralConstant -> CharLiteralConstant |
| 86 | +!PARSE-TREE: | | | | | string = 'pass' |
| 87 | +!PARSE-TREE: | EndSubroutineStmt -> |
| 88 | + |
0 commit comments