gcc/testsuite/gfortran.dg/filename_null.f90
raw| 1 | ! { dg-do run } |
| 2 | ! PR 62768 |
| 3 | ! Filenames with embedded NULL characters are truncated, make sure |
| 4 | ! inquire reports the correct truncated name. |
| 5 | program filename_null |
| 6 | implicit none |
| 7 | character(len=15), parameter :: s = "hello" // achar(0) // "world", & |
| 8 | s2 = "hello" |
| 9 | character(len=15) :: r |
| 10 | logical :: l |
| 11 | open(10, file=s) |
| 12 | inquire(unit=10, name=r) |
| 13 | if (r /= s2) STOP 1 |
| 14 | inquire(file=s2, exist=l) |
| 15 | if (.not. l) STOP 2 |
| 16 | close(10, status="delete") |
| 17 | end program filename_null |