Skip to content

Commit cd77e15

Browse files
committed
libstdc++: Fix tests that fail with -fno-char8_t
Adjust expected errors or skip tests as UNSUPPORTED if -fno-char8_t is used in the test flags. libstdc++-v3/ChangeLog: * testsuite/20_util/integer_comparisons/equal_neg.cc: Use no-opts selector for errors that depend on -fchar8_t. * testsuite/20_util/integer_comparisons/greater_equal_neg.cc: Likewise. * testsuite/20_util/integer_comparisons/greater_neg.cc: Likewise. * testsuite/20_util/integer_comparisons/in_range_neg.cc: Likewise. * testsuite/20_util/integer_comparisons/less_equal_neg.cc: Likewise. * testsuite/20_util/integer_comparisons/less_neg.cc: Likewise. * testsuite/20_util/integer_comparisons/not_equal_neg.cc: Likewise. * testsuite/21_strings/basic_string/hash/hash_char8_t.cc: Skip if -fno-char8_t is used. * testsuite/21_strings/headers/cuchar/functions_std_cxx20.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_character/char/deleted.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_character/wchar_t/deleted.cc: Likewise. * testsuite/27_io/filesystem/path/factory/u8path-depr.cc: Use char for u8 literal if char8_t is not available. * testsuite/27_io/headers/iosfwd/synopsis.cc: Check __cpp_char8_t. * testsuite/29_atomics/atomic_integral/wait_notify.cc: Likewise. * testsuite/29_atomics/headers/atomic/types_std_c++20_neg.cc: Remove check for _GLIBCXX_USE_CHAR8_T.
1 parent 87bc206 commit cd77e15

File tree

15 files changed

+26
-18
lines changed

15 files changed

+26
-18
lines changed

libstdc++-v3/testsuite/20_util/integer_comparisons/equal_neg.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ bool c = std::cmp_equal(2, L'2'); // { dg-error "here" }
2525
bool d = std::cmp_equal(L'2', 2); // { dg-error "here" }
2626
bool e = std::cmp_equal(true, 1); // { dg-error "here" }
2727
bool f = std::cmp_equal(0, false); // { dg-error "here" }
28-
bool g = std::cmp_equal(97, u8'a'); // { dg-error "here" }
29-
bool h = std::cmp_equal(u8'a', 97); // { dg-error "here" }
28+
bool g = std::cmp_equal(97, u8'a'); // { dg-error "here" "" { target { no-opts "-fno-char8_t" } } }
29+
bool h = std::cmp_equal(u8'a', 97); // { dg-error "here" "" { target { no-opts "-fno-char8_t" } } }
3030
bool i = std::cmp_equal(97, u'a'); // { dg-error "here" }
3131
bool j = std::cmp_equal(u'a', 97); // { dg-error "here" }
3232
bool k = std::cmp_equal(97, U'a'); // { dg-error "here" }

libstdc++-v3/testsuite/20_util/integer_comparisons/greater_equal_neg.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ bool c = std::cmp_greater_equal(2, L'2'); // { dg-error "constexpr" }
2525
bool d = std::cmp_greater_equal(L'2', 2); // { dg-error "constexpr" }
2626
bool e = std::cmp_greater_equal(true, 1); // { dg-error "constexpr" }
2727
bool f = std::cmp_greater_equal(0, false); // { dg-error "constexpr" }
28-
bool g = std::cmp_greater_equal(97, u8'a'); // { dg-error "constexpr" }
29-
bool h = std::cmp_greater_equal(u8'a', 97); // { dg-error "constexpr" }
28+
bool g = std::cmp_greater_equal(97, u8'a'); // { dg-error "constexpr" "" { target { no-opts "-fno-char8_t" } } }
29+
bool h = std::cmp_greater_equal(u8'a', 97); // { dg-error "constexpr" "" { target { no-opts "-fno-char8_t" } } }
3030
bool i = std::cmp_greater_equal(97, u'a'); // { dg-error "constexpr" }
3131
bool j = std::cmp_greater_equal(u'a', 97); // { dg-error "constexpr" }
3232
bool k = std::cmp_greater_equal(97, U'a'); // { dg-error "constexpr" }

libstdc++-v3/testsuite/20_util/integer_comparisons/greater_neg.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ bool c = std::cmp_greater(2, L'2'); // { dg-error "constexpr" }
2525
bool d = std::cmp_greater(L'2', 2); // { dg-error "constexpr" }
2626
bool e = std::cmp_greater(true, 1); // { dg-error "constexpr" }
2727
bool f = std::cmp_greater(0, false); // { dg-error "constexpr" }
28-
bool g = std::cmp_greater(97, u8'a'); // { dg-error "constexpr" }
29-
bool h = std::cmp_greater(u8'a', 97); // { dg-error "constexpr" }
28+
bool g = std::cmp_greater(97, u8'a'); // { dg-error "constexpr" "" { target { no-opts "-fno-char8_t" } } }
29+
bool h = std::cmp_greater(u8'a', 97); // { dg-error "constexpr" "" { target { no-opts "-fno-char8_t" } } }
3030
bool i = std::cmp_greater(97, u'a'); // { dg-error "constexpr" }
3131
bool j = std::cmp_greater(u'a', 97); // { dg-error "constexpr" }
3232
bool k = std::cmp_greater(97, U'a'); // { dg-error "constexpr" }

