Commit | Line | Data |
---|---|---|
406601a1 RC |
1 | #; $ as -o test.o gas-cfi-test.s && gcc -nostdlib -o test test.o |
2 | ||
3 | .text | |
4 | .align 4 | |
5 | .level 1.1 | |
6 | ||
7 | .globl func_locvars | |
8 | .type func_locvars, @function | |
9 | func_locvars: | |
10 | .PROC | |
11 | .CALLINFO FRAME=0x1234,NO_CALLS,SAVE_SP,ENTRY_GR=3 | |
12 | .ENTRY | |
13 | .cfi_startproc | |
14 | copy %r3,%r1 | |
15 | copy %r30,%r3 | |
16 | .cfi_def_cfa_register r3 | |
17 | stwm %r1,0x1234(%r30) | |
18 | .cfi_adjust_cfa_offset 0x1234 | |
19 | ldo 64(%r3),%r30 | |
20 | ldwm -64(%r30),%r3 | |
21 | .cfi_def_cfa_register sp | |
22 | bv,n %r0(%r2) | |
23 | .cfi_endproc | |
24 | .EXIT | |
25 | .PROCEND | |
26 | ||
27 | .globl func_prologue | |
28 | .type func_prologue, @function | |
29 | func_prologue: | |
30 | .PROC | |
31 | .CALLINFO FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3 | |
32 | .ENTRY | |
33 | .cfi_startproc | |
34 | #; This is not ABI-compliant but helps the test to run on both | |
35 | #; 32-bit and 64-bit targets | |
36 | stw %r2,-24(%r30) | |
37 | copy %r3,%r1 | |
38 | copy %r30,%r3 | |
39 | .cfi_def_cfa_register r3 | |
40 | .cfi_offset r2, -24 | |
41 | stwm %r1,64(%r30) | |
42 | bl func_locvars,%r2 | |
43 | nop | |
44 | ldw -20(%r3),%r2 | |
45 | ldo 64(%r3),%r30 | |
46 | ldwm -64(%r30),%r3 | |
47 | .cfi_def_cfa_register sp | |
48 | bv,n %r0(%r2) | |
49 | .cfi_endproc | |
50 | .EXIT | |
51 | .PROCEND | |
52 | ||
53 | .align 4 | |
54 | .globl main | |
55 | .type main, @function | |
56 | main: | |
57 | .PROC | |
58 | .CALLINFO CALLS | |
59 | .ENTRY | |
60 | #; tail call - simple function that doesn't touch the stack | |
61 | .cfi_startproc | |
62 | b func_prologue | |
63 | nop | |
64 | .cfi_endproc | |
65 | .EXIT | |
66 | .PROCEND |