On Mon, Apr 14, 2025 at 8:53 AM Tomasz Kamiński <tkami...@redhat.com> wrote:
> This changes the `dg-options` line so UTF-32 with byte order native to the > machine is used as wide encoding, avoiding. > > We still do not handle mismatch in the byte order of the Unicode encodings > (UTF32-BE on little-endian machines). This would require larger changes, > as for example `unicode-data.h` tables are encoded with native byte order. > > libstdc++-v3/ChangeLog: > > * testsuite/std/format/debug.cc: Updated dg-options. > * testsuite/std/format/debug_nonunicode.cc: Updated dg-options. > --- > Tested on x86_64-linux, wasn't able to confirm fix on SPARC/Solaris, as I > am > unable to login into machine. > This fixes solaris-sparc issue, as confirmed here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119725#c3 OK for trunk? > > libstdc++-v3/testsuite/std/format/debug.cc | 3 ++- > libstdc++-v3/testsuite/std/format/debug_nonunicode.cc | 2 +- > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/libstdc++-v3/testsuite/std/format/debug.cc > b/libstdc++-v3/testsuite/std/format/debug.cc > index 07cd1e0e349..71bb7f4a0fe 100644 > --- a/libstdc++-v3/testsuite/std/format/debug.cc > +++ b/libstdc++-v3/testsuite/std/format/debug.cc > @@ -1,4 +1,5 @@ > -// { dg-options "-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32LE > -DUNICODE_ENC" } > +// { dg-options "-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32LE > -DUNICODE_ENC" { target le } } > +// { dg-options "-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32BE > -DUNICODE_ENC" { target be } } > // { dg-do run { target c++23 } } > // { dg-add-options no_pch } > > diff --git a/libstdc++-v3/testsuite/std/format/debug_nonunicode.cc > b/libstdc++-v3/testsuite/std/format/debug_nonunicode.cc > index 5c03171d71a..2ac7e757ea8 100644 > --- a/libstdc++-v3/testsuite/std/format/debug_nonunicode.cc > +++ b/libstdc++-v3/testsuite/std/format/debug_nonunicode.cc > @@ -1,4 +1,4 @@ > -// { dg-options "-fexec-charset=ISO8859-1 -fwide-exec-charset=UTF-32LE" } > +// { dg-options "-fexec-charset=ISO8859-1" } > // { dg-do run { target c++23 } } > // { dg-add-options no_pch } > > -- > 2.49.0 > >