comparison gcc/testsuite/gfortran.dg/convert_2.f90 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
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") call abort
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") call abort
20 end program main