summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/string_2.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/string_2.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/string_2.f9012
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/string_2.f90 b/gcc/testsuite/gfortran.dg/string_2.f90
new file mode 100644
index 000000000..c94c4141b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/string_2.f90
@@ -0,0 +1,12 @@
+! { dg-do compile }
+!
+program main
+ implicit none
+ character(len=10) :: s
+
+ s = ''
+ print *, s(1:2_8**32_8+3_8) ! { dg-error "exceeds the string length" }
+ print *, s(2_8**32_8+3_8:2_8**32_8+4_8) ! { dg-error "exceeds the string length" }
+ print *, len(s(1:2_8**32_8+3_8)) ! { dg-error "exceeds the string length" }
+
+end program main