Fix compilation failure with C++98 compilers
[official-gcc.git] / gcc / testsuite / gfortran.dg / intrinsic_product_1.f90
blob09890a006bf4734b24d66aa2a302e6918adf9b5d
1 ! { dg-do run }
2 ! PR 35993 - some intrinsics with mask = .false. didn't set
3 ! the whole return array for multi-dimensional arrays.
4 ! Test case adapted from Dick Hendrickson.
6 program try
8 call ga3019( 1, 2, 3, 4)
9 end program
11 SUBROUTINE GA3019(nf1,nf2,nf3,nf4)
12 INTEGER IDA(NF2,NF3)
13 INTEGER IDA1(NF2,NF4,NF3)
15 ida1 = 3
17 ida = -3
18 IDA(NF1:NF2,NF1:NF3) = PRODUCT(IDA1,NF2, NF1 .LT. 0) !fails
19 if (any(ida /= 1)) STOP 1
21 ida = -3
22 IDA(NF1:NF2,NF1:NF3) = PRODUCT(IDA1,NF2, .false. ) !fails
23 if (any(ida /= 1)) STOP 2
25 ida = -3
26 IDA(NF1:NF2,NF1:NF3) = PRODUCT(IDA1,NF2, ida1 .eq. 137 ) !works
27 if (any(ida /= 1)) STOP 3
29 END SUBROUTINE