Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gfortran.dg / intrinsic_spread_3.f90
blob1dd2feb1d2198d17b1cf50c2b9d46911d6e1a2e0
1 ! { dg-do run }
2 ! { dg-require-effective-target fortran_large_int }
4 program foo
5 implicit none
6 integer,parameter :: k = selected_int_kind (range (0_8) + 1)
8 integer(kind=k), dimension(10) :: i_k
9 integer(kind=k), dimension (2, 3) :: a_k
10 integer(kind=k), dimension (2, 2, 3) :: b_k
11 character (len=200) line1, line2, line3
13 a_k = reshape ((/1_k, 2_k, 3_k, 4_k, 5_k, 6_k/), (/2, 3/))
14 b_k = spread (a_k, 1, 2)
15 if (any (b_k .ne. reshape ((/1_k, 1_k, 2_k, 2_k, 3_k, 3_k, 4_k, 4_k, 5_k, 5_k, 6_k, 6_k/), &
16 (/2, 2, 3/)))) &
17 call abort
18 line1 = ' '
19 write(line1, 9000) b_k
20 line2 = ' '
21 write(line2, 9000) spread (a_k, 1, 2)
22 if (line1 /= line2) call abort
23 line3 = ' '
24 write(line3, 9000) spread (a_k, 1, 2) + 0_k
25 if (line1 /= line3) call abort
26 i_k = spread(1_k,1,10)
27 if (any(i_k /= 1_k)) call abort
29 9000 format(12I3)
31 end program