RISC-V: Refactor Dynamic LMUL codes
[official-gcc.git] / gcc / testsuite / gfortran.dg / widechar_IO_3.f90
blob615ffd68d5373352ae0bfeaee400e591a369c5d1
1 ! { dg-do run { target fd_truncate } }
2 ! Wide character I/O test 3, unformatted arrays
3 ! Test case developed by Jerry DeLisle <jvdelisle@gcc.gnu.org>
4 program test1
5 integer, parameter :: k4 = 4
6 character(len=10,kind=4) :: wide
7 character(len=10,kind=4), dimension(5,7) :: widearray
8 wide = k4_"abcdefg"
9 widearray = k4_"1234abcd"
10 open(10, form="unformatted", status="scratch")
11 write(10) wide
12 rewind(10)
13 wide = "wrong"
14 read(10) wide
15 if (wide /= k4_"abcdefg") STOP 1
16 rewind(10)
17 write(10) widearray(2:4,3:7)
18 widearray(2:4,3:7)=""
19 rewind(10)
20 read(10) widearray(2:4,3:7)
21 close(10)
22 if (any(widearray.ne.k4_"1234abcd")) STOP 2
23 end program test1