Skip to content

Commit 1d2f9ac

Browse files
committed
[flang][OpenMP] Add lowering test: lastprivate on DO is scoped to wsloop (guards #157035)
1 parent d71df82 commit 1d2f9ac

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
! RUN: %flang_fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s
2+
3+
program p
4+
type y3; integer, allocatable :: x; end type
5+
type(y3) :: v
6+
integer :: s, n, i
7+
s = 1; n = 10
8+
allocate(v%x); v%x = 0
9+
!$omp parallel
10+
if (.not. allocated(v%x)) print *, '101', allocated(v%x)
11+
!$omp do schedule(dynamic) lastprivate(v)
12+
do i = s, n
13+
v%x = i
14+
end do
15+
!$omp end do
16+
!$omp end parallel
17+
end program
18+
19+
! CHECK: omp.parallel {
20+
! CHECK-NOT: private(
21+
! CHECK: omp.wsloop
22+
! CHECK-SAME: private(

0 commit comments

Comments
 (0)