2 ! { dg-options "-fmax-subrecord-length=16" }
3 ! Test Intel record markers with 16-byte subrecord sizes.
4 ! PR 32770: Use explicit kinds for all integers and constants,
5 ! to avoid problems with -fdefault-integer-8 and -fdefault-real-8
8 integer(kind
=4), dimension(20) :: n
9 integer(kind
=4), dimension(30) :: m
13 ! Maximum subrecord length is 16 here, or the test will fail.
14 open (10, file
="f10.dat", &
15 form
="unformatted", access
="sequential")
16 n
= (/ (i
**2, i
=1, 20) /)
19 ! Read back the file, including record markers.
20 open (10, file
="f10.dat", form
="unformatted", access
="stream")
22 if (any(m
.ne
. (/ -16, 1, 4, 9, 16, 16, -16, 25, 36, 49, 64, &
23 -16, -16, 81, 100, 121, 144, -16, -16, 169, 196, 225, &
24 256, -16, 16, 289, 324, 361, 400, -16 /))) call abort
26 open (10, file
="f10.dat", form
="unformatted", &
30 if (any(m(1:5) .ne
. (/ 1, 4, 9, 16, 25 /))) call abort
31 if (any(m(6:30) .ne
. 42)) call abort
35 if (any(n(1:5) .ne
. (/ 1, 4, 9, 16, 25 /))) call abort
36 if (any(n(6:20) .ne
. 0)) call abort
37 ! Append to the end of the file
39 ! Test multiple backspace statements
43 if (k
.ne
. 1) call abort
45 if (abs(r
-3.14_4
) .gt
. 1e-7) call abort
46 close (10, status
="delete")