1
2# TEST-OPTIONS:  unwind_test_main.c unwind_test_x86.s -arch i386 -fexceptions -DUSE_COMPACT_UNWIND=1
3# TEST-OPTIONS:  unwind_test_main.c unwind_test_x86.s -arch i386 -fexceptions -DUSE_EH_FRAME=1
4# TEST-OPTIONS:  unwind_test_main.c unwind_test_x86.s -arch i386 -fexceptions -DUSE_COMPACT_UNWIND=1 -DUSE_EH_FRAME=1
5# TEST-OPTIONS:  unwind_test_main.c unwind_test_x86.s -arch i386 -fexceptions -DUSE_EH_FRAME=1 -Wl,-no_compact_unwind
6
7
8	.data
9.globl _unwind_tester_list
10_unwind_tester_list:
11	.long	_test_no_reg
12	.long	_test_ebx
13	.long	_test_esi
14	.long	_test_edi
15	.long	_test_ebx_esi
16	.long	_test_esi_edi
17	.long	_test_ebx_edi
18	.long	_test_ebx_esi_edi
19	.long	_test_edi_esi_ebx
20	.long	_test_pad_ebx_edi
21	.long	0
22
23
24	.text
25
26.globl _test_ebx
27_test_ebx:
28LFB13:
29	pushl	%ebp
30LCFI2:
31	movl	%esp, %ebp
32LCFI3:
33	pushl	%ebx
34LCFI4:
35	subl	$20, %esp
36LCFI5:
37	movl	$0, %ebx
38	call	_uwind_to_main
39	addl	$20, %esp
40	popl	%ebx
41	leave
42	ret
43LFE13:
44
45.globl _test_no_reg
46_test_no_reg:
47LFB12:
48	pushl	%ebp
49LCFI6:
50	movl	%esp, %ebp
51LCFI7:
52	subl	$24, %esp
53LCFI8:
54	call	_uwind_to_main
55	leave
56	ret
57LFE12:
58
59.globl _test_esi
60_test_esi:
61LFB10:
62	pushl	%ebp
63LCFI13:
64	movl	%esp, %ebp
65LCFI14:
66	pushl	%esi
67LCFI15:
68	subl	$20, %esp
69LCFI16:
70	movl	$0, %esi
71	call	_uwind_to_main
72	addl	$20, %esp
73	popl	%esi
74	leave
75	ret
76LFE10:
77
78.globl _test_edi
79_test_edi:
80LFB11:
81	pushl	%ebp
82LCFI9:
83	movl	%esp, %ebp
84LCFI10:
85	pushl	%edi
86LCFI11:
87	subl	$20, %esp
88LCFI12:
89	movl	$0, %edi
90	call	_uwind_to_main
91	addl	$20, %esp
92	popl	%edi
93	leave
94	ret
95LFE11:
96
97.globl _test_ebx_esi
98_test_ebx_esi:
99LFB9:
100	pushl	%ebp
101LCFI17:
102	movl	%esp, %ebp
103LCFI18:
104	subl	$24, %esp
105LCFI19:
106	movl	%ebx, -8(%ebp)
107LCFI20:
108	movl	%esi, -4(%ebp)
109LCFI21:
110	movl	$0, %ebx
111	movl	$0, %esi
112	call	_uwind_to_main
113	movl	-8(%ebp), %ebx
114	movl	-4(%ebp), %esi
115	leave
116	ret
117LFE9:
118
119
120.globl _test_esi_edi
121_test_esi_edi:
122LFB8:
123	pushl	%ebp
124LCFI22:
125	movl	%esp, %ebp
126LCFI23:
127	subl	$24, %esp
128LCFI24:
129	movl	%esi, -8(%ebp)
130LCFI25:
131	movl	%edi, -4(%ebp)
132LCFI26:
133	movl	$0, %edi
134	movl	$0, %esi
135	call	_uwind_to_main
136	movl	-8(%ebp), %esi
137	movl	-4(%ebp), %edi
138	leave
139	ret
140LFE8:
141
142.globl _test_ebx_edi
143_test_ebx_edi:
144LFB91:
145	pushl	%ebp
146LCFI171:
147	movl	%esp, %ebp
148LCFI181:
149	subl	$24, %esp
150LCFI191:
151	movl	%ebx, -8(%ebp)
152LCFI201:
153	movl	%edi, -4(%ebp)
154LCFI211:
155	movl	$0, %ebx
156	movl	$0, %edi
157	call	_uwind_to_main
158	movl	-8(%ebp), %ebx
159	movl	-4(%ebp), %edi
160	leave
161	ret
162LFE91:
163
164.globl _test_ebx_esi_edi
165_test_ebx_esi_edi:
166LFB7:
167	pushl	%ebp
168LCFI27:
169	movl	%esp, %ebp
170LCFI28:
171	subl	$40, %esp
172LCFI29:
173	movl	%ebx, -12(%ebp)
174LCFI30:
175	movl	%esi, -8(%ebp)
176LCFI31:
177	movl	%edi, -4(%ebp)
178LCFI32:
179	movl	$0, %ebx
180	movl	$0, %edi
181	movl	$0, %esi
182	call	_uwind_to_main
183	movl	-12(%ebp), %ebx
184	movl	-8(%ebp), %esi
185	movl	-4(%ebp), %edi
186	leave
187	ret
188LFE7:
189
190
191.globl _test_edi_esi_ebx
192_test_edi_esi_ebx:
193LFB7a:
194	pushl	%ebp
195LCFI27a:
196	movl	%esp, %ebp
197LCFI28a:
198	subl	$40, %esp
199LCFI29a:
200	movl	%edi, -12(%ebp)
201LCFI30a:
202	movl	%esi, -8(%ebp)
203LCFI31a:
204	movl	%ebx, -4(%ebp)
205LCFI32a:
206	movl	$0, %ebx
207	movl	$0, %esi
208	movl	$0, %edi
209	call	_uwind_to_main
210	movl	-12(%ebp), %edi
211	movl	-8(%ebp), %esi
212	movl	-4(%ebp), %ebx
213	leave
214	ret
215LFE7a:
216
217
218
219.globl _test_pad_ebx_edi
220_test_pad_ebx_edi:
221LFB91a:
222	pushl	%ebp
223LCFI171a:
224	movl	%esp, %ebp
225LCFI181a:
226	subl	$88, %esp
227LCFI191a:
228	movl	%ebx, -72(%ebp)
229LCFI201a:
230	movl	%edi, -68(%ebp)
231LCFI211a:
232	movl	$0, %ebx
233	movl	$0, %edi
234	call	_uwind_to_main
235	movl	-72(%ebp), %ebx
236	movl	-68(%ebp), %edi
237	leave
238	ret
239LFE91a:
240
241
242#if USE_EH_FRAME
243	.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
244EH_frame1:
245	.set L$set$0,LECIE1-LSCIE1
246	.long L$set$0	# Length of Common Information Entry
247LSCIE1:
248	.long	0x0	# CIE Identifier Tag
249	.byte	0x1	# CIE Version
250	.ascii "zR\0"	# CIE Augmentation
251	.byte	0x1	# uleb128 0x1; CIE Code Alignment Factor
252	.byte	0x7c	# sleb128 -4; CIE Data Alignment Factor
253	.byte	0x8	# CIE RA Column
254	.byte	0x1	# uleb128 0x1; Augmentation size
255	.byte	0x10	# FDE Encoding (pcrel)
256	.byte	0xc	# DW_CFA_def_cfa
257	.byte	0x5	# uleb128 0x5
258	.byte	0x4	# uleb128 0x4
259	.byte	0x88	# DW_CFA_offset, column 0x8
260	.byte	0x1	# uleb128 0x1
261	.align 2
262LECIE1:
263
264
265.globl _test_no_reg.eh
266_test_no_reg.eh:
267LSFDE5:
268	.set L$set$6,LEFDE5-LASFDE5
269	.long L$set$6	# FDE Length
270LASFDE5:
271	.long	LASFDE5-EH_frame1	# FDE CIE offset
272	.long	LFB12-.	# FDE initial location
273	.set L$set$7,LFE12-LFB12
274	.long L$set$7	# FDE address range
275	.byte	0x0	# uleb128 0x0; Augmentation size
276	.byte	0x4	# DW_CFA_advance_loc4
277	.set L$set$8,LCFI6-LFB12
278	.long L$set$8
279	.byte	0xe	# DW_CFA_def_cfa_offset
280	.byte	0x8	# uleb128 0x8
281	.byte	0x84	# DW_CFA_offset, column 0x4
282	.byte	0x2	# uleb128 0x2
283	.byte	0x4	# DW_CFA_advance_loc4
284	.set L$set$9,LCFI7-LCFI6
285	.long L$set$9
286	.byte	0xd	# DW_CFA_def_cfa_register
287	.byte	0x4	# uleb128 0x4
288	.align 2
289LEFDE5:
290
291
292.globl _test_ebx.eh
293_test_ebx.eh:
294LSFDE3:
295	.set L$set$1,LEFDE3-LASFDE3
296	.long L$set$1	# FDE Length
297LASFDE3:
298	.long	LASFDE3-EH_frame1	# FDE CIE offset
299	.long	LFB13-.	# FDE initial location
300	.set L$set$2,LFE13-LFB13
301	.long L$set$2	# FDE address range
302	.byte	0x0	# uleb128 0x0; Augmentation size
303	.byte	0x4	# DW_CFA_advance_loc4
304	.set L$set$3,LCFI2-LFB13
305	.long L$set$3
306	.byte	0xe	# DW_CFA_def_cfa_offset
307	.byte	0x8	# uleb128 0x8
308	.byte	0x84	# DW_CFA_offset, column 0x4
309	.byte	0x2	# uleb128 0x2
310	.byte	0x4	# DW_CFA_advance_loc4
311	.set L$set$4,LCFI3-LCFI2
312	.long L$set$4
313	.byte	0xd	# DW_CFA_def_cfa_register
314	.byte	0x4	# uleb128 0x4
315	.byte	0x4	# DW_CFA_advance_loc4
316	.set L$set$5,LCFI5-LCFI3
317	.long L$set$5
318	.byte	0x83	# DW_CFA_offset, column 0x3
319	.byte	0x3	# uleb128 0x3
320	.align 2
321LEFDE3:
322
323
324.globl _test_esi.eh
325_test_esi.eh:
326LSFDE9:
327	.set L$set$15,LEFDE9-LASFDE9
328	.long L$set$15	# FDE Length
329LASFDE9:
330	.long	LASFDE9-EH_frame1	# FDE CIE offset
331	.long	LFB10-.	# FDE initial location
332	.set L$set$16,LFE10-LFB10
333	.long L$set$16	# FDE address range
334	.byte	0x0	# uleb128 0x0; Augmentation size
335	.byte	0x4	# DW_CFA_advance_loc4
336	.set L$set$17,LCFI13-LFB10
337	.long L$set$17
338	.byte	0xe	# DW_CFA_def_cfa_offset
339	.byte	0x8	# uleb128 0x8
340	.byte	0x84	# DW_CFA_offset, column 0x4
341	.byte	0x2	# uleb128 0x2
342	.byte	0x4	# DW_CFA_advance_loc4
343	.set L$set$18,LCFI14-LCFI13
344	.long L$set$18
345	.byte	0xd	# DW_CFA_def_cfa_register
346	.byte	0x4	# uleb128 0x4
347	.byte	0x4	# DW_CFA_advance_loc4
348	.set L$set$19,LCFI16-LCFI14
349	.long L$set$19
350	.byte	0x86	# DW_CFA_offset, column 0x6
351	.byte	0x3	# uleb128 0x3
352	.align 2
353LEFDE9:
354
355
356.globl _test_edi.eh
357_test_edi.eh:
358LSFDE10:
359	.set L$set$15a,LEFDE10-LASFDE10
360	.long L$set$15a	# FDE Length
361LASFDE10:
362	.long	LASFDE10-EH_frame1	# FDE CIE offset
363	.long	LFB11-.	# FDE initial location
364	.set L$set$16a,LFE11-LFB11
365	.long L$set$16a	# FDE address range
366	.byte	0x0	# uleb128 0x0; Augmentation size
367	.byte	0x4	# DW_CFA_advance_loc4
368	.set L$set$17a,LCFI9-LFB11
369	.long L$set$17a
370	.byte	0xe	# DW_CFA_def_cfa_offset
371	.byte	0x8	# uleb128 0x8
372	.byte	0x84	# DW_CFA_offset, column 0x4
373	.byte	0x2	# uleb128 0x2
374	.byte	0x4	# DW_CFA_advance_loc4
375	.set L$set$18a,LCFI10-LCFI9
376	.long L$set$18a
377	.byte	0xd	# DW_CFA_def_cfa_register
378	.byte	0x4	# uleb128 0x4
379	.byte	0x4	# DW_CFA_advance_loc4
380	.set L$set$19a,LCFI12-LCFI10
381	.long L$set$19a
382	.byte	0x87	# DW_CFA_offset, column 0x7
383	.byte	0x3	# uleb128 0x3
384	.align 2
385LEFDE10:
386
387.globl _test_ebx_esi.eh
388_test_ebx_esi.eh:
389LSFDE11:
390	.set L$set$20,LEFDE11-LASFDE11
391	.long L$set$20	# FDE Length
392LASFDE11:
393	.long	LASFDE11-EH_frame1	# FDE CIE offset
394	.long	LFB9-.	# FDE initial location
395	.set L$set$21,LFE9-LFB9
396	.long L$set$21	# FDE address range
397	.byte	0x0	# uleb128 0x0; Augmentation size
398	.byte	0x4	# DW_CFA_advance_loc4
399	.set L$set$22,LCFI17-LFB9
400	.long L$set$22
401	.byte	0xe	# DW_CFA_def_cfa_offset
402	.byte	0x8	# uleb128 0x8
403	.byte	0x84	# DW_CFA_offset, column 0x4
404	.byte	0x2	# uleb128 0x2
405	.byte	0x4	# DW_CFA_advance_loc4
406	.set L$set$23,LCFI18-LCFI17
407	.long L$set$23
408	.byte	0xd	# DW_CFA_def_cfa_register
409	.byte	0x4	# uleb128 0x4
410	.byte	0x4	# DW_CFA_advance_loc4
411	.set L$set$24,LCFI21-LCFI18
412	.long L$set$24
413	.byte	0x86	# DW_CFA_offset, column 0x6
414	.byte	0x3	# uleb128 0x3
415	.byte	0x83	# DW_CFA_offset, column 0x3
416	.byte	0x4	# uleb128 0x4
417	.align 2
418LEFDE11:
419
420.globl _test_esi_edi.eh
421_test_esi_edi.eh:
422LSFDE13:
423	.set L$set$25,LEFDE13-LASFDE13
424	.long L$set$25	# FDE Length
425LASFDE13:
426	.long	LASFDE13-EH_frame1	# FDE CIE offset
427	.long	LFB8-.	# FDE initial location
428	.set L$set$26,LFE8-LFB8
429	.long L$set$26	# FDE address range
430	.byte	0x0	# uleb128 0x0; Augmentation size
431	.byte	0x4	# DW_CFA_advance_loc4
432	.set L$set$27,LCFI22-LFB8
433	.long L$set$27
434	.byte	0xe	# DW_CFA_def_cfa_offset
435	.byte	0x8	# uleb128 0x8
436	.byte	0x84	# DW_CFA_offset, column 0x4
437	.byte	0x2	# uleb128 0x2
438	.byte	0x4	# DW_CFA_advance_loc4
439	.set L$set$28,LCFI23-LCFI22
440	.long L$set$28
441	.byte	0xd	# DW_CFA_def_cfa_register
442	.byte	0x4	# uleb128 0x4
443	.byte	0x4	# DW_CFA_advance_loc4
444	.set L$set$29,LCFI26-LCFI23
445	.long L$set$29
446	.byte	0x87	# DW_CFA_offset, column 0x7
447	.byte	0x3	# uleb128 0x3
448	.byte	0x86	# DW_CFA_offset, column 0x6
449	.byte	0x4	# uleb128 0x4
450	.align 2
451LEFDE13:
452
453.globl _test_ebx_edi.eh
454_test_ebx_edi.eh:
455LSFDE111:
456	.set L$set$20a,LEFDE11-LASFDE11
457	.long L$set$20a	# FDE Length
458LASFDE111:
459	.long	LASFDE111-EH_frame1	# FDE CIE offset
460	.long	LFB91-.	# FDE initial location
461	.set L$set$21a,LFE91-LFB91
462	.long L$set$21a	# FDE address range
463	.byte	0x0	# uleb128 0x0; Augmentation size
464	.byte	0x4	# DW_CFA_advance_loc4
465	.set L$set$22a,LCFI171-LFB91
466	.long L$set$22a
467	.byte	0xe	# DW_CFA_def_cfa_offset
468	.byte	0x8	# uleb128 0x8
469	.byte	0x84	# DW_CFA_offset, column 0x4
470	.byte	0x2	# uleb128 0x2
471	.byte	0x4	# DW_CFA_advance_loc4
472	.set L$set$23a,LCFI181-LCFI171
473	.long L$set$23a
474	.byte	0xd	# DW_CFA_def_cfa_register
475	.byte	0x4	# uleb128 0x4
476	.byte	0x4	# DW_CFA_advance_loc4
477	.set L$set$24a,LCFI211-LCFI181
478	.long L$set$24a
479	.byte	0x87	# DW_CFA_offset, column 0x7
480	.byte	0x3	# uleb128 0x3
481	.byte	0x83	# DW_CFA_offset, column 0x3
482	.byte	0x4	# uleb128 0x4
483	.align 2
484LEFDE111:
485
486.globl _test_ebx_esi_edi.eh
487_test_ebx_esi_edi.eh:
488LSFDE15:
489	.set L$set$30,LEFDE15-LASFDE15
490	.long L$set$30	# FDE Length
491LASFDE15:
492	.long	LASFDE15-EH_frame1	# FDE CIE offset
493	.long	LFB7-.	# FDE initial location
494	.set L$set$31,LFE7-LFB7
495	.long L$set$31	# FDE address range
496	.byte	0x0	# uleb128 0x0; Augmentation size
497	.byte	0x4	# DW_CFA_advance_loc4
498	.set L$set$32,LCFI27-LFB7
499	.long L$set$32
500	.byte	0xe	# DW_CFA_def_cfa_offset
501	.byte	0x8	# uleb128 0x8
502	.byte	0x84	# DW_CFA_offset, column 0x4
503	.byte	0x2	# uleb128 0x2
504	.byte	0x4	# DW_CFA_advance_loc4
505	.set L$set$33,LCFI28-LCFI27
506	.long L$set$33
507	.byte	0xd	# DW_CFA_def_cfa_register
508	.byte	0x4	# uleb128 0x4
509	.byte	0x4	# DW_CFA_advance_loc4
510	.set L$set$34,LCFI32-LCFI28
511	.long L$set$34
512	.byte	0x87	# DW_CFA_offset, column 0x7
513	.byte	0x3	# uleb128 0x3
514	.byte	0x86	# DW_CFA_offset, column 0x6
515	.byte	0x4	# uleb128 0x4
516	.byte	0x83	# DW_CFA_offset, column 0x3
517	.byte	0x5	# uleb128 0x5
518	.align 2
519LEFDE15:
520
521
522.globl _test_edi_esi_ebx.eh
523_test_edi_esi_ebx.eh:
524LSFDE15a:
525	.set L$set$30a,LEFDE15a-LASFDE15a
526	.long L$set$30a	# FDE Length
527LASFDE15a:
528	.long	LASFDE15a-EH_frame1	# FDE CIE offset
529	.long	LFB7a-.	# FDE initial location
530	.set L$set$31a,LFE7a-LFB7a
531	.long L$set$31a	# FDE address range
532	.byte	0x0	# uleb128 0x0; Augmentation size
533	.byte	0x4	# DW_CFA_advance_loc4
534	.set L$set$32a,LCFI27a-LFB7a
535	.long L$set$32a
536	.byte	0xe	# DW_CFA_def_cfa_offset
537	.byte	0x8	# uleb128 0x8
538	.byte	0x84	# DW_CFA_offset, column 0x4
539	.byte	0x2	# uleb128 0x2
540	.byte	0x4	# DW_CFA_advance_loc4
541	.set L$set$33a,LCFI28a-LCFI27a
542	.long L$set$33a
543	.byte	0xd	# DW_CFA_def_cfa_register
544	.byte	0x4	# uleb128 0x4
545	.byte	0x4	# DW_CFA_advance_loc4
546	.set L$set$34a,LCFI32a-LCFI28a
547	.long L$set$34a
548	.byte	0x83	# DW_CFA_offset, column 0x3
549	.byte	0x3	# uleb128 0x3
550	.byte	0x86	# DW_CFA_offset, column 0x6
551	.byte	0x4	# uleb128 0x4
552	.byte	0x87	# DW_CFA_offset, column 0x7
553	.byte	0x5	# uleb128 0x5
554	.align 2
555LEFDE15a:
556
557
558.globl _test_pad_ebx_edi.eh
559_test_pad_ebx_edi.eh:
560LSFDE111a:
561	.set L$set$20b,LEFDE111a-LASFDE111a
562	.long L$set$20b	# FDE Length
563LASFDE111a:
564	.long	LASFDE111a-EH_frame1	# FDE CIE offset
565	.long	LFB91a-.	# FDE initial location
566	.set L$set$21b,LFE91a-LFB91a
567	.long L$set$21b	# FDE address range
568	.byte	0x0	# uleb128 0x0; Augmentation size
569	.byte	0x4	# DW_CFA_advance_loc4
570	.set L$set$22b,LCFI171a-LFB91a
571	.long L$set$22b
572	.byte	0xe	# DW_CFA_def_cfa_offset
573	.byte	0x8	# uleb128 0x8
574	.byte	0x84	# DW_CFA_offset, column 0x4
575	.byte	0x2	# uleb128 0x2
576	.byte	0x4	# DW_CFA_advance_loc4
577	.set L$set$23b,LCFI181a-LCFI171a
578	.long L$set$23b
579	.byte	0xd	# DW_CFA_def_cfa_register
580	.byte	0x4	# uleb128 0x4
581	.byte	0x4	# DW_CFA_advance_loc4
582	.set L$set$24b,LCFI211a-LCFI181a
583	.long L$set$24b
584	.byte	0x87	# DW_CFA_offset, column 0x7
585	.byte	0x13	# uleb128 0x13
586	.byte	0x83	# DW_CFA_offset, column 0x3
587	.byte	0x14	# uleb128 0x14
588	.align 2
589LEFDE111a:
590#endif // USE_EH_FRAME
591
592
593
594#if USE_COMPACT_UNWIND
595
596	.section __LD,__compact_unwind,regular,debug
597
598	.long	_test_no_reg
599	.set L101,LFE13-_test_no_reg
600	.long	L101
601	.long	0x01000000
602	.long	0
603	.long	0
604
605	.long	_test_ebx
606	.set L102,LFE13-_test_ebx
607	.long	L102
608	.long	0x01010001
609	.long	0
610	.long	0
611
612	.long	_test_esi
613	.set L103,LFE10-_test_esi
614	.long	L103
615	.long	0x01010005
616	.long	0
617	.long	0
618
619	.long	_test_edi
620	.set L104,LFE11-_test_edi
621	.long	L104
622	.long	0x01010004
623	.long	0
624	.long	0
625
626	.long	_test_ebx_esi
627	.set L105,LFE9-_test_ebx_esi
628	.long	L105
629	.long	0x01020029
630	.long	0
631	.long	0
632
633	.long	_test_esi_edi
634	.set L106,LFE8-_test_esi_edi
635	.long	L106
636	.long	0x01020025
637	.long	0
638	.long	0
639
640	.long	_test_ebx_edi
641	.set L107,LFE91-_test_ebx_edi
642	.long	L107
643	.long	0x01020021
644	.long	0
645	.long	0
646
647	.long	_test_ebx_esi_edi
648	.set L108,LFE7-_test_ebx_esi_edi
649	.long	L108
650	.long	0x01030129
651	.long	0
652	.long	0
653
654	.long	_test_edi_esi_ebx
655	.set L109,LFE7a-_test_edi_esi_ebx
656	.long	L109
657	.long	0x0103006C
658	.long	0
659	.long	0
660
661	.long	_test_pad_ebx_edi
662	.set L110,LFE91a-_test_pad_ebx_edi
663	.long	L110
664	.long	0x01120021
665	.long	0
666	.long	0
667
668#endif // USE_COMPACT_UNWIND
669
670
671	.subsections_via_symbols
672