1 ! { dg-do run { target fd_truncate } }
2 ! { dg-options "-std=legacy" }
4 ! pr19314 inquire(..position=..) segfaults
5 ! test by Thomas.Koenig@online.de
6 ! bdavis9659@comcast.net
9 open(7,STATUS
='SCRATCH')
10 inquire(7,position
=chr
)
11 if (chr
.NE
.'ASIS') CALL ABORT
13 open(7,STATUS
='SCRATCH',ACCESS
='DIRECT',RECL
=100)
14 inquire(7,position
=chr
)
15 if (chr
.NE
.'UNDEFINED') CALL ABORT
17 open(7,STATUS
='SCRATCH',POSITION
='REWIND')
18 inquire(7,position
=chr
)
19 if (chr
.NE
.'REWIND') CALL ABORT
21 open(7,STATUS
='SCRATCH',POSITION
='ASIS')
22 inquire(7,position
=chr
)
23 if (chr
.NE
.'ASIS') CALL ABORT
25 open(7,STATUS
='SCRATCH',POSITION
='APPEND')
26 inquire(7,position
=chr
)
27 if (chr
.NE
.'APPEND') CALL ABORT
29 open(7,STATUS
='SCRATCH',POSITION
='REWIND')
30 write(7,*)'this is a record written to the file'
31 write(7,*)'this is another record'
33 inquire(7,position
=chr
)
34 if (chr
.NE
.'ASIS') CALL ABORT
36 inquire(7,position
=chr
)
37 if (chr
.NE
.'REWIND') CALL ABORT