gdb: Improve output from "info types" commad
[external/binutils.git] / gdb / testsuite / gdb.base / info-types.c
1 /* Copyright 2019 Free Software Foundation, Inc.
2
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
5    the Free Software Foundation; either version 3 of the License, or
6    (at your option) any later version.
7
8    This program is distributed in the hope that it will be useful,
9    but WITHOUT ANY WARRANTY; without even the implied warranty of
10    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11    GNU General Public License for more details.
12
13    You should have received a copy of the GNU General Public License
14    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
15
16 typedef int my_int_t;
17 typedef float my_float_t;
18 typedef my_int_t nested_int_t;
19 typedef my_float_t nested_float_t;
20
21 struct baz_t
22 {
23   float f;
24   double d;
25 };
26
27 typedef struct baz_t baz_t;
28 typedef struct baz_t baz;
29 typedef baz_t nested_baz_t;
30 typedef baz nested_baz;
31 typedef struct baz_t *baz_ptr;
32
33 enum enum_t
34 {
35  AA, BB, CC
36 };
37
38 typedef enum enum_t my_enum_t;
39 typedef my_enum_t nested_enum_t;
40
41 volatile int var_a;
42 volatile float var_b;
43 volatile my_int_t var_c;
44 volatile my_float_t var_d;
45 volatile nested_int_t var_e;
46 volatile nested_float_t var_f;
47 volatile struct baz_t var_g;
48 volatile baz_t var_h;
49 volatile baz var_i;
50 volatile nested_baz_t var_j;
51 volatile nested_baz var_k;
52 volatile baz_ptr var_l;
53 volatile enum enum_t var_m;
54 volatile my_enum_t var_n;
55 volatile nested_enum_t var_o;
56
57 #ifdef __cplusplus
58
59 class CL
60 {
61   int a;
62 };
63
64 typedef CL my_cl;
65 typedef CL *my_ptr;
66
67 volatile CL var_cpp_a;
68 volatile my_cl var_cpp_b;
69 volatile my_ptr var_cpp_c;
70
71 #endif /* __cplusplus */
72
73 int
74 main ()
75 {
76   asm ("" ::: "memory");
77   return 0;
78 }