Automatic Copyright Year update after running gdb/copyright.py
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.python / py-symbol.c
CommitLineData
f3e9a817
PM
1/* This testcase is part of GDB, the GNU debugger.
2
88b9d363 3 Copyright 2010-2022 Free Software Foundation, Inc.
f3e9a817
PM
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
47d48711 16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
f3e9a817
PM
17
18#ifdef __cplusplus
19class SimpleClass
20{
21 private:
22 int i;
23
24 public:
25 void seti (int arg)
26 {
27 i = arg;
28 }
29
30 int valueofi (void)
31 {
32 return i; /* Break in class. */
33 }
34};
2906593f
CB
35
36namespace {
71e1b6b0 37 int __attribute__ ((used)) anon = 10;
2906593f 38};
f3e9a817
PM
39#endif
40
09ff83af
AB
41#ifdef USE_TWO_FILES
42extern void function_in_other_file (void);
43#endif
44
f0823d2c 45int qq = 72; /* line of qq */
71e1b6b0 46static int __attribute__ ((used)) rr = 42; /* line of rr */
64e7d9dd 47
f3e9a817
PM
48int func (int arg)
49{
50 int i = 2;
ee0bf529
SCR
51 i = i * arg; /* Block break here. */
52 return arg;
f3e9a817
PM
53}
54
a20ee7a4
SCR
55struct simple_struct
56{
57 int a;
58};
59
f3e9a817
PM
60int main (int argc, char *argv[])
61{
62#ifdef __cplusplus
63 SimpleClass sclass;
64#endif
65 int a = 0;
66 int result;
a20ee7a4 67 struct simple_struct ss = { 10 };
f3e9a817
PM
68 enum tag {one, two, three};
69 enum tag t = one;
70
71 result = func (42);
72
73#ifdef __cplusplus
74 sclass.seti (42);
75 sclass.valueofi ();
76#endif
09ff83af
AB
77
78#ifdef USE_TWO_FILES
79 function_in_other_file ();
80#endif
81
f3e9a817
PM
82 return 0; /* Break at end. */
83}
This page took 1.524136 seconds and 4 git commands to generate.