brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 4c470b7 Raw
34 lines · plain
1! RUN: %flang_fc1 -emit-hlfir -fopenmp -o - %s 2>&1 | FileCheck %s2 3! Check that variables are not privatized twice when TASKGROUP is used.4 5!CHECK-LABEL: func.func @_QPsub() {6!CHECK:         omp.parallel private(@_QFsubEi_private_i32 %[[SUB_I:.*]]#0 -> %[[ARG:.*]] : !fir.ref<i32>)7!CHECK:           %[[ALLOCA:.*]] = fir.alloca i328!CHECK:           %[[PAR_I:.*]]:2 = hlfir.declare %[[ALLOCA]] {uniq_name = "_QFsubEi"}9!CHECK:           omp.master {10!CHECK:             omp.taskgroup {11!CHECK-NEXT:          omp.task private(@_QFsubEi_firstprivate_i32 %[[PAR_I]]#0 -> %[[TASK_I:.*]] : !fir.ref<i32>) {12!CHECK:                 %[[TASK_I_DECL:.*]]:2 = hlfir.declare %[[TASK_I]] {uniq_name = "_QFsubEi"}13!CHECK:               }14!CHECK:             }15!CHECK:           }16!CHECK:         }17 18subroutine sub()19  integer, dimension(10) :: a20  integer :: i21 22  !$omp parallel23    !$omp master24      do i=1,1025       !$omp taskgroup26         !$omp task shared(a)27           a(i) = 128         !$omp end task29       !$omp end taskgroup30      end do31    !$omp end master32  !$omp end parallel33end subroutine34