summaryrefslogtreecommitdiffstats
path: root/gdb/testsuite/gdb.mi/var-cmd.c
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/var-cmd.c
parent440e2fca6aa56d0e5a37ddad27dd2a13706a2e53 (diff)
downloadppe42-binutils-3848a17fe5074ad88310b9cd52dba70aba076c39.tar.gz
ppe42-binutils-3848a17fe5074ad88310b9cd52dba70aba076c39.zip
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/var-cmd.c')
-rw-r--r--gdb/testsuite/gdb.mi/var-cmd.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.mi/var-cmd.c b/gdb/testsuite/gdb.mi/var-cmd.c
index 1482cddb63..0a993a18c7 100644
--- a/gdb/testsuite/gdb.mi/var-cmd.c
+++ b/gdb/testsuite/gdb.mi/var-cmd.c
@@ -91,6 +91,24 @@ struct _struct_n_pointer {
struct _struct_n_pointer *next;
};
+struct anonymous {
+ int a;
+ struct {
+ int b;
+ char *c;
+ union {
+ int d;
+ void *e;
+ char f;
+ struct {
+ char g;
+ const char **h;
+ simpleton ***simple;
+ };
+ };
+ };
+};
+
void do_locals_tests (void);
void do_block_tests (void);
void subroutine1 (int, long *);
@@ -502,6 +520,38 @@ void do_bitfield_tests ()
/*: END: bitfield :*/
}
+void
+do_anonymous_type_tests (void)
+{
+ struct anonymous *anon;
+ struct anonymous **ptr;
+ struct
+ {
+ int x;
+ struct
+ {
+ int a;
+ };
+ struct
+ {
+ int b;
+ };
+ } v = {1, {2}, {3}};
+
+ anon = malloc (sizeof (struct anonymous));
+ anon->a = 1;
+ anon->b = 2;
+ anon->c = (char *) 3;
+ anon->d = 4;
+ anon->g = '5';
+ anon->h = (const char **) 6;
+ anon->simple = (simpleton ***) 7;
+
+ ptr = &anon;
+ free (anon);
+ return; /* anonymous type tests breakpoint */
+}
+
int
main (int argc, char *argv [])
{
@@ -512,6 +562,7 @@ main (int argc, char *argv [])
do_frozen_tests ();
do_at_tests ();
do_bitfield_tests ();
+ do_anonymous_type_tests ();
exit (0);
}
OpenPOWER on IntegriCloud