gcc/testsuite/gfortran.dg/dec_io_5.f90
raw| 1 | ! { dg-do run } |
| 2 | ! { dg-options "-fdec" } |
| 3 | ! { dg-shouldfail "ACTION conflicts with READONLY" } |
| 4 | ! |
| 5 | ! Test that we get a run-time error for opening a READONLY file with |
| 6 | ! ACTION='WRITE'. |
| 7 | ! |
| 8 | |
| 9 | implicit none |
| 10 | |
| 11 | integer :: fd = 8 |
| 12 | character(*), parameter :: f = "dec_io_5.txt" |
| 13 | character(10), volatile :: c |
| 14 | c = 'write' |
| 15 | |
| 16 | open(unit=fd,file=f,action=c,readonly) |
| 17 | |
| 18 | end |
| 19 | ! { dg-output "ACTION conflicts with READONLY" } |