aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.mi')
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-rtti.cc28
1 files changed, 16 insertions, 12 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-var-rtti.cc b/gdb/testsuite/gdb.mi/mi-var-rtti.cc
index 94098b2..fe19b88 100644
--- a/gdb/testsuite/gdb.mi/mi-var-rtti.cc
+++ b/gdb/testsuite/gdb.mi/mi-var-rtti.cc
@@ -241,6 +241,12 @@ void use_rtti_with_multiple_inheritence_test ()
void type_update_when_use_rtti_test ()
{
/*: BEGIN: type_update_when_use_rtti :*/
+ Base *ptr = 0;
+ struct S {
+ Base* ptr;
+ S ( Base* v ) :
+ ptr ( v ) {}
+ } s ( ptr );
Derived d;
/*:
set testname type_update_when_use_rtti
@@ -260,12 +266,8 @@ void type_update_when_use_rtti_test ()
check_derived_children_without_rtti S.public.ptr s.ptr $testname
:*/
- Base* ptr = &d;
- struct S {
- Base* ptr;
- S ( Base* v ) :
- ptr ( v ) {}
- } s ( &d );
+ ptr = &d;
+ s.ptr = &d;
/*:
mi_varobj_update_with_type_change PTR {Derived \*} 2 \
"update ptr to derived in $testname"
@@ -295,6 +297,12 @@ void type_update_when_use_rtti_test ()
void skip_type_update_when_not_use_rtti_test ()
{
/*: BEGIN: skip_type_update_when_not_use_rtti :*/
+ Base *ptr = 0;
+ struct S {
+ Base* ptr;
+ S ( Base* v ) :
+ ptr ( v ) {}
+ } s ( ptr );
Derived d;
/*:
set testname skip_type_update_when_not_use_rtti
@@ -314,12 +322,8 @@ void skip_type_update_when_not_use_rtti_test ()
check_derived_children_without_rtti S.public.ptr s.ptr $testname
:*/
- Base* ptr = &d;
- struct S {
- Base* ptr;
- S ( Base* v ) :
- ptr ( v ) {}
- } s ( &d );
+ ptr = &d;
+ s.ptr = &d;
/*:
mi_varobj_update PTR {PTR PTR.public.A} \
"update ptr to derived type in $testname"