| 1 |
! { dg-do compile } |
| 2 |
! { dg-additional-options "-fcheck=bounds -Wno-analyzer-malloc-leak" } |
| 3 |
! Copy of gfortran.dg/bounds_check_23.f90 |
| 4 |
! as a regression test for ICE with -fanalyzer (PR analyzer/108065) |
| 5 |
|
| 6 |
program test |
| 7 |
implicit none |
| 8 |
call sub('Lorem ipsum') |
| 9 |
contains |
| 10 |
subroutine sub( text ) |
| 11 |
character(len=*), intent(in) :: text |
| 12 |
character(len=1), allocatable :: c(:) |
| 13 |
integer :: i |
| 14 |
c = [ ( text(i:i), i = 1, len(text) ) ] |
| 15 |
if (c(1) /= 'L') stop 1 |
| 16 |
end subroutine sub |
| 17 |
end program test |