| 1 |
! { dg-do run } |
| 2 |
! |
| 3 |
! Test the fix for PR99125, where the array reference in the print |
| 4 |
! statement caused an ICE because the gimplifier complained about '0' |
| 5 |
! being used as an lvalue. |
| 6 |
! |
| 7 |
! Contributed by Gerhard Steinmetz <[email protected]> |
| 8 |
! |
| 9 |
program p |
| 10 |
type t |
| 11 |
character(:), allocatable :: a(:) |
| 12 |
end type |
| 13 |
type(t) :: x |
| 14 |
character(8) :: c(3) = ['12 45 78','23 56 89','34 67 90'] |
| 15 |
x%a = c |
| 16 |
if (any (x%a(2:3) .ne. ['23 56 89','34 67 90'])) stop 1 |
| 17 |
if (any (x%a(2:3)(4:5) .ne. ['56','67'])) stop 2 ! Bizarrely this worked. |
| 18 |
end |