1 ! { dg-do run { target fd_truncate } }
3 ! pr19314 inquire(..position=..) segfaults
4 ! test by Thomas.Koenig@online.de
5 ! bdavis9659@comcast.net
8 open(7,STATUS
='SCRATCH')
9 inquire(7,position
=chr
)
10 if (chr
.NE
.'ASIS') CALL ABORT
12 open(7,STATUS
='SCRATCH',ACCESS
='DIRECT',RECL
=100)
13 inquire(7,position
=chr
)
14 if (chr
.NE
.'UNDEFINED') CALL ABORT
16 open(7,STATUS
='SCRATCH',POSITION
='REWIND')
17 inquire(7,position
=chr
)
18 if (chr
.NE
.'REWIND') CALL ABORT
20 open(7,STATUS
='SCRATCH',POSITION
='ASIS')
21 inquire(7,position
=chr
)
22 if (chr
.NE
.'ASIS') CALL ABORT
24 open(7,STATUS
='SCRATCH',POSITION
='APPEND')
25 inquire(7,position
=chr
)
26 if (chr
.NE
.'APPEND') CALL ABORT
28 open(7,STATUS
='SCRATCH',POSITION
='REWIND')
29 write(7,*)'this is a record written to the file'
30 write(7,*)'this is another record'
32 inquire(7,position
=chr
)
33 if (chr
.NE
. 'UNSPECIFIED') CALL ABORT
35 inquire(7,position
=chr
)
36 if (chr
.NE
.'REWIND') CALL ABORT