| 1 |
! { dg-do run } |
| 2 |
! Check for correct ordering of character variables with CONVERT |
| 3 |
|
| 4 |
program main |
| 5 |
implicit none |
| 6 |
integer, parameter :: two_swap = 2**25 |
| 7 |
integer(kind=4) i,j |
| 8 |
character(len=2) :: c,d |
| 9 |
open(20,file="convert.dat",form="unformatted",convert="swap") ! { dg-warning "CONVERT" } |
| 10 |
write (20) "ab" |
| 11 |
close (20) |
| 12 |
open(20,file="convert.dat",form="unformatted",access="stream") |
| 13 |
read(20) i,c,j |
| 14 |
if (i .ne. two_swap .or. j .ne. two_swap .or. c .ne. "ab") STOP 1 |
| 15 |
close (20) |
| 16 |
open(20,file="convert.dat",form="unformatted",convert="swap") ! { dg-warning "CONVERT" } |
| 17 |
read (20) d |
| 18 |
close (20,status="delete") |
| 19 |
if (d .ne. "ab") STOP 2 |
| 20 |
end program main |