Split wchars tests from the normal variant
Jonathan Wakely
jwakely@redhat.com
Thu Jan 14 13:54:01 GMT 2021
On 28/12/20 19:39 +0100, François Dumont via Libstdc++ wrote:
>On 22/12/20 10:27 pm, Alexandre Oliva wrote:
>>This change extracts apart the wchar specific parts of character
>>conversion tests to allow conditonalizating these parts on actual
>>wchar support while applying the rest more generally.
>>
>>This turned out useful during our work on the libstdc++ support
>>for VxWorks, to expose the problematic areas more precisely.
>>
>>Regstrapped on x86_64-linux-gnu, and tested with -x-arm-wrs-vxworks7r2.
>>Ok to install? (dg-requires-wchars is added by another patch by
>>Corentin, that I posted a few minutes ago)
>>
>>While updating Corentin's patch for mainline, I brought over to the
>>split-out test even the preprocessor conditional that is present in the
>>current version of the test, but required/implied by dg-requires-wchars.
>>Maybe that's excessive. Maybe the whole patch is excessive, given that
>>conditional, but I didn't want to just drop it without asking for
>>others' thoughts.
>>
>>
>>from Corentin Gay <gay@adacore.com>
>>for libstdc++-v3/ChangeLog
>>
>> * testsuite/20_util/from_chars/1_neg.cc: Split wchar specific
>> part into...
>> * testsuite/20_util/from_chars/1_neg_wchar.cc: ... new file.
>>---
>> libstdc++-v3/testsuite/20_util/from_chars/1_neg.cc | 8 -----
>> .../testsuite/20_util/from_chars/1_neg_wchar.cc | 35 ++++++++++++++++++++
>> 2 files changed, 35 insertions(+), 8 deletions(-)
>> create mode 100644 libstdc++-v3/testsuite/20_util/from_chars/1_neg_wchar.cc
>>
>>diff --git a/libstdc++-v3/testsuite/20_util/from_chars/1_neg.cc b/libstdc++-v3/testsuite/20_util/from_chars/1_neg.cc
>>index 0d2fe2b3e6594..a84b0f5efb075 100644
>>--- a/libstdc++-v3/testsuite/20_util/from_chars/1_neg.cc
>>+++ b/libstdc++-v3/testsuite/20_util/from_chars/1_neg.cc
>>@@ -23,14 +23,6 @@
>> void
>> test01(const char* first, const char* last)
>> {
>>-#if _GLIBCXX_USE_WCHAR_T
>>- wchar_t wc;
>>-#else
>>- enum W { } wc;
>>-#endif
>>- std::from_chars(first, last, wc); // { dg-error "no matching" }
>>- std::from_chars(first, last, wc, 10); // { dg-error "no matching" }
>>-
>> char16_t c16;
>> std::from_chars(first, last, c16); // { dg-error "no matching" }
>> std::from_chars(first, last, c16, 10); // { dg-error "no matching" }
>>diff --git a/libstdc++-v3/testsuite/20_util/from_chars/1_neg_wchar.cc b/libstdc++-v3/testsuite/20_util/from_chars/1_neg_wchar.cc
>>new file mode 100644
>>index 0000000000000..2d736a28a2da7
>>--- /dev/null
>>+++ b/libstdc++-v3/testsuite/20_util/from_chars/1_neg_wchar.cc
>
>AFAIK _neg should be last.
Yup.
>Using wchar_t_neg.cc should even make the dg-require-wchars useless here.
Indeed, but I don't think we want this change anyway.
More information about the Libstdc++
mailing list