3 ! Test the fix for PR34875, in which the read with a vector index
6 ! Contributed by Dick Hendrickson <dick.hendrickson@gmail.com>
12 ! Scramble the vector up a bit to make the test more interesting
13 integer, dimension(10) :: nfv1
= (/9,2,1,3,5,4,6,8,7,10/)
14 ! Set qda1 in ordinal order
19 FORM
= 'UNFORMATTED', &
22 REWIND (47, IOSTAT
= ISTAT
)
23 IF (ISTAT
.NE
. 0) call abort ()
26 WRITE (47,IOSTAT
= ISTAT
) QDA1
27 IF (ISTAT
.NE
. 0) call abort ()
29 REWIND (47, IOSTAT
= ISTAT
)
30 IF (ISTAT
.NE
. 0) call abort ()
31 ! Do the vector index read that used to fail
32 READ (47,IOSTAT
= ISTAT
) QDA(NFV1
)
33 IF (ISTAT
.NE
. 0) call abort ()
34 ! Unscramble qda using the vector index
35 IF (ANY (QDA(nfv1
) .ne
. QDA1
) ) print *, qda
, qda1
37 REWIND (47, IOSTAT
= ISTAT
)
38 IF (ISTAT
.NE
. 0) call abort ()
40 ! Do the subscript read that was OK
41 READ (47,IOSTAT
= ISTAT
) QDA(1:10)
42 IF (ISTAT
.NE
. 0) call abort ()
43 IF (ANY (QDA
.ne
. QDA1
) ) call abort ()