]>
Commit | Line | Data |
---|---|---|
8be455d7 JK |
1 | /* This testcase is part of GDB, the GNU debugger. |
2 | ||
3 | Copyright 2011 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 | static volatile int v; | |
19 | ||
20 | asm ("func_start: .globl func_start\n"); | |
21 | static int | |
22 | func (void) | |
23 | { | |
24 | v++; | |
25 | asm ("func0: .globl func0\n"); | |
26 | v++; | |
27 | asm ("func1: .globl func1\n"); | |
28 | v++; | |
29 | asm ("func2: .globl func2\n"); | |
30 | v++; | |
31 | asm ("func3: .globl func3\n"); | |
32 | return v; | |
33 | } | |
34 | asm ("func_end: .globl func_end\n"); | |
35 | ||
36 | /* Equivalent copy but renamed s/func/fund/. */ | |
37 | ||
38 | asm ("fund_start: .globl fund_start\n"); | |
39 | static int | |
40 | fund (void) | |
41 | { | |
42 | v++; | |
43 | asm ("fund0: .globl fund0\n"); | |
44 | v++; | |
45 | asm ("fund1: .globl fund1\n"); | |
46 | v++; | |
47 | asm ("fund2: .globl fund2\n"); | |
48 | v++; | |
49 | asm ("fund3: .globl fund3\n"); | |
50 | return v; | |
51 | } | |
52 | asm ("fund_end: .globl fund_end\n"); | |
53 | ||
54 | int | |
55 | main (void) | |
56 | { | |
57 | return func () + fund (); | |
58 | } |