gcc/testsuite/gfortran.fortran-torture/execute/read_null_string.f90
raw| 1 | ! pr 16080, segfault on reading an empty string |
| 2 | implicit none |
| 3 | integer t |
| 4 | character*20 temp_name |
| 5 | character*2 quotes |
| 6 | open(unit=7,status='SCRATCH') |
| 7 | quotes = '""""' ! "" in the file |
| 8 | write(7,*)1 |
| 9 | write(7,'(A)')quotes |
| 10 | temp_name = 'hello' ! make sure the read overwrites it |
| 11 | rewind(7) |
| 12 | read(7, *) t |
| 13 | read(7, *) temp_name |
| 14 | if (temp_name.ne.'') STOP 1 |
| 15 | end |