summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_spread.f90
blob: 8a89b2d731a67c127817a5b96faf4b79f04a9463 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
program foo
   integer, dimension (2, 3) :: a
   integer, dimension (2, 2, 3) :: b
   character (len=80) line1, line2, line3

   a = reshape ((/1, 2, 3, 4, 5, 6/), (/2, 3/))
   b = spread (a, 1, 2)
   if (any (b .ne. reshape ((/1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6/), &
                            (/2, 2, 3/)))) &
      call abort
   write(line1, 9000) b
   write(line2, 9000) spread (a, 1, 2)
   if (line1 /= line2) call abort
   write(line3, 9000) spread (a, 1, 2) + 0
   if (line1 /= line3) call abort
9000 format(12I3)
end program