gcc/testsuite/gfortran.dg/zero_length_2.f90
raw| 1 | ! { dg-do run } |
| 2 | character(len=1) :: s |
| 3 | character(len=0) :: s0 |
| 4 | s = " " |
| 5 | s0 = "" |
| 6 | call bar ("") |
| 7 | call bar (s) |
| 8 | call bar (s0) |
| 9 | call bar (trim(s)) |
| 10 | call bar (min(s0,s0)) |
| 11 | contains |
| 12 | subroutine bar (s) |
| 13 | character(len=*), optional :: s |
| 14 | if (.not. present (S)) STOP 1 |
| 15 | end subroutine bar |
| 16 | end |