2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / namelist_utf8.f90
blob6a9dde314ea5a454dc2cdf3913dd51329c2a1790
1 ! { dg-do run { xfail powerpc*-apple-darwin* } }
2 ! PR52539 UTF-8 support for namelist read and write
4 character(len=10, kind=4) :: str, str2
5 character(len=25, kind=4) :: str3
7 namelist /nml/ str
9 str = 4_'1a'//char (int (z'4F60'),4) &
10 //char (int (z'597D'), 4)//4_'b'
11 open(6, encoding='utf-8')
12 open(99, encoding='utf-8',form='formatted')
13 write(99, '(3a)') '&nml str = "', str, '" /'
14 write(99, '(a)') str
15 rewind(99)
17 str = 4_'XXXX'
18 str2 = 4_'YYYY'
19 read(99,nml=nml)
20 read(99, *) str2
21 if (str2 /= str) call abort
22 rewind(99)
24 read(99,'(A)') str3
25 if (str3 /= 4_'&nml str = "' // str // 4_'" /') call abort
26 read(99,*) str3
27 if (str3 /= str) call abort
29 close(99, status='delete')
30 end