Debian Codegraph @

libgomp/testsuite/libgomp.fortran/non-rectangular-loop-5.f90

raw
1 ! { dg-do compile }
2 ! { dg-additional-options "-msse2" { target sse2_runtime } }
3 ! { dg-additional-options "-mavx" { target avx_runtime } }
4
5 ! PR fortran/107424 - original PR
6 ! PR fortran/110735 - PR to implement the feature below
7
8 ! Nonrectangular loop nests checks
9
10 integer :: step
11 step = -1
12 !$omp simd collapse(2)
13 do i = 1, 10
14 do j = i, 10, step ! { dg-message "sorry, unimplemented: non-rectangular loop nest with non-constant step for 'j'" }
15 end do
16 end do
17
18 step = 3
19 !$omp do collapse(2) lastprivate(j) ! { dg-error "lastprivate variable 'j' is private in outer context" }
20 do i = 1, 10
21 do j = i, 10, step ! { dg-message "sorry, unimplemented: non-rectangular loop nest with non-constant step for 'j'" }
22 end do
23 end do
24 if (i /= 11) stop 1
25
26 step = -5
27 !$omp simd collapse(2) lastprivate(j)
28 do i = 1, 10
29 do j = i, 10, step ! { dg-message "sorry, unimplemented: non-rectangular loop nest with non-constant step for 'j'" }
30 end do
31 end do
32 if (i /= 11) stop 1
33
34 step = -5
35 !$omp simd collapse(2)
36 do i = 1, 10, step ! { dg-message "sorry, unimplemented: non-rectangular loop nest with non-constant step for 'i'" }
37 do j = i, i ! { dg-note "Used here" }
38 end do
39 end do
40 if (i /= 11) stop 1
41
42 end