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. 5! 6! Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> 7! 8 integer,parameter :: i(1,1) = 0, j(2) = 42 9 10 if (any (maxloc(j+j,mask=(j==2)) .ne. 0)) STOP 1 11 if (size(j+j) .ne. 2) STOP 2 12 if (minval(j+j) .ne. 84) STOP 3 13 if (minval(j,mask=(j==2)) .ne. huge (j)) STOP 4 14 if (maxval(j+j) .ne. 84) STOP 5 15 if (maxval(j,mask=(j==2)) .ne. -huge (j)-1) STOP 6 16 if (sum(j,mask=j==2) .ne. 0) STOP 7 17 if (sum(j+j) .ne. 168) STOP 8 18 if (product(j+j) .ne. 7056) STOP 9 19 if (any(ubound(j+j) .ne. 2)) STOP 10 20 if (any(lbound(j+j) .ne. 1)) STOP 11 21 if (dot_product(j+j,j) .ne. 7056) STOP 12 22 if (dot_product(j,j+j) .ne. 7056) STOP 13 23 if (count(i==1) .ne. 0) STOP 14 24 if (any(i==1)) STOP 15 25 if (all(i==1)) STOP 16 26 end 27