aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/where_3.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/where_3.f90')
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/where_3.f9021
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/where_3.f90 b/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/where_3.f90
new file mode 100644
index 000000000..a9f7ef7bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/where_3.f90
@@ -0,0 +1,21 @@
+! Program to test WHERE on unknown size arrays
+program where_3
+ integer A(10, 2)
+
+ A = 0
+ call sub(A)
+
+contains
+
+subroutine sub(B)
+ integer, dimension(:, :) :: B
+
+ B(1:5, 1) = 0
+ B(6:10, 1) = 5
+ where (B(:,1)>0)
+ B(:,1) = B(:,1) + 10
+ endwhere
+ if (any (B .ne. reshape ((/0, 0, 0, 0, 0, 15, 15, 15, 15, 15, &
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0/), (/10, 2/)))) call abort
+end subroutine
+end program