Commit | Line | Data |
---|---|---|
43691ca1 PL |
1 | /* This testcase is part of GDB, the GNU debugger. |
2 | ||
3 | Copyright 2011-2015 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 SYMBOL_PREFIX | |
19 | #define SYMBOL(str) SYMBOL_PREFIX #str | |
20 | #else | |
21 | #define SYMBOL(str) #str | |
22 | #endif | |
23 | ||
24 | int globvar; | |
25 | ||
26 | static void | |
27 | begin (void) | |
28 | { | |
29 | } | |
30 | ||
31 | /* Called from asm. */ | |
32 | static void __attribute__((used)) | |
33 | func (void) | |
34 | { | |
35 | } | |
36 | ||
37 | static void | |
38 | marker (int anarg) | |
39 | { | |
40 | /* `set_point' is the label at which to set a fast tracepoint. The | |
41 | insn at the label must be large enough to fit a fast tracepoint | |
42 | jump. */ | |
43 | asm (" .global " SYMBOL (set_point) "\n" | |
44 | SYMBOL (set_point) ":\n" | |
45 | #if (defined __x86_64__ || defined __i386__) | |
46 | " call " SYMBOL (func) "\n" | |
7041adf4 PL |
47 | #elif (defined __aarch64__) |
48 | " nop\n" | |
43691ca1 PL |
49 | #endif |
50 | ); | |
51 | } | |
52 | ||
53 | static void | |
54 | end (void) | |
55 | { | |
56 | } | |
57 | ||
58 | int | |
59 | main () | |
60 | { | |
61 | begin (); | |
62 | ||
63 | for (globvar = 1; globvar < 11; ++globvar) | |
64 | marker (globvar * 100); | |
65 | ||
66 | end (); | |
67 | return 0; | |
68 | } |