forked from iains/gcc-14-branch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
c++: testsuite: Remove testsuite_tr1.h includes
This patch removes the testsuite_tr1.h dependency from g++.dg/ext/is_*.C tests since the header is supposed to be used only by libstdc++, not front-end. This also includes test code consistency fixes. For the record this fixes the test failures reported at https://gcc.gnu.org/pipermail/gcc-patches/2023-December/641058.html gcc/testsuite/ChangeLog: * g++.dg/ext/is_array.C: Remove testsuite_tr1.h. Add necessary definitions accordingly. Tweak macros for consistency across test codes. * g++.dg/ext/is_bounded_array.C: Likewise. * g++.dg/ext/is_function.C: Likewise. * g++.dg/ext/is_member_function_pointer.C: Likewise. * g++.dg/ext/is_member_object_pointer.C: Likewise. * g++.dg/ext/is_member_pointer.C: Likewise. * g++.dg/ext/is_object.C: Likewise. * g++.dg/ext/is_reference.C: Likewise. * g++.dg/ext/is_scoped_enum.C: Likewise. Signed-off-by: Ken Matsui <[email protected]> Reviewed-by: Patrick Palka <[email protected]> Reviewed-by: Jason Merrill <[email protected]>
- Loading branch information
1 parent
5bd5ef9
commit c4d1d1a
Showing
9 changed files
with
101 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,28 @@ | ||
// { dg-do compile { target c++11 } } | ||
|
||
#include <testsuite_tr1.h> | ||
|
||
using namespace __gnu_test; | ||
|
||
#define SA(X) static_assert((X),#X) | ||
|
||
#define SA_TEST_NON_VOLATILE(TRAIT, TYPE, EXPECT) \ | ||
SA(TRAIT(TYPE) == EXPECT); \ | ||
SA(TRAIT(const TYPE) == EXPECT) | ||
#define SA_TEST_FN(TRAIT, TYPE, EXPECT) \ | ||
SA(TRAIT(TYPE) == EXPECT); \ | ||
SA(TRAIT(const TYPE) == EXPECT); | ||
|
||
#define SA_TEST_CATEGORY(TRAIT, TYPE, EXPECT) \ | ||
SA(TRAIT(TYPE) == EXPECT); \ | ||
SA(TRAIT(const TYPE) == EXPECT); \ | ||
SA(TRAIT(volatile TYPE) == EXPECT); \ | ||
SA(TRAIT(TYPE) == EXPECT); \ | ||
SA(TRAIT(const TYPE) == EXPECT); \ | ||
SA(TRAIT(volatile TYPE) == EXPECT); \ | ||
SA(TRAIT(const volatile TYPE) == EXPECT) | ||
|
||
class ClassType { }; | ||
|
||
// Positive tests. | ||
SA_TEST_CATEGORY(__is_member_object_pointer, int (ClassType::*), true); | ||
SA_TEST_CATEGORY(__is_member_object_pointer, ClassType (ClassType::*), true); | ||
|
||
// Negative tests. | ||
SA_TEST_NON_VOLATILE(__is_member_object_pointer, int (ClassType::*) (int), false); | ||
SA_TEST_NON_VOLATILE(__is_member_object_pointer, int (ClassType::*) (float, ...), false); | ||
SA_TEST_NON_VOLATILE(__is_member_object_pointer, ClassType (ClassType::*) (ClassType), false); | ||
SA_TEST_NON_VOLATILE(__is_member_object_pointer, float (ClassType::*) (int, float, int[], int&), false); | ||
SA_TEST_FN(__is_member_object_pointer, int (ClassType::*) (int), false); | ||
SA_TEST_FN(__is_member_object_pointer, int (ClassType::*) (float, ...), false); | ||
SA_TEST_FN(__is_member_object_pointer, ClassType (ClassType::*) (ClassType), false); | ||
SA_TEST_FN(__is_member_object_pointer, float (ClassType::*) (int, float, int[], int&), false); | ||
|
||
// Sanity check. | ||
SA_TEST_CATEGORY(__is_member_object_pointer, ClassType, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,27 @@ | ||
// { dg-do compile { target c++11 } } | ||
|
||
#include <testsuite_tr1.h> | ||
|
||
using namespace __gnu_test; | ||
|
||
#define SA(X) static_assert((X),#X) | ||
|
||
#define SA_TEST_NON_VOLATILE(TRAIT, TYPE, EXPECT) \ | ||
SA(TRAIT(TYPE) == EXPECT); \ | ||
SA(TRAIT(const TYPE) == EXPECT) | ||
#define SA_TEST_FN(TRAIT, TYPE, EXPECT) \ | ||
SA(TRAIT(TYPE) == EXPECT); \ | ||
SA(TRAIT(const TYPE) == EXPECT); | ||
|
||
#define SA_TEST_CATEGORY(TRAIT, TYPE, EXPECT) \ | ||
SA(TRAIT(TYPE) == EXPECT); \ | ||
SA(TRAIT(const TYPE) == EXPECT); \ | ||
SA(TRAIT(volatile TYPE) == EXPECT); \ | ||
SA(TRAIT(TYPE) == EXPECT); \ | ||
SA(TRAIT(const TYPE) == EXPECT); \ | ||
SA(TRAIT(volatile TYPE) == EXPECT); \ | ||
SA(TRAIT(const volatile TYPE) == EXPECT) | ||
|
||
class ClassType { }; | ||
|
||
SA_TEST_CATEGORY(__is_member_pointer, int (ClassType::*), true); | ||
SA_TEST_CATEGORY(__is_member_pointer, ClassType (ClassType::*), true); | ||
|
||
SA_TEST_NON_VOLATILE(__is_member_pointer, int (ClassType::*)(int), true); | ||
SA_TEST_NON_VOLATILE(__is_member_pointer, int (ClassType::*)(int) const, true); | ||
SA_TEST_NON_VOLATILE(__is_member_pointer, int (ClassType::*)(float, ...), true); | ||
SA_TEST_NON_VOLATILE(__is_member_pointer, ClassType (ClassType::*)(ClassType), true); | ||
SA_TEST_NON_VOLATILE(__is_member_pointer, | ||
float (ClassType::*)(int, float, int[], int&), true); | ||
SA_TEST_FN(__is_member_pointer, int (ClassType::*)(int), true); | ||
SA_TEST_FN(__is_member_pointer, int (ClassType::*)(int) const, true); | ||
SA_TEST_FN(__is_member_pointer, int (ClassType::*)(float, ...), true); | ||
SA_TEST_FN(__is_member_pointer, ClassType (ClassType::*)(ClassType), true); | ||
SA_TEST_FN(__is_member_pointer, float (ClassType::*)(int, float, int[], int&), true); | ||
|
||
// Sanity check. | ||
SA_TEST_CATEGORY(__is_member_pointer, ClassType, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters