gcc/testsuite/gfortran.dg/substr_10.f90
raw| 1 | ! { dg-do compile } |
| 2 | ! PR93340 - test error handling of substring simplification |
| 3 | |
| 4 | subroutine p |
| 5 | integer,parameter :: k = len ('a'(:0)) |
| 6 | integer,parameter :: m = len ('a'(0:)) ! { dg-error "Substring start index" } |
| 7 | call foo ('bcd'(-8:-9)) |
| 8 | call foo ('bcd'(-9:-8)) ! { dg-error "Substring start index" } |
| 9 | call foo ('bcd'(:12)) ! { dg-error "Substring end index" } |
| 10 | call foo ('bcd'(-12:)) ! { dg-error "Substring start index" } |
| 11 | end |