PR c/29467
[official-gcc.git] / gcc / testsuite / gfortran.dg / string_3.f90
blob7daf8d31ae665285594f99314ce182f0aaf664fe
1 ! { dg-do compile }
3 subroutine foo(i)
4 implicit none
5 integer, intent(in) :: i
6 character(len=i) :: s
8 s = ''
9 print *, s(1:2_8**32_8+3_8) ! { dg-error "too large" }
10 print *, s(2_8**32_8+3_8:2_8**32_8+4_8) ! { dg-error "too large" }
11 print *, len(s(1:2_8**32_8+3_8)) ! { dg-error "too large" }
12 print *, len(s(2_8**32_8+3_8:2_8**32_8+4_8)) ! { dg-error "too large" }
14 print *, s(2_8**32_8+3_8:1)
15 print *, s(2_8**32_8+4_8:2_8**32_8+3_8)
16 print *, len(s(2_8**32_8+3_8:1))
17 print *, len(s(2_8**32_8+4_8:2_8**32_8+3_8))
19 end subroutine