[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Parser / omp-sections.f90
blob3752cef62432938235ced6e87230a18665a67bd7
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 !==============================================================================
9 ! empty construct
10 !==============================================================================
11 !CHECK: !$omp sections
12 !$omp sections
13 !CHECK: !$omp section
14 !CHECK: !$omp end sections
15 !$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
26 !$omp sections
27 !CHECK: !$omp section
28 !CHECK: CALL
29 call F1()
30 !CHECK: !$omp end sections
31 !$omp end sections
33 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionsConstruct
34 !PARSE-TREE: OmpBeginSectionsDirective
35 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionConstruct -> Block
36 !PARSE-TREE: CallStmt
37 !PARSE-TREE-NOT: ExecutionPartConstruct
38 !PARSE-TREE: OmpEndSectionsDirective
40 !==============================================================================
41 ! single section with `!$omp section`
42 !==============================================================================
43 !CHECK: !$omp sections
44 !$omp sections
45 !CHECK: !$omp section
46 !$omp section
47 !CHECK: CALL F1
48 call F1
49 !CHECK: !$omp end sections
50 !$omp end sections
52 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionsConstruct
53 !PARSE-TREE: OmpBeginSectionsDirective
54 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionConstruct -> Block
55 !PARSE-TREE: CallStmt
56 !PARSE-TREE-NOT: ExecutionPartConstruct
57 !PARSE-TREE: OmpEndSectionsDirective
59 !==============================================================================
60 ! multiple sections
61 !==============================================================================
62 !CHECK: !$omp sections
63 !$omp sections
64 !CHECK: !$omp section
65 !$omp section
66 !CHECK: CALL F1
67 call F1
68 !CHECK: !$omp section
69 !$omp section
70 !CHECK: CALL F2
71 call F2
72 !CHECK: !$omp section
73 !$omp section
74 !CHECK: CALL F3
75 call F3
76 !CHECK: !$omp end sections
77 !$omp end sections
79 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionsConstruct
80 !PARSE-TREE: OmpBeginSectionsDirective
81 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionConstruct -> Block
82 !PARSE-TREE: CallStmt
83 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionConstruct -> Block
84 !PARSE-TREE: CallStmt
85 !PARSE-TREE: OpenMPConstruct -> OpenMPSectionConstruct -> Block
86 !PARSE-TREE: CallStmt
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)
95 !CHECK: !$omp section
96 !$omp section
97 !CHECK: CALL F1
98 call F1
99 !CHECK: !$omp section
100 !$omp section
101 !CHECK: CALL F2
102 call F2
103 !CHECK: !$omp section
104 !$omp section
105 !CHECK: CALL F3
106 call F3
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