aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/anon.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base/anon.c')
-rw-r--r--gdb/testsuite/gdb.base/anon.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/anon.c b/gdb/testsuite/gdb.base/anon.c
new file mode 100644
index 0000000..ca86ce5
--- /dev/null
+++ b/gdb/testsuite/gdb.base/anon.c
@@ -0,0 +1,32 @@
+/* Test of anonymous union in a struct. */
+
+#include <string.h>
+
+struct outer
+{
+ int one;
+ int two;
+
+ struct
+ {
+ union {
+ int three : 3;
+ int four : 4;
+ };
+
+ union {
+ int five : 3;
+ int six : 4;
+ };
+ } data;
+};
+
+int main ()
+{
+ struct outer val;
+
+ memset (&val, 0, sizeof (val));
+ val.data.six = 6;
+
+ return 0; /* break here */
+}