summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/shape_4.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/shape_4.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/shape_4.f9012
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/shape_4.f90 b/gcc/testsuite/gfortran.dg/shape_4.f90
new file mode 100644
index 000000000..9275b11b8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/shape_4.f90
@@ -0,0 +1,12 @@
+! PR 35001 - we need to return 0 for the shapes of
+! negative extents. Test case adapted from Tobias Burnus.
+program main
+ implicit none
+ integer :: i,j, a(10,10),res(2)
+ j = 1
+ i = 10
+ res = shape(a(1:1,i:j:1))
+ if (res(1) /=1 .or. res(2) /= 0) call abort
+ res = shape(a(1:1,j:i:-1))
+ if (res(1) /=1 .or. res(2) /= 0) call abort
+end program main