2014-07-12 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / parameter_array_init_2.f90
blobbf238e5ee32a4439fd8789a948a690b61f64c6b7
1 ! { dg-do run }
2 ! { dg-options "-std=gnu" } ! suppress the warning about line 15
3 ! Thrashes the fix for PR29400, where the scalar initializers
4 ! were not expanded to arrays with the appropriate shape.
6 ! Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
8 integer,parameter :: i(1,1) = 0, j(2) = 42
10 if (any (maxloc(j+j,mask=(j==2)) .ne. 0)) call abort ()
11 if (size(j+j) .ne. 2) call abort ()
12 if (minval(j+j) .ne. 84) call abort ()
13 if (minval(j,mask=(j==2)) .ne. huge (j)) call abort ()
14 if (maxval(j+j) .ne. 84) call abort ()
15 if (maxval(j,mask=(j==2)) .ne. -huge (j)-1) call abort ()
16 if (sum(j,mask=j==2) .ne. 0) call abort ()
17 if (sum(j+j) .ne. 168) call abort ()
18 if (product(j+j) .ne. 7056) call abort ()
19 if (any(ubound(j+j) .ne. 2)) call abort ()
20 if (any(lbound(j+j) .ne. 1)) call abort ()
21 if (dot_product(j+j,j) .ne. 7056) call abort ()
22 if (dot_product(j,j+j) .ne. 7056) call abort ()
23 if (count(i==1) .ne. 0) call abort ()
24 if (any(i==1)) call abort ()
25 if (all(i==1)) call abort ()
26 end