aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi/mi-var-cp.cc
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2012-01-12 22:50:49 +0000
committerKeith Seitz <keiths@redhat.com>2012-01-12 22:50:49 +0000
commit3848a17fe5074ad88310b9cd52dba70aba076c39 (patch)
treebe0d5e08bd96ad8c1820b1e5613cd5ac4b0629a9 /gdb/testsuite/gdb.mi/mi-var-cp.cc
parent440e2fca6aa56d0e5a37ddad27dd2a13706a2e53 (diff)
downloadgdb-3848a17fe5074ad88310b9cd52dba70aba076c39.zip
gdb-3848a17fe5074ad88310b9cd52dba70aba076c39.tar.gz
gdb-3848a17fe5074ad88310b9cd52dba70aba076c39.tar.bz2
PR mi/10586
* gdb.mi/var-cmd.c (struct anonymous): New structure. (do_anonymous_type_tests): New function. (main): Call do_anonymous_type_tests. * gdb.mi/mi2-var-child.exp: Add anonymous type tests. (verify_everything): New procedure. * gdb.mi/mi-var-cp.cc (class A): New class. (anonymous_structs_and_unions): New function. (main): Call anonymous_structs_and_unions. * gdb.mi/mi-var-cp.exp: Add anonymous type tests. (verify_everything): New procedure.
Diffstat (limited to 'gdb/testsuite/gdb.mi/mi-var-cp.cc')
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-cp.cc46
1 files changed, 46 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-var-cp.cc b/gdb/testsuite/gdb.mi/mi-var-cp.cc
index f23913b..abdee9f 100644
--- a/gdb/testsuite/gdb.mi/mi-var-cp.cc
+++ b/gdb/testsuite/gdb.mi/mi-var-cp.cc
@@ -205,6 +205,51 @@ int path_expression ()
/*: END: path_expression :*/
}
+class Anonymous
+{
+public:
+ struct { /* index: 0 */
+ int b;
+ };
+ struct { /* index: 1 */
+ int c;
+ };
+ struct { /* index: 2 */
+ int d;
+ struct { /* index: 1 */
+ int e;
+ struct { /* index: 0 */
+ int f;
+ union { /* index: 0 */
+ int g;
+ char h;
+ };
+ };
+ union { /* index: 0 */
+ int i;
+ char j;
+ };
+ };
+ };
+};
+
+/* Test anonymous structs and unions. */
+int
+anonymous_structs_and_unions (void)
+{
+ Anonymous a;
+ a.b = 1;
+ a.c = 2;
+ a.d = 3;
+ a.e = 4;
+ a.f = 5;
+ a.g = 6;
+ a.h = '7';
+ a.i = 8;
+ a.j = '8';
+ return 0; /* anonymous_structs_and_unions */
+}
+
int main ()
{
reference_update_tests ();
@@ -212,5 +257,6 @@ int main ()
reference_to_pointer ();
reference_to_struct ();
path_expression ();
+ anonymous_structs_and_unions ();
return 0;
}