http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52539

--- Comment #18 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
(In reply to Tobias Burnus from comment #15)
> (In reply to Andreas Schwab from comment #14)
> > Run it.
> 
> First, Jerry, I think you really should also compare the results against the
> original string.
> 
> Secondly, with the modification, I get for the original string, str and str2
> (and 'open(6, encoding="UTF-8")'):
>  1a你好b                5
>  1a你好b                5
>  愱你好b                5
> 
> Thus, the namelist read is fine - but the list-directed read is not.

Here on x86_64 I am testing against the original string.
Breakpoint 1, MAIN__ () at test.f90:21
21    if (str2 /= str) call abort
(gdb) p str
$1 = 4_'a你好b      '
(gdb) p str2
$2 = 4_'a你好b      '
(gdb) n
22    rewind(99)
(gdb) n
24    read(99,'(A)') str3
(gdb) n
25    if (str3 /= 4_'&nml str = "' // str // 4_'" /') call abort
(gdb) p str3
$3 = 4_'&nml str = "a你好b      " /'
(gdb) n
26    read(99,*) str3
(gdb) n
27    if (str3 /= str) call abort
(gdb) p str3
$4 = 4_'a你好b', ' ' <repeats 21 times>

At line 26 is the list-directed read and line 27 is the check against the
original string.

The test case is namelist_utf8.f90.  Can someone show me the above results for
other endian.  If its aborting just do s/call abort/print *, "Fails"/

Thanks in advance.

Reply via email to