OLD | NEW |
1 /* Copyright 2006-2012 Free Software Foundation, Inc. | 1 /* Copyright 2006-2012 Free Software Foundation, Inc. |
2 | 2 |
3 This program is free software; you can redistribute it and/or modify | 3 This program is free software; you can redistribute it and/or modify |
4 it under the terms of the GNU General Public License as published by | 4 it under the terms of the GNU General Public License as published by |
5 the Free Software Foundation; either version 3 of the License, or | 5 the Free Software Foundation; either version 3 of the License, or |
6 (at your option) any later version. | 6 (at your option) any later version. |
7 | 7 |
8 This program is distributed in the hope that it will be useful, | 8 This program is distributed in the hope that it will be useful, |
9 but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 {A.3 3 0 int}} "list children of A" | 198 {A.3 3 0 int}} "list children of A" |
199 mi_gdb_test "-var-info-path-expression A.2" \ | 199 mi_gdb_test "-var-info-path-expression A.2" \ |
200 "\\^done,path_expr=\"\\(array\\)\\\[2\\\]\"" \ | 200 "\\^done,path_expr=\"\\(array\\)\\\[2\\\]\"" \ |
201 "-var-info-path-expression A.2" | 201 "-var-info-path-expression A.2" |
202 :*/ | 202 :*/ |
203 | 203 |
204 return 99; | 204 return 99; |
205 /*: END: path_expression :*/ | 205 /*: END: path_expression :*/ |
206 } | 206 } |
207 | 207 |
| 208 class Anonymous |
| 209 { |
| 210 public: |
| 211 struct { /* index: 0 */ |
| 212 int b; |
| 213 }; |
| 214 struct { /* index: 1 */ |
| 215 int c; |
| 216 }; |
| 217 struct { /* index: 2 */ |
| 218 int d; |
| 219 struct { /* index: 1 */ |
| 220 int e; |
| 221 struct { /* index: 0 */ |
| 222 int f; |
| 223 union { /* index: 0 */ |
| 224 int g; |
| 225 char h; |
| 226 }; |
| 227 }; |
| 228 union { /* index: 0 */ |
| 229 int i; |
| 230 char j; |
| 231 }; |
| 232 }; |
| 233 }; |
| 234 }; |
| 235 |
| 236 /* Test anonymous structs and unions. */ |
| 237 int |
| 238 anonymous_structs_and_unions (void) |
| 239 { |
| 240 Anonymous a; |
| 241 a.b = 1; |
| 242 a.c = 2; |
| 243 a.d = 3; |
| 244 a.e = 4; |
| 245 a.f = 5; |
| 246 a.g = 6; |
| 247 a.h = '7'; |
| 248 a.i = 8; |
| 249 a.j = '8'; |
| 250 return 0; /* anonymous_structs_and_unions */ |
| 251 } |
| 252 |
208 int main () | 253 int main () |
209 { | 254 { |
210 reference_update_tests (); | 255 reference_update_tests (); |
211 base_in_reference_test_main (); | 256 base_in_reference_test_main (); |
212 reference_to_pointer (); | 257 reference_to_pointer (); |
213 reference_to_struct (); | 258 reference_to_struct (); |
214 path_expression (); | 259 path_expression (); |
| 260 anonymous_structs_and_unions (); |
215 return 0; | 261 return 0; |
216 } | 262 } |
OLD | NEW |