aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.fortran/non-rectangular-loop-5.f90
blob: 0e251f263c887f200b32b64f2618c8381596c236 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
! { dg-do compile }
! { dg-additional-options "-msse2" { target sse2_runtime } }
! { dg-additional-options "-mavx" { target avx_runtime } }

! PR fortran/107424 - original PR
! PR fortran/110735 - PR to implement the feature below

! Nonrectangular loop nests checks

integer :: step
step = -1
!$omp simd collapse(2)
do i = 1, 10
  do j = i, 10, step  ! { dg-message "sorry, unimplemented: non-rectangular loop nest with non-constant step for 'j'" }
  end do
end do

step = 3
!$omp do collapse(2) lastprivate(j)  ! { dg-error "lastprivate variable 'j' is private in outer context" }
do i = 1, 10
  do j = i, 10, step  ! { dg-message "sorry, unimplemented: non-rectangular loop nest with non-constant step for 'j'" }
  end do
end do
if (i /= 11) stop 1

step = -5
!$omp simd collapse(2) lastprivate(j)
do i = 1, 10
  do j = i, 10, step  ! { dg-message "sorry, unimplemented: non-rectangular loop nest with non-constant step for 'j'" }
  end do
end do
if (i /= 11) stop 1

step = -5
!$omp simd collapse(2)
do i = 1, 10, step  ! { dg-message "sorry, unimplemented: non-rectangular loop nest with non-constant step for 'i'" }
  do j = i, i       ! { dg-note "Used here" }
  end do
end do
if (i /= 11) stop 1

end