modula2: Simplify REAL/LONGREAL/SHORTREAL node creation.
[official-gcc.git] / gcc / testsuite / gfortran.dg / do_subscript_5.f90
blob54a4f1ba51ac6bb05aa97638e3f312ad5f039be4
1 ! { dg-do compile }
2 ! { dg-additional-options "-Wdo-subscript" }
3 ! PR 90563 - this used to be rejected, wrongly
4 ! Original test case by Tobias Neumann
5 program test
6 implicit none
7 integer, parameter :: swap(4) = [2,1,3,4]
8 real :: p(20)
9 integer :: j
11 p = 0.0
13 ! The following warnings are actually bogus, but we are not yet
14 ! clever enough to suppress them.
15 do j=1,6 ! { dg-warning "out of bounds" }
16 if (j<5) then
17 p(j) = p(swap(j)) ! { dg-warning "out of bounds" }
18 endif
19 enddo
20 end program