xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/testsuite/gdb.mi/mi-sym-info-1.c (revision 32d1c65c71fbdb65a012e8392a62a757dd6853e9)
1 /* Copyright 2019-2023 Free Software Foundation, Inc.
2 
3    This file is part of GDB.
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 /* Function and variables declared in mi-sym-info-2.c.  */
19 extern float f2 (float arg);
20 extern int f3 (int arg);
21 extern int global_i2;
22 extern float global_f2;
23 
24 static int global_i1;
25 static float __attribute__ ((used)) global_f1;
26 
27 typedef int my_int_t;
28 
29 static my_int_t
30 f1 (int arg1, int arg2)
31 {
32   return arg1 + arg2;
33 }
34 
35 void
36 f4 (int *arg)
37 {
38   (*arg)++;
39 }
40 
41 int
42 main ()
43 {
44   int v = f3 (4);
45   f4 (&v);
46   float tmp = f2 (1.0);
47   return f1 (3, v) + ((int) tmp);
48 }
49