diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2006-12-08 14:29:02 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2006-12-08 14:29:02 +0000 |
commit | 038224f6186b569d849c7416159bde789749094a (patch) | |
tree | a386ad9be96c90693f331a6adca01e8aa0a316e7 /gdb/testsuite/gdb.mi/mi-var-cp.cc | |
parent | a1b5960f519380935c043f551b3c397f6c82df50 (diff) | |
download | binutils-gdb-038224f6186b569d849c7416159bde789749094a.tar.gz |
2006-12-08 Vladimir Prus <vladimir@codesourcery.com>
Test for base in references.
* gdb.mi/mi-var-cp.cc: Add test code.
* gdb.mi/mi-var-cp.exp: Test for bases in references.
* gdb.mi/mi-watch.exp: Adjust to mi_runto changes.
* gdb.mi/mi2-watch.exp: Likewise.
* lib/mi-support.exp (mi_runto): Use temporary breakpoint.
(mi_list_varobj_children): New function.
Diffstat (limited to 'gdb/testsuite/gdb.mi/mi-var-cp.cc')
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-var-cp.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-var-cp.cc b/gdb/testsuite/gdb.mi/mi-var-cp.cc index 23390f90389..6027051edcb 100644 --- a/gdb/testsuite/gdb.mi/mi-var-cp.cc +++ b/gdb/testsuite/gdb.mi/mi-var-cp.cc @@ -23,8 +23,26 @@ void reference_update_tests () x = 567; } +struct S { int i; int j; }; +struct S2 : S {}; + +int base_in_reference_test (S2& s2) +{ + return s2.i; +} + +void base_in_reference_test_main () +{ + S2 s; + s.i = 67; + s.j = 89; + base_in_reference_test (s); +} + + int main () { reference_update_tests (); + base_in_reference_test_main (); return 0; } |