aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorNick Roberts <nickrob@snap.net.nz>2007-01-04 23:08:56 +0000
committerNick Roberts <nickrob@snap.net.nz>2007-01-04 23:08:56 +0000
commit986d03be0f04ce5e8872dafa53497d2a8b3d853a (patch)
tree5e82f6686e87114d82a7d38eb20d399c428279cc /gdb
parenteafb94e8867c348f4e86b12136d659eb5c82aa97 (diff)
downloadgdb-986d03be0f04ce5e8872dafa53497d2a8b3d853a.zip
gdb-986d03be0f04ce5e8872dafa53497d2a8b3d853a.tar.gz
gdb-986d03be0f04ce5e8872dafa53497d2a8b3d853a.tar.bz2
mi-var-cp.exp: New test for references to pointers.
mi-var-cp.cc: (reference_to_pointer): New procedure for above test.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-cp.cc24
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-cp.exp1
2 files changed, 25 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-var-cp.cc b/gdb/testsuite/gdb.mi/mi-var-cp.cc
index 8489b55..1fa52b9 100644
--- a/gdb/testsuite/gdb.mi/mi-var-cp.cc
+++ b/gdb/testsuite/gdb.mi/mi-var-cp.cc
@@ -70,10 +70,34 @@ void base_in_reference_test_main ()
base_in_reference_test (s);
}
+int reference_to_pointer ()
+{
+ S s, *ptr_s, *& rptr_s = ptr_s;
+ s.i = 67;
+ s.j = 89;
+ ptr_s = &s;
+ /*: BEGIN: reference_to_pointer :*/
+ return 99;
+ /*:
+ mi_create_varobj RPTR rptr_s "create varobj for rptr_s"
+
+ mi_list_varobj_children RPTR {{RPTR.public public 2}} \
+ "list public child of RPTR"
+
+ mi_list_varobj_children RPTR.public \
+ {{RPTR.public.i i 0 int}
+ {RPTR.public.j j 0 int}} "list children of reference to pointer"
+
+ mi_check_varobj_value RPTR.public.i 67 "check i member"
+ mi_check_varobj_value RPTR.public.j 89 "check j member"
+ :*/
+ /*: END: reference_to_pointer :*/
+}
int main ()
{
reference_update_tests ();
base_in_reference_test_main ();
+ reference_to_pointer ();
return 0;
}
diff --git a/gdb/testsuite/gdb.mi/mi-var-cp.exp b/gdb/testsuite/gdb.mi/mi-var-cp.exp
index 7582301..e3efdd1 100644
--- a/gdb/testsuite/gdb.mi/mi-var-cp.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-cp.exp
@@ -43,6 +43,7 @@ mi_prepare_inline_tests $srcfile
mi_run_inline_test reference_update
mi_run_inline_test base_in_reference
+mi_run_inline_test reference_to_pointer
mi_gdb_exit
return 0