]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.base/step-line.c
Copyright updates for 2007.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / step-line.c
CommitLineData
3207ec21 1/* Test step/next in presence of #line directives.
6aba47ca 2 Copyright 2001, 2007 Free Software Foundation, Inc.
3207ec21
KB
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 2 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, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21void dummy (int, int);
22int f1 (int);
23int f2 (int);
24
25int
26main (int argc, char **argv)
27{
28 int i;
29 i = f1 (4);
30 i = f1 (i);
31 dummy (0, i);
32 return 0;
33}
34
35int
36f1 (int i)
37{
38#line 40 "step-line.c"
39 dummy (1, i);
40#line 24 "step-line.inp"
41 i = f2 (i);
42#line 44 "step-line.c"
43 dummy (2, i);
44#line 25 "step-line.inp"
45 i = f2 (i);
46#line 48 "step-line.c"
47 dummy (3, i);
48#line 26 "step-line.inp"
49 return i;
50#line 52 "step-line.c"
51}
52
53int
54f2 (int i)
55{
56#line 31 "step-line.inp"
57 int j;
58#line 60 "step-line.c"
59 dummy (4, i);
60#line 32 "step-line.inp"
61 j = i;
62#line 64 "step-line.c"
63 dummy (5, i);
64 dummy (6, j);
65#line 33 "step-line.inp"
66 j = j + 1;
67#line 69 "step-line.c"
68 dummy (7, i);
69 dummy (8, j);
70#line 34 "step-line.inp"
71 j = j - i;
72#line 74 "step-line.c"
73 dummy (9, i);
74 dummy (10, j);
75#line 35 "step-line.inp"
76 return i;
77#line 79 "step-line.c"
78}
79
80void
81dummy (int num, int i)
82{
83}