]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix some AIX test failures
authorJonathan Wakely <jwakely@redhat.com>
Wed, 12 Apr 2023 21:14:05 +0000 (22:14 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 12 Apr 2023 22:25:17 +0000 (23:25 +0100)
AIX <sys/thread.h> defines struct tstate with non-reserved names, so
adjust the 17_intro/names.cc test. It also defines struct user, which
conflicts with namespace user in some tests.

Replacing the global operator new doesn't work on AIX the same way as it
does for ELF, so skip some tests that depend on replacing it.

Add missing DG directives to synchronized_value test so it doesn't run
for the single-threaded AIX multilib.

libstdc++-v3/ChangeLog:

* testsuite/17_intro/names.cc [_AIX]: Do not define policy.
* testsuite/19_diagnostics/error_code/cons/lwg3629.cc: Rename
namespace to avoid clashing with libc struct.
* testsuite/19_diagnostics/error_condition/cons/lwg3629.cc:
Likewise.
* testsuite/23_containers/unordered_map/96088.cc: Skip on AIX.
* testsuite/23_containers/unordered_multimap/96088.cc: Likewise.
* testsuite/23_containers/unordered_multiset/96088.cc: Likewise.
* testsuite/23_containers/unordered_set/96088.cc: Likewise.
* testsuite/experimental/synchronized_value.cc: Require gthreads
and add missing option for pthreads targets.

libstdc++-v3/testsuite/17_intro/names.cc
libstdc++-v3/testsuite/19_diagnostics/error_code/cons/lwg3629.cc
libstdc++-v3/testsuite/19_diagnostics/error_condition/cons/lwg3629.cc
libstdc++-v3/testsuite/23_containers/unordered_map/96088.cc
libstdc++-v3/testsuite/23_containers/unordered_multimap/96088.cc
libstdc++-v3/testsuite/23_containers/unordered_multiset/96088.cc
libstdc++-v3/testsuite/23_containers/unordered_set/96088.cc
libstdc++-v3/testsuite/experimental/synchronized_value.cc

index 9932dea14d57389753ed867597fbc48c42551b63..eb4d064177c8b5bda6a05e7b032486efa7c24dc9 100644 (file)
 #undef v
 // <sys/timer.h> defines trb::func and cputime_tmr::func
 #undef func
+// <sys/thread.h> defines tstate::policy
+#undef policy
 #endif
 
 #ifdef __APPLE__
index 70fa5e80503d3b2bf0185d5a060587002b3d82a3..bd7c6ce3d9e35eb581ce181412991c72f3faa731 100644 (file)
@@ -3,18 +3,18 @@
 // 3629. make_error_code and make_error_condition are customization points
 // Verify that make_error_code is looked up using ADL only.
 
-namespace user
+namespace User
 {
   struct E1;
 }
 
 // N.B. not in associated namespace of E1, and declared before <system_error>.
-user::E1 make_error_code(user::E1);
+User::E1 make_error_code(User::E1);
 
 #include <future> // declares std::make_error_code(future_errc)
 #include <system_error>
 
-namespace user
+namespace User
 {
   struct E1
   {
@@ -32,17 +32,17 @@ namespace user
   };
 }
 
-template<> struct std::is_error_code_enum<user::E1> : std::true_type { };
-template<> struct std::is_error_code_enum<user::E2> : std::true_type { };
-template<> struct std::is_error_code_enum<user::E3> : std::true_type { };
+template<> struct std::is_error_code_enum<User::E1> : std::true_type { };
+template<> struct std::is_error_code_enum<User::E2> : std::true_type { };
+template<> struct std::is_error_code_enum<User::E3> : std::true_type { };
 
 // ::make_error_code(E1) should not be found by name lookup.
-std::error_code e1( user::E1{} ); // { dg-error "here" }
+std::error_code e1( User::E1{} ); // { dg-error "here" }
 
 // std::make_error_code(future_errc) should not be found by name lookup.
-std::error_code e2( user::E2{} ); // { dg-error "here" }
+std::error_code e2( User::E2{} ); // { dg-error "here" }
 
 // std::make_error_code(errc) should not be found by name lookup.
-std::error_code e3( user::E3{} ); // { dg-error "here" }
+std::error_code e3( User::E3{} ); // { dg-error "here" }
 
 // { dg-error "use of deleted function" "" { target *-*-* } 0 }
index 562a99aee3bd19e4f911874a18bdd7914d2282f6..d72163b1a073f5362a4c65f0c78a31463977a62b 100644 (file)
@@ -3,18 +3,18 @@
 // 3629. make_error_code and make_error_condition are customization points
 // Verify that make_error_condition is looked up using ADL only.
 
-namespace user
+namespace User
 {
   struct E1;
 }
 
 // N.B. not in associated namespace of E1, and declared before <system_error>.
-user::E1 make_error_condition(user::E1);
+User::E1 make_error_condition(User::E1);
 
 #include <future> // declares std::make_error_condition(future_errc)
 #include <system_error>
 
-namespace user
+namespace User
 {
   struct E1
   {
@@ -32,17 +32,17 @@ namespace user
   };
 }
 
-template<> struct std::is_error_condition_enum<user::E1> : std::true_type { };
-template<> struct std::is_error_condition_enum<user::E2> : std::true_type { };
-template<> struct std::is_error_condition_enum<user::E3> : std::true_type { };
+template<> struct std::is_error_condition_enum<User::E1> : std::true_type { };
+template<> struct std::is_error_condition_enum<User::E2> : std::true_type { };
+template<> struct std::is_error_condition_enum<User::E3> : std::true_type { };
 
 // ::make_error_condition(E1) should not be found by name lookup.
-std::error_condition e1( user::E1{} ); // { dg-error "here" }
+std::error_condition e1( User::E1{} ); // { dg-error "here" }
 
 // std::make_error_condition(future_errc) should not be found by name lookup.
-std::error_condition e2( user::E2{} ); // { dg-error "here" }
+std::error_condition e2( User::E2{} ); // { dg-error "here" }
 
 // std::make_error_condition(errc) should not be found by name lookup.
-std::error_condition e3( user::E3{} ); // { dg-error "here" }
+std::error_condition e3( User::E3{} ); // { dg-error "here" }
 
 // { dg-error "use of deleted function" "" { target *-*-* } 0 }
index 754b529c67c19658f1e050cfb4b804f7c709de85..c6d50c20fbf6593a340e7e818eac9533e5295fcb 100644 (file)
@@ -1,5 +1,6 @@
 // { dg-do run { target c++17 } }
 // { dg-require-effective-target std_allocator_new }
+// { dg-xfail-run-if "AIX operator new" { powerpc-ibm-aix* } }
 
 // Copyright (C) 2021-2023 Free Software Foundation, Inc.
 //
index b55afdfd74a267072e71a2e87c569f738e7c8691..214bc91a559a0c5995d8a494c2bb212b18c8a349 100644 (file)
@@ -1,5 +1,6 @@
 // { dg-do run { target c++17 } }
 // { dg-require-effective-target std_allocator_new }
+// { dg-xfail-run-if "AIX operator new" { powerpc-ibm-aix* } }
 
 // Copyright (C) 2021-2023 Free Software Foundation, Inc.
 //
index d50435aa7a248d0124054834d2e7d2826fc54890..838ce8d5bc531767b1c1533d068b13f41540c897 100644 (file)
@@ -1,5 +1,6 @@
 // { dg-do run { target c++17 } }
 // { dg-require-effective-target std_allocator_new }
+// { dg-xfail-run-if "AIX operator new" { powerpc-ibm-aix* } }
 
 // Copyright (C) 2021-2023 Free Software Foundation, Inc.
 //
index 05a5dc07f62e44c87612d08b6a29f4fc7b05cdbf..0f7dce2b38c52f52cc6edb96d0b8dec75e191bba 100644 (file)
@@ -1,5 +1,6 @@
 // { dg-do run { target c++17 } }
 // { dg-require-effective-target std_allocator_new }
+// { dg-xfail-run-if "AIX operator new" { powerpc-ibm-aix* } }
 
 // Copyright (C) 2021-2023 Free Software Foundation, Inc.
 //
index 8e8134699a2f3f82b0248b940869ff319e8fcb07..a7e556c14ead21ede5d92f1a90a9d801ffa0b016 100644 (file)
@@ -1,4 +1,6 @@
 // { dg-do run { target c++17 } }
+// { dg-additional-options "-pthread" { target pthread } }
+// { dg-require-gthreads "" }
 
 #include <experimental/synchronized_value>
 #include <testsuite_hooks.h>