58 lines · plain
1! REQUIRES: openmp_runtime2 3!RUN: %flang_fc1 -emit-hlfir %openmp_flags %s -o - | FileCheck %s4 5!===============================================================================6! Parallel sections construct7!===============================================================================8 9!CHECK: func @_QPomp_parallel_sections10subroutine omp_parallel_sections(x, y)11 integer, intent(inout) :: x, y12 !CHECK: omp.parallel {13 !CHECK: omp.sections {14 !$omp parallel sections15 !CHECK: omp.section {16 !$omp section17 !CHECK: fir.load18 !CHECK: arith.addi19 !CHECK: hlfir.assign20 x = x + 1221 !CHECK: omp.terminator22 !CHECK: omp.section {23 !$omp section24 !CHECK: fir.load25 !CHECK: arith.subi26 !CHECK: hlfir.assign27 y = y - 528 !CHECK: omp.terminator29 !CHECK: omp.terminator30 !CHECK: omp.terminator31 !$omp end parallel sections32end subroutine omp_parallel_sections33 34!===============================================================================35! Parallel sections construct with allocate clause36!===============================================================================37 38!CHECK: func @_QPomp_parallel_sections39subroutine omp_parallel_sections_allocate(x, y)40 use omp_lib41 integer, intent(inout) :: x, y42 !CHECK: omp.parallel43 !CHECK: %[[allocator_1:.*]] = arith.constant 4 : i6444 !CHECK: omp.sections allocate(%[[allocator_1]] : i64 -> %{{.*}} : !fir.ref<i32>) {45 !$omp parallel sections allocate(omp_high_bw_mem_alloc: x) private(x, y)46 !CHECK: omp.section {47 !$omp section48 x = x + 1249 !CHECK: omp.terminator50 !CHECK: omp.section {51 !$omp section52 y = y + 553 !CHECK: omp.terminator54 !CHECK: omp.terminator55 !CHECK: omp.terminator56 !$omp end parallel sections57end subroutine omp_parallel_sections_allocate58