1 ! RUN: %flang_fc1 -fdebug-unparse -fopenmp %s | FileCheck --ignore-case %s
2 ! RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp %s | FileCheck --check-prefix="PARSE-TREE" %s
4 subroutine openmp_sections(x
, y
)
6 integer, intent(inout
)::x
, y
8 !==============================================================================
10 !==============================================================================
11 !CHECK: !$omp sections
14 !CHECK: !$omp end sections
17 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionsConstruct
18 !PARSE-TREE: OmpBeginSectionsDirective
19 !PARSE-TREE-NOT: ExecutionPartConstruct
20 !PARSE-TREE: OmpEndSectionsDirective
22 !==============================================================================
23 ! single section, without `!$omp section`
24 !==============================================================================
25 !CHECK: !$omp sections
30 !CHECK: !$omp end sections
33 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionsConstruct
34 !PARSE-TREE: OmpBeginSectionsDirective
35 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionConstruct -> Block
37 !PARSE-TREE-NOT: ExecutionPartConstruct
38 !PARSE-TREE: OmpEndSectionsDirective
40 !==============================================================================
41 ! single section with `!$omp section`
42 !==============================================================================
43 !CHECK: !$omp sections
49 !CHECK: !$omp end sections
52 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionsConstruct
53 !PARSE-TREE: OmpBeginSectionsDirective
54 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionConstruct -> Block
56 !PARSE-TREE-NOT: ExecutionPartConstruct
57 !PARSE-TREE: OmpEndSectionsDirective
59 !==============================================================================
61 !==============================================================================
62 !CHECK: !$omp sections
76 !CHECK: !$omp end sections
79 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionsConstruct
80 !PARSE-TREE: OmpBeginSectionsDirective
81 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionConstruct -> Block
83 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionConstruct -> Block
85 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionConstruct -> Block
87 !PARSE-TREE-NOT: ExecutionPartConstruct
88 !PARSE-TREE: OmpEndSectionsDirective
90 !==============================================================================
91 ! multiple sections with clauses
92 !==============================================================================
93 !CHECK: !$omp sections PRIVATE(x) FIRSTPRIVATE(y)
94 !$omp sections PRIVATE(x) FIRSTPRIVATE(y)
103 !CHECK: !$omp section
107 !CHECK: !$omp end sections NOWAIT
108 !$omp end sections NOWAIT
110 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionsConstruct
111 !PARSE-TREE: OmpBeginSectionsDirective
112 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionConstruct -> Block
113 !PARSE-TREE: CallStmt
114 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionConstruct -> Block
115 !PARSE-TREE: CallStmt
116 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionConstruct -> Block
117 !PARSE-TREE: CallStmt
118 !PARSE-TREE-NOT: ExecutionPartConstruct
119 !PARSE-TREE: OmpEndSectionsDirective
121 END subroutine openmp_sections