* cfgloopmanip.c (duplicate_loop_to_header_edge): Cleanup profile
[official-gcc.git] / gcc / testsuite / gfortran.dg / implied_do_io_3.f90
blob6ac89ac8d2c90e2fb73f9aecc219227d34323642
1 ! { dg-do run }
2 ! { dg-options "-ffrontend-optimize" }
3 ! PR 80988 - implied do loops with diagonal elements
4 ! were not written correctly
5 program main
6 implicit none
7 integer :: i,j,k
8 integer, dimension(3,3) :: a
9 integer, dimension(3,3,3) :: b
10 character(len=40) :: line
11 a = reshape([(((i*10+j),i=1,3),j=1,3)], shape(a))
12 i = 2147483548
13 write (unit=line,fmt='(10I3)') (a(i,i),i=1,3)
14 if (line /= ' 11 22 33') call abort
15 write (unit=line,fmt='(10I3)') (a(i+1,i+1),i=1,2)
16 if (line /= ' 22 33') call abort
17 do k=1,3
18 do j=1,3
19 do i=1,3
20 b(i,j,k) = i*100 + j*10 + k
21 end do
22 end do
23 end do
24 i = -2147483548
25 write (unit=line,fmt='(10I4)') ((b(i,j,i),i=1,3),j=1,3)
26 if (line /= ' 111 212 313 121 222 323 131 232 333') call abort
27 end program main