llvm-project/flang/test/Lower/OpenMP/target-teams-private.f90
Kareem Ergawy 2dc58e02cb
[flang][OpenMP] Add symbol table scopes for teams and parallel (#144015)
Adds symbol map scopes for standalone `teams` and `parallel` constructs.
This is required to properly bind the privatized symbols in both
constructs so that nested constructs can find them.

Resolves https://github.com/llvm/llvm-project/issues/116428.
2025-06-17 07:01:53 +02:00

21 lines
703 B
Fortran

! RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --enable-delayed-privatization \
! RUN: -o - %s 2>&1 | FileCheck %s
! RUN: bbc -emit-hlfir -fopenmp --enable-delayed-privatization -o - %s 2>&1 |\
! RUN: FileCheck %s
!===============================================================================
! `private` clause on `target teams`
!===============================================================================
subroutine target_teams_private()
integer, dimension(3) :: i
!$omp target teams private(i)
!$omp end target teams
end subroutine
! CHECK: omp.target {{.*}} {
! CHECK: omp.teams {
! CHECK: %{{.*}} = fir.alloca !fir.array<3xi32> {bindc_name = "i", {{.*}}}
! CHECK: }
! CHECK: }