]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.guile/scm-symbol.c
55d332e69df09e928dc4e722793bbeb9b680dc16
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.guile / scm-symbol.c
1 /* This testcase is part of GDB, the GNU debugger.
2
3 Copyright 2010-2023 Free Software Foundation, Inc.
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
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17
18 #ifdef __cplusplus
19 class 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 };
35 #endif
36
37 int qq = 72; /* line of qq */
38
39 int func (int arg)
40 {
41 int i = 2;
42 i = i * arg; /* Block break here. */
43 return arg;
44 }
45
46 struct simple_struct
47 {
48 int a;
49 };
50
51 int main (int argc, char *argv[])
52 {
53 #ifdef __cplusplus
54 SimpleClass sclass;
55 #endif
56 int a = 0;
57 int result;
58 struct simple_struct ss = { 10 };
59 enum tag {one, two, three};
60 enum tag t = one;
61
62 result = func (42);
63
64 #ifdef __cplusplus
65 sclass.seti (42);
66 sclass.valueofi ();
67 #endif
68 return 0; /* Break at end. */
69 }