daily update
[external/binutils.git] / gdb / testsuite / gdb.arch / i386-unwind.c
1 /* Unwinder test program.
2
3    Copyright 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
4
5    This file is part of GDB.
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19
20 #ifdef SYMBOL_PREFIX
21 #define SYMBOL(str)     SYMBOL_PREFIX #str
22 #else
23 #define SYMBOL(str)     #str
24 #endif
25
26 void
27 trap (void)
28 {
29   asm ("int $0x03");
30 }
31
32 /* Make sure that main directly follows a function without an
33    epilogue.  */
34
35 asm(".text\n"
36     "    .align 8\n"
37     "    .globl gdb1435\n"
38     "gdb1435:\n"
39     "    pushl %ebp\n"
40     "    mov   %esp, %ebp\n"
41     "    call  " SYMBOL (trap) "\n"
42     "    .globl " SYMBOL (main) "\n"
43     SYMBOL (main) ":\n"
44     "    pushl %ebp\n"
45     "    mov   %esp, %ebp\n"
46     "    call  gdb1435\n");