diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/array_initializer_3.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/array_initializer_3.f90 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/array_initializer_3.f90 b/gcc/testsuite/gfortran.dg/array_initializer_3.f90 new file mode 100644 index 000000000..c420e95dc --- /dev/null +++ b/gcc/testsuite/gfortran.dg/array_initializer_3.f90 @@ -0,0 +1,14 @@ +! { dg-do compile } +! Tests the fix for PR28923 in which initializer array constructors with +! a missing initial array index and negative stride would be incorrectly +! interpreted. +! +! Contributed by Dominique d'Humieres <dominiq@lps.ens.fr> +! +real, dimension(3,3), parameter :: a=reshape ((/(i, i = 1,9)/),(/3,3/)) +real, dimension(2,3) :: b=a(:2:-1,:) ! { dg-error "Different shape for array assignment" } +real, dimension(2,3) :: c=a(3:2:-1,:) +print *, b +print *, c +end + |