Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Lower / OpenMP / sections-pft.f90
blob7b20a87022c909db2228c15d009fcdf7a10677c7
1 ! RUN: %flang_fc1 -fdebug-pre-fir-tree -fopenmp %s | FileCheck %s
3 subroutine openmp_sections(x, y)
5 integer, intent(inout)::x, y
7 !==============================================================================
8 ! empty construct
9 !==============================================================================
10 !$omp sections
11 !$omp end sections
13 !CHECK: OpenMPConstruct
14 !CHECK: End OpenMPConstruct
16 !==============================================================================
17 ! single section, without `!$omp section`
18 !==============================================================================
19 !$omp sections
20 call F1()
21 !$omp end sections
23 !CHECK: OpenMPConstruct
24 !CHECK: OpenMPConstruct
25 !CHECK: CallStmt
26 !CHECK: End OpenMPConstruct
27 !CHECK: End OpenMPConstruct
29 !==============================================================================
30 ! single section with `!$omp section`
31 !==============================================================================
32 !$omp sections
33 !$omp section
34 call F1
35 !$omp end sections
37 !CHECK: OpenMPConstruct
38 !CHECK: OpenMPConstruct
39 !CHECK: CallStmt
40 !CHECK: End OpenMPConstruct
41 !CHECK: End OpenMPConstruct
43 !==============================================================================
44 ! multiple sections
45 !==============================================================================
46 !$omp sections
47 !$omp section
48 call F1
49 !$omp section
50 call F2
51 !$omp section
52 call F3
53 !$omp end sections
55 !CHECK: OpenMPConstruct
56 !CHECK: OpenMPConstruct
57 !CHECK: CallStmt
58 !CHECK: End OpenMPConstruct
59 !CHECK: OpenMPConstruct
60 !CHECK: CallStmt
61 !CHECK: End OpenMPConstruct
62 !CHECK: OpenMPConstruct
63 !CHECK: CallStmt
64 !CHECK: End OpenMPConstruct
65 !CHECK: End OpenMPConstruct
67 !==============================================================================
68 ! multiple sections with clauses
69 !==============================================================================
70 !$omp sections PRIVATE(x) FIRSTPRIVATE(y)
71 !$omp section
72 call F1
73 !$omp section
74 call F2
75 !$omp section
76 call F3
77 !$omp end sections NOWAIT
79 !CHECK: OpenMPConstruct
80 !CHECK: OpenMPConstruct
81 !CHECK: CallStmt
82 !CHECK: End OpenMPConstruct
83 !CHECK: OpenMPConstruct
84 !CHECK: CallStmt
85 !CHECK: End OpenMPConstruct
86 !CHECK: OpenMPConstruct
87 !CHECK: CallStmt
88 !CHECK: End OpenMPConstruct
89 !CHECK: End OpenMPConstruct
91 end subroutine openmp_sections