3725640a02356edf24f0a9e0287b88e51dcc5385
[platform/upstream/gdb.git] / gdb / testsuite / gdb.arch / i386-cfi-notcurrent.S
1 /* Copyright 2012-2014 Free Software Foundation, Inc.
2
3    This file is part of GDB.
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 /* Testcase compiled by gcc -m32 -S -fasynchronous-unwind-tables -O2:
19
20 static int __attribute__ ((regparm (0), stdcall, noinline, noclone))
21 f (int x)
22 {
23   return x;
24 }
25 static int __attribute__ ((noinline, noclone))
26 g (void)
27 {
28   return f (1) + 1;
29 }
30 int
31 main (void)
32 {
33   return g () + 1;
34 }
35
36  */
37
38         .text
39         .type   f, @function
40 f:
41 .LFB0:
42         .cfi_startproc
43         movl    4(%esp), %eax
44         ret     $4
45         .cfi_endproc
46 .LFE0:
47         .size   f, .-f
48         .type   g, @function
49 g:
50 .LFB1:
51         .cfi_startproc
52         subl    $4, %esp
53         .cfi_def_cfa_offset 8
54         movl    $1, (%esp)
55         call    f
56         .cfi_def_cfa_offset 4
57         subl    $4, %esp
58         .cfi_def_cfa_offset 8
59         addl    $1, %eax
60         addl    $4, %esp
61         .cfi_def_cfa_offset 4
62         ret
63         .cfi_endproc
64 .LFE1:
65         .size   g, .-g
66         .globl  main
67         .type   main, @function
68 main:
69 .LFB2:
70         .cfi_startproc
71         call    g
72         addl    $1, %eax
73         ret
74         .cfi_endproc
75 .LFE2:
76         .size   main, .-main