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
\r
10 if (any (maxloc(j+j,mask=(j==2)) .ne. 0)) call abort ()
\r
11 if (size(j+j) .ne. 2) call abort ()
\r
12 if (minval(j+j) .ne. 84) call abort ()
\r
13 if (minval(j,mask=(j==2)) .ne. huge (j)) call abort ()
\r
14 if (maxval(j+j) .ne. 84) call abort ()
\r
15 if (maxval(j,mask=(j==2)) .ne. -huge (j)-1) call abort ()
\r
16 if (sum(j,mask=j==2) .ne. 0) call abort ()
\r
17 if (sum(j+j) .ne. 168) call abort ()
\r
18 if (product(j+j) .ne. 7056) call abort ()
\r
19 if (any(ubound(j+j) .ne. 2)) call abort ()
\r
20 if (any(lbound(j+j) .ne. 1)) call abort ()
\r
21 if (dot_product(j+j,j) .ne. 7056) call abort ()
\r
22 if (dot_product(j,j+j) .ne. 7056) call abort ()
\r
23 if (count(i==1) .ne. 0) call abort ()
\r
24 if (any(i==1)) call abort ()
\r
25 if (all(i==1)) call abort ()
\r