aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/testsuite/gfortran.dg/where_4.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.8/gcc/testsuite/gfortran.dg/where_4.f90')
-rw-r--r--gcc-4.8/gcc/testsuite/gfortran.dg/where_4.f9018
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/testsuite/gfortran.dg/where_4.f90 b/gcc-4.8/gcc/testsuite/gfortran.dg/where_4.f90
new file mode 100644
index 000000000..1ff2e4ca3
--- /dev/null
+++ b/gcc-4.8/gcc/testsuite/gfortran.dg/where_4.f90
@@ -0,0 +1,18 @@
+! { dg-do compile }
+! PR 60522 - this used to ICE.
+! Original test case Roger Ferrer Ibanez
+subroutine foo(a, b)
+ implicit none
+ integer, dimension(:), intent(inout) :: a
+ integer, dimension(:), intent(in) :: b
+
+ where (b(:) > 0)
+ where (b(:) > 100)
+ a(lbound(a, 1):ubound(a, 1)) = b(lbound(b, 1):ubound(b, 1)) * b(lbound(b, 1):ubound(b, 1)) - 100
+ elsewhere
+ a(lbound(a, 1):ubound(a, 1)) = b(lbound(b, 1):ubound(b, 1)) * b(lbound(b, 1):ubound(b, 1))
+ end where
+ elsewhere
+ a(lbound(a, 1):ubound(a, 1)) = - b(lbound(b, 1):ubound(b, 1)) * b(lbound(b, 1):ubound(b, 1))
+ end where
+end subroutine foo