+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.
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
}
} 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;
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,
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
}