PR 78534 Change character length from int to size_t
[official-gcc.git] / gcc / testsuite / gfortran.dg / string_3_lp64.f90
blob162561fad00b1778e05c63a3b6eaad751f6c0998
1 ! { dg-do compile }
2 ! { dg-require-effective-target lp64 }
3 ! { dg-require-effective-target fortran_integer_16 }
4 subroutine foo(i)
5 implicit none
6 integer, intent(in) :: i
7 character(len=i) :: s
9 s = ''
10 print *, s(1:2_16**64_16+3_16) ! { dg-error "too large" }
11 print *, s(2_16**64_16+3_16:2_16**64_16+4_16) ! { dg-error "too large" }
12 print *, len(s(1:2_16**64_16+3_16)) ! { dg-error "too large" }
13 print *, len(s(2_16**64_16+3_16:2_16**64_16+4_16)) ! { dg-error "too large" }
15 print *, s(2_16**64_16+3_16:1)
16 print *, s(2_16**64_16+4_16:2_16**64_16+3_16)
17 print *, len(s(2_16**64_16+3_16:1))
18 print *, len(s(2_16**64_16+4_16:2_16**64_16+3_16))
20 end subroutine