gcc/testsuite/gfortran.dg/associate_58.f90
raw| 1 | ! { dg-do compile } |
| 2 | ! |
| 3 | ! PR fortran/104570 |
| 4 | ! The following used to cause an ICE because the string length |
| 5 | ! evaluation of the (y) expression was not prepared to handle |
| 6 | ! a non-scalar expression. |
| 7 | |
| 8 | program p |
| 9 | character(:), allocatable :: x(:) |
| 10 | x = ['abc'] |
| 11 | call s |
| 12 | contains |
| 13 | subroutine s |
| 14 | associate (y => x) |
| 15 | associate (z => (y)) |
| 16 | print *, z |
| 17 | end associate |
| 18 | end associate |
| 19 | end |
| 20 | end |
| 21 |