Commit | Line | Data |
---|---|---|
a1dea79a FF |
1 | /* This testcase is part of GDB, the GNU debugger. |
2 | ||
0b302171 JB |
3 | Copyright 1992-1995, 1999, 2002-2003, 2007-2012 Free Software |
4 | Foundation, Inc. | |
a1dea79a FF |
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 | |
a9762ec7 | 8 | the Free Software Foundation; either version 3 of the License, or |
a1dea79a FF |
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. | |
a9762ec7 | 15 | |
a1dea79a | 16 | You should have received a copy of the GNU General Public License |
c7b778ff | 17 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
a1dea79a FF |
18 | |
19 | /* The code for this file was extracted from the gdb testsuite | |
20 | testcase "break.c". */ | |
21 | ||
87728fa0 DJ |
22 | /* A structure we use for field name completion tests. */ |
23 | struct some_struct | |
24 | { | |
25 | int a_field; | |
26 | int b_field; | |
9ae8282d | 27 | union { int z_field; }; |
87728fa0 DJ |
28 | }; |
29 | ||
30 | struct some_struct values[50]; | |
31 | ||
2f68a895 TT |
32 | /* Some definitions for tag completion. */ |
33 | enum some_enum { VALUE }; | |
34 | ||
35 | enum some_enum some_enum_global; | |
36 | ||
37 | union some_union | |
38 | { | |
39 | int f1; | |
40 | double f2; | |
41 | }; | |
42 | ||
43 | union some_union some_union_global; | |
44 | ||
45 | /* A variable with a name "similar" to the above struct, to test that | |
46 | tag completion works ok. */ | |
47 | int some_variable; | |
48 | ||
a1dea79a FF |
49 | /* The following functions do nothing useful. They are included |
50 | simply as places to try setting breakpoints at. They are | |
51 | explicitly "one-line functions" to verify that this case works | |
52 | (some versions of gcc have or have had problems with this). | |
53 | ||
54 | These functions are in a separate source file to prevent an | |
55 | optimizing compiler from inlining them and optimizing them away. */ | |
56 | ||
57 | #ifdef PROTOTYPES | |
58 | int marker1 (void) { return (0); } /* set breakpoint 15 here */ | |
59 | int marker2 (int a) { return (1); } /* set breakpoint 8 here */ | |
60 | void marker3 (char *a, char *b) {} /* set breakpoint 17 here */ | |
87728fa0 | 61 | void marker4 (long d) { values[0].a_field = d; } /* set breakpoint 14 here */ |
a1dea79a FF |
62 | #else |
63 | int marker1 () { return (0); } /* set breakpoint 16 here */ | |
64 | int marker2 (a) int a; { return (1); } /* set breakpoint 9 here */ | |
65 | void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */ | |
87728fa0 | 66 | void marker4 (d) long d; { values[0].a_field = d; } /* set breakpoint 13 here */ |
a1dea79a | 67 | #endif |