Remove path name from test case
[binutils-gdb.git] / gas / testsuite / gas / cfi / cfi-i386.s
1 .text
2 .arch generic32
3
4 #; func_locvars
5 #; - function with a space on the stack
6 #; allocated for local variables
7
8 func_locvars:
9 .cfi_startproc
10
11 #; alocate space for local vars
12 sub $0x1234,%esp
13 .cfi_adjust_cfa_offset 0x1234
14
15 #; dummy body
16 movl $1,%eax
17
18 #; release space of local vars and return
19 add $0x1234,%esp
20 .cfi_adjust_cfa_offset -0x1234
21 ret
22 .cfi_endproc
23
24 #; func_prologue
25 #; - functions that begins with standard
26 #; prologue: "pushq %rbp; movq %rsp,%rbp"
27
28 func_prologue:
29 .cfi_startproc
30
31 #; prologue, CFI is valid after
32 #; each instruction.
33 pushl %ebp
34 .cfi_def_cfa_offset 8
35 .cfi_offset ebp,-8
36 movl %esp, %ebp
37 .cfi_def_cfa_register ebp
38
39 #; function body
40 call func_locvars
41 addl $3, %eax
42
43 #; epilogue with valid CFI
44 #; (we're better than gcc :-)
45 leave
46 .cfi_def_cfa_register esp
47 ret
48 .cfi_endproc
49
50 #; func_otherreg
51 #; - function that moves frame pointer to
52 #; another register (ebx) and then allocates
53 #; a space for local variables
54
55 func_otherreg:
56 .cfi_startproc
57
58 #; save frame pointer to ebx
59 mov %esp,%ebx
60 .cfi_def_cfa_register ebx
61
62 #; alocate space for local vars
63 #; (no .cfi_{def,adjust}_cfa_offset here,
64 #; because CFA is computed from ebx!)
65 sub $100,%esp
66
67 #; function body
68 call func_prologue
69 add $2, %eax
70
71 #; restore frame pointer from ebx
72 mov %ebx,%esp
73 .cfi_def_cfa esp,4
74 ret
75 .cfi_endproc
76
77 #; main
78 #; - typical function
79 main:
80 .cfi_startproc
81
82 #; only function body that doesn't
83 #; touch the stack at all.
84 call func_otherreg
85
86 #; return
87 ret
88 .cfi_endproc
89
90 #; _start
91 #; - standard entry point
92
93 .globl _start
94 _start:
95 .cfi_startproc
96 call main
97 movl %eax,%edi
98 movl $0x1,%eax
99 int $0x80
100 hlt
101 .cfi_endproc
102
103 #; func_all_registers
104 #; - test for all .cfi register numbers.
105 #; This function is never called and the CFI info doesn't make sense.
106
107 func_all_registers:
108 .cfi_startproc simple
109
110 .cfi_undefined eip ; nop
111 .cfi_undefined eax ; nop
112 .cfi_undefined ecx ; nop
113 .cfi_undefined edx ; nop
114 .cfi_undefined ebx ; nop
115 .cfi_undefined esp ; nop
116 .cfi_undefined ebp ; nop
117 .cfi_undefined esi ; nop
118 .cfi_undefined edi ; nop
119 .cfi_undefined eflags ; nop
120
121 .cfi_undefined es ; nop
122 .cfi_undefined cs ; nop
123 .cfi_undefined ds ; nop
124 .cfi_undefined ss ; nop
125 .cfi_undefined fs ; nop
126 .cfi_undefined gs ; nop
127 .cfi_undefined tr ; nop
128 .cfi_undefined ldtr ; nop
129
130 .cfi_undefined mxcsr ; nop
131 .cfi_undefined xmm0 ; nop
132 .cfi_undefined xmm1 ; nop
133 .cfi_undefined xmm2 ; nop
134 .cfi_undefined xmm3 ; nop
135 .cfi_undefined xmm4 ; nop
136 .cfi_undefined xmm5 ; nop
137 .cfi_undefined xmm6 ; nop
138 .cfi_undefined xmm7 ; nop
139
140 .cfi_undefined fcw ; nop
141 .cfi_undefined fsw ; nop
142 .cfi_undefined st ; nop
143 .cfi_undefined st(1) ; nop
144 .cfi_undefined st(2) ; nop
145 .cfi_undefined st(3) ; nop
146 .cfi_undefined st(4) ; nop
147 .cfi_undefined st(5) ; nop
148 .cfi_undefined st(6) ; nop
149 .cfi_undefined st(7) ; nop
150
151 .cfi_undefined mm0 ; nop
152 .cfi_undefined mm1 ; nop
153 .cfi_undefined mm2 ; nop
154 .cfi_undefined mm3 ; nop
155 .cfi_undefined mm4 ; nop
156 .cfi_undefined mm5 ; nop
157 .cfi_undefined mm6 ; nop
158 .cfi_undefined mm7 ; nop
159
160 .cfi_undefined k0 ; nop
161 .cfi_undefined k1 ; nop
162 .cfi_undefined k2 ; nop
163 .cfi_undefined k3 ; nop
164 .cfi_undefined k4 ; nop
165 .cfi_undefined k5 ; nop
166 .cfi_undefined k6 ; nop
167 .cfi_undefined k7 ; nop
168
169 .cfi_endproc