summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr19928-1.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/pr19928-1.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/pr19928-1.f9011
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/pr19928-1.f90 b/gcc/testsuite/gfortran.dg/pr19928-1.f90
new file mode 100644
index 000000000..a8b04d8e5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr19928-1.f90
@@ -0,0 +1,11 @@
+! PR 19928. Check the use of constant substring indexes in a
+! scalarization loop.
+! { dg-do run }
+program main
+ implicit none
+ character (len = 5), dimension (2) :: a
+ character (len = 3), dimension (2) :: b
+ a = (/ 'abcde', 'ghijk' /)
+ b = a(:)(2:4)
+ if (b(1) .ne. 'bcd' .or. b(2) .ne. 'hij') call abort
+end program main