aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2020-08-22 18:00:55 +0100
committerPedro Alves <pedro@palves.net>2020-09-13 15:46:21 +0100
commit3b8d4c5cc045ba80cc5b095fba06287050b7ef87 (patch)
treecad9b15a0e3b4953b0431d28a417a495991e63dd /gdb/testsuite
parentd5f96005a632d2a4e08ed93beb3ba0a01d12ce24 (diff)
downloadgdb-3b8d4c5cc045ba80cc5b095fba06287050b7ef87.zip
gdb-3b8d4c5cc045ba80cc5b095fba06287050b7ef87.tar.gz
gdb-3b8d4c5cc045ba80cc5b095fba06287050b7ef87.tar.bz2
Remove stale "register" bits from gdb.cp/misc.cc
gdb.cp/misc.cc seems to have been originally copied from gdb.cp/classes.cc. The testcases that use it, misc.exp and inherit.exp don't reference the "register" bits anywhere. Remove them, since they trigger warnings with newer GCCs, given "register" is being removed in C++17. gdb/testsuite/ChangeLog: * gdb.cp/inherit.exp: No longer pass -Wno-deprecated-register. * gdb.cp/misc.exp: No longer pass -Wno-deprecated-register. * gdb.cp/misc.cc (class small, small::method, marker_reg1) (register_class): Delete. (main): Don't call register_class.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog8
-rw-r--r--gdb/testsuite/gdb.cp/inherit.exp3
-rw-r--r--gdb/testsuite/gdb.cp/misc.cc37
-rw-r--r--gdb/testsuite/gdb.cp/misc.exp3
4 files changed, 10 insertions, 41 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index cd93827..c339151 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,13 @@
2020-09-13 Pedro Alves <pedro@palves.net>
+ * gdb.cp/inherit.exp: No longer pass -Wno-deprecated-register.
+ * gdb.cp/misc.exp: No longer pass -Wno-deprecated-register.
+ * gdb.cp/misc.cc (class small, small::method, marker_reg1)
+ (register_class): Delete.
+ (main): Don't call register_class.
+
+2020-09-13 Pedro Alves <pedro@palves.net>
+
* gdb.cp/classes.exp: No longer pass -Wno-deprecated-register.
(do_tests): Remove "calling method for small class" test.
* gdb.cp/classes.cc (class small, small::method, marker_reg1)
diff --git a/gdb/testsuite/gdb.cp/inherit.exp b/gdb/testsuite/gdb.cp/inherit.exp
index 2d4635c..e9549d3 100644
--- a/gdb/testsuite/gdb.cp/inherit.exp
+++ b/gdb/testsuite/gdb.cp/inherit.exp
@@ -26,8 +26,7 @@ load_lib "cp-support.exp"
standard_testfile misc.cc
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
- {debug c++ additional_flags=-Wno-deprecated-register}]} {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
return -1
}
diff --git a/gdb/testsuite/gdb.cp/misc.cc b/gdb/testsuite/gdb.cp/misc.cc
index 41fb9d2..24d40c4 100644
--- a/gdb/testsuite/gdb.cp/misc.cc
+++ b/gdb/testsuite/gdb.cp/misc.cc
@@ -511,42 +511,6 @@ typedef struct {
} tagless_struct;
tagless_struct v_tagless;
-/* Try to get the compiler to allocate a class in a register. */
-class small {
- public:
- int x;
- int method ();
-};
-
-int
-small::method ()
-{
- return x + 5;
-}
-
-void marker_reg1 () {}
-
-int
-register_class ()
-{
- /* We don't call any methods for v, so gcc version cygnus-2.3.3-930220
- might put this variable in a register. This is a lose, though, because
- it means that GDB can't call any methods for that variable. */
- register small v;
-
- int i;
-
- /* Perform a computation sufficiently complicated that optimizing compilers
- won't optimized out the variable. If some compiler constant-folds this
- whole loop, maybe using a parameter to this function here would help. */
- v.x = 0;
- for (i = 0; i < 13; ++i)
- v.x += i;
- --v.x; /* v.x is now 77 */
- marker_reg1 ();
- return v.x + 5;
-}
-
void dummy()
{
v_bool = true;
@@ -574,7 +538,6 @@ main()
inheritance1 ();
inheritance3 ();
enums1 ();
- register_class ();
/* FIXME: pmi gets optimized out. Need to do some more computation with
it or something. (No one notices, because the test is xfail'd anyway,
diff --git a/gdb/testsuite/gdb.cp/misc.exp b/gdb/testsuite/gdb.cp/misc.exp
index 61034bf..cd6f0f7 100644
--- a/gdb/testsuite/gdb.cp/misc.exp
+++ b/gdb/testsuite/gdb.cp/misc.exp
@@ -19,8 +19,7 @@ if { [skip_cplus_tests] } { continue }
standard_testfile .cc
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
- {debug c++ additional_flags=-Wno-deprecated-register}]} {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
return -1
}