libstdc++-v3/testsuite/20_util/integer_comparisons/in_range_neg.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ bool c = std::in_range<int>(L'2'); // { dg-error "here" }
2525
bool d = std::in_range<wchar_t>(2); // { dg-error "here" }
2626
bool e = std::in_range<int>(true); // { dg-error "here" }
2727
bool f = std::in_range<bool>(0); // { dg-error "here" }
28-
bool g = std::in_range<int>(u8'a'); // { dg-error "here" }
29-
bool h = std::in_range<char8_t>(97); // { dg-error "here" }
28+
bool g = std::in_range<int>(u8'a'); // { dg-error "here" "" { target { no-opts "-fno-char8_t" } } }
29+
#ifdef __cpp_char8_t
30+
bool h = std::in_range<char8_t>(97); // { dg-error "here" "" { target { no-opts "-fno-char8_t" } } }
31+
#endif
3032
bool i = std::in_range<int>(u'a'); // { dg-error "here" }
3133
bool j = std::in_range<char16_t>(97); // { dg-error "here" }
3234
bool k = std::in_range<int>(U'a'); // { dg-error "here" }

libstdc++-v3/testsuite/20_util/integer_comparisons/less_equal_neg.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ bool c = std::cmp_less_equal(2, L'2'); // { dg-error "constexpr" }
2525
bool d = std::cmp_less_equal(L'2', 2); // { dg-error "constexpr" }
2626
bool e = std::cmp_less_equal(true, 1); // { dg-error "constexpr" }
2727
bool f = std::cmp_less_equal(0, false); // { dg-error "constexpr" }
28-
bool g = std::cmp_less_equal(97, u8'a'); // { dg-error "constexpr" }
29-
bool h = std::cmp_less_equal(u8'a', 97); // { dg-error "constexpr" }
28+
bool g = std::cmp_less_equal(97, u8'a'); // { dg-error "constexpr" "" { target { no-opts "-fno-char8_t" } } }
29+
bool h = std::cmp_less_equal(u8'a', 97); // { dg-error "constexpr" "" { target { no-opts "-fno-char8_t" } } }
3030
bool i = std::cmp_less_equal(97, u'a'); // { dg-error "constexpr" }
3131
bool j = std::cmp_less_equal(u'a', 97); // { dg-error "constexpr" }
3232
bool k = std::cmp_less_equal(97, U'a'); // { dg-error "constexpr" }

libstdc++-v3/testsuite/20_util/integer_comparisons/less_neg.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ bool c = std::cmp_less(2, L'2'); // { dg-error "here" }
2525
bool d = std::cmp_less(L'2', 2); // { dg-error "here" }
2626
bool e = std::cmp_less(true, 1); // { dg-error "here" }
2727
bool f = std::cmp_less(0, false); // { dg-error "here" }
28-
bool g = std::cmp_less(97, u8'a'); // { dg-error "here" }
29-
bool h = std::cmp_less(u8'a', 97); // { dg-error "here" }
28+
bool g = std::cmp_less(97, u8'a'); // { dg-error "here" "" { target { no-opts "-fno-char8_t" } } }
29+
bool h = std::cmp_less(u8'a', 97); // { dg-error "here" "" { target { no-opts "-fno-char8_t" } } }
3030
bool i = std::cmp_less(97, u'a'); // { dg-error "here" }
3131
bool j = std::cmp_less(u'a', 97); // { dg-error "here" }
3232
bool k = std::cmp_less(97, U'a'); // { dg-error "here" }

libstdc++-v3/testsuite/20_util/integer_comparisons/not_equal_neg.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ bool c = std::cmp_equal(2, L'2'); // { dg-error "here" }
2525
bool d = std::cmp_equal(L'2', 2); // { dg-error "here" }
2626
bool e = std::cmp_equal(true, 1); // { dg-error "here" }
2727
bool f = std::cmp_equal(0, false); // { dg-error "here" }
28-
bool g = std::cmp_equal(97, u8'a'); // { dg-error "here" }
29-
bool h = std::cmp_equal(u8'a', 97); // { dg-error "here" }
28+
bool g = std::cmp_equal(97, u8'a'); // { dg-error "here" "" { target { no-opts "-fno-char8_t" } } }
29+
bool h = std::cmp_equal(u8'a', 97); // { dg-error "here" "" { target { no-opts "-fno-char8_t" } } }
3030
bool i = std::cmp_equal(97, u'a'); // { dg-error "here" }
3131
bool j = std::cmp_equal(u'a', 97); // { dg-error "here" }
3232
bool k = std::cmp_equal(97, U'a'); // { dg-error "here" }

libstdc++-v3/testsuite/21_strings/basic_string/hash/hash_char8_t.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// <http://www.gnu.org/licenses/>.
1717

1818
// { dg-do run { target c++20 } }
19+
// { dg-skip-if "" { *-*-* } { "-fno-char8_t" } }
1920

2021
#include <string>
2122
#include <memory_resource>

libstdc++-v3/testsuite/21_strings/headers/cuchar/functions_std_cxx20.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// { dg-do compile { target c++20 } }
2+
// { dg-skip-if "" { *-*-* } { "-fno-char8_t" } }
23

34
#include <cuchar>
45

libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/deleted.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
// Test character inserters defined as deleted by P1423.
2121

2222
// { dg-do compile { target c++20 } }
23+
// { dg-skip-if "" { *-*-* } { "-fno-char8_t" } }
2324

2425
#include <ostream>
2526

0 commit comments

Comments
 (0)