Index: gdb/testsuite/gdb.mi/mi-var-cp.cc |
diff --git a/gdb/testsuite/gdb.mi/mi-var-cp.cc b/gdb/testsuite/gdb.mi/mi-var-cp.cc |
index f23913b13bb1e50d9a4df7ca151a3baf01933ec6..abdee9f67741756fee36f2b02077912e3d67253b 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; |
} |