| 1 |
! { dg-do run { xfail powerpc*-apple-darwin* } } |
| 2 |
! PR52539 UTF-8 support for namelist read and write |
| 3 |
|
| 4 |
character(len=10, kind=4) :: str, str2 |
| 5 |
character(len=25, kind=4) :: str3 |
| 6 |
|
| 7 |
namelist /nml/ str |
| 8 |
|
| 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) |
| 16 |
|
| 17 |
str = 4_'XXXX' |
| 18 |
str2 = 4_'YYYY' |
| 19 |
read(99,nml=nml) |
| 20 |
read(99, *) str2 |
| 21 |
if (str2 /= str) STOP 1 |
| 22 |
rewind(99) |
| 23 |
|
| 24 |
read(99,'(A)') str3 |
| 25 |
if (str3 /= 4_'&nml str = "' // str // 4_'" /') STOP 2 |
| 26 |
read(99,*) str3 |
| 27 |
if (str3 /= str) STOP 3 |
| 28 |
|
| 29 |
close(99, status='delete') |
| 30 |
end |