aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.c++/anon-union.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.c++/anon-union.cc')
-rw-r--r--gdb/testsuite/gdb.c++/anon-union.cc23
1 files changed, 12 insertions, 11 deletions
diff --git a/gdb/testsuite/gdb.c++/anon-union.cc b/gdb/testsuite/gdb.c++/anon-union.cc
index c58a306..0b3fd13 100644
--- a/gdb/testsuite/gdb.c++/anon-union.cc
+++ b/gdb/testsuite/gdb.c++/anon-union.cc
@@ -4,13 +4,13 @@ struct Foo {
int zero;
unsigned int one;
} num1;
-
- union {
- int pebble;
- struct {
+ struct X {
int rock;
unsigned int rock2;
- } x;
+ };
+ union {
+ int pebble;
+ X x;
union {
int qux;
unsigned int mux;
@@ -32,22 +32,23 @@ union Bar {
unsigned int y;
};
-Foo foo;
-Bar bar;
int main()
{
+ Foo foo = {0, 0};
+
foo.paper = 33;
foo.pebble = 44;
foo.mux = 55;
- bar.x = 33;
+ Bar bar = {0};
- union
- {
+ union {
int z;
unsigned int w;
- };
+ }; w = 0;
+
+ bar.x = 33;
w = 45;