aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/zero_sized_5.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/zero_sized_5.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/zero_sized_5.f9015
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/zero_sized_5.f90 b/gcc/testsuite/gfortran.dg/zero_sized_5.f90
new file mode 100644
index 00000000000..30ca8bf8199
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/zero_sized_5.f90
@@ -0,0 +1,15 @@
+! { dg-do run }
+! These used to segfault.
+program main
+ real, dimension(1,0) :: a, b, c
+ integer, dimension(0) :: j
+ a = 0
+ c = 0
+ b = cshift (a,1)
+ b = cshift (a,j)
+ b = eoshift (a,1)
+ b = eoshift (a,(/1/))
+ b = eoshift (a,1,boundary=c(1,:))
+ b = eoshift (a, j, boundary=c(1,:))
+
+end program main