2 ! PR37077 Implement Internal Unit I/O for character KIND=4
3 ! Test case prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org>
6 integer, parameter :: k = 4
7 character(kind=4,len=80) :: widestring, str_char4
8 character(kind=1,len=80) :: skinnystring
11 character(9) :: str_default
13 widestring = k_"12345 2.54360 hijklmnop qwertyuiopasdfg"
14 skinnystring = "12345 2.54360 hijklmnop qwertyuiopasdfg"
17 str_default = "xxxxxxxxx"
19 read(widestring,'(i5,1x,f7.5,1x,a9,1x,a15)') i, x, str_default, str_char4
20 if (i /= 12345 .or. (x - 2.5436001) > epsilon(x) .or. &
21 str_default /= "hijklmnop" .or. str_char4 /= k_"qwertyuiopasdfg")&
25 str_default = "xxxxxxxxx"
27 read(widestring,'(2x,i4,tl3,1x,f7.5,1x,a9,1x,a15)')i, x, str_default,&
29 if (i /= 345 .or. (x - 52.542999) > epsilon(x) .or. &
30 str_default /= "0 hijklmn" .or. str_char4 /= k_"p qwertyuiopasd")&
32 read(skinnystring,'(2x,i4,tl3,1x,f7.5,1x,a9,1x,a15)')i, x, str_default,&
34 if (i /= 345 .or. (x - 52.542999) > epsilon(x) .or. &
35 str_default /= "0 hijklmn" .or. str_char4 /= k_"p qwertyuiopasd")&
37 write(widestring,'(2x,i4,tl3,1x,f10.5,1x,a9,1x,a15)')i, x, str_default,&
39 if (widestring .ne. k_" 3 52.54300 0 hijklmn p qwertyuiopasd") call abort
40 write(skinnystring,'(2x,i4,tl3,1x,f10.5,1x,a9,1x,a15)')i, x, str_default,&
42 if (skinnystring .ne. " 3 52.54300 0 hijklmn p qwertyuiopasd") call abort
43 write(widestring,*)"test",i, x, str_default,&
46 k_" test 345 52.5429993 0 hijklmnp qwertyuiopasd") call abort
47 end program char4_iunit_2