55a4c64449283066c9af1e74b764349bf683e854
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.mi / basics.c
1 /* Copyright 1999, 2000, 2004, 2007, 2008, 2009, 2010, 2011
2 Free Software Foundation, Inc.
3
4 This file is part of GDB.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18
19 /*
20 * This simple program that passes different types of arguments
21 * on function calls. Useful to test printing frames, stepping, etc.
22 */
23
24 int callee4 (void)
25 {
26 int A=1;
27 int B=2;
28 int C;
29
30 C = A + B;
31 return 0;
32 }
33 callee3 (char *strarg)
34 {
35 callee4 ();
36 }
37
38 callee2 (int intarg, char *strarg)
39 {
40 callee3 (strarg);
41 }
42
43 callee1 (int intarg, char *strarg, double fltarg)
44 {
45 callee2 (intarg, strarg);
46 }
47
48 void callme (int i)
49 {
50 }
51
52 int return_1 ()
53 {
54 return 1;
55 }
56
57 void do_nothing (void)
58 {
59 }
60
61 main ()
62 {
63 callee1 (2, "A string argument.", 3.5);
64 callee1 (2, "A string argument.", 3.5);
65
66 do_nothing (); /* Hello, World! */
67
68 callme (1);
69 callme (2);
70
71 return 0;
72 }
This page took 0.047408 seconds and 4 git commands to generate.