xref: /OpenGrok/opengrok-indexer/src/test/resources/sources/bug19195/test.s (revision 2bcacabbe843448903326d34ff21a265b5f37596)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * See LICENSE.txt included in this distribution for the specific
9 * language governing permissions and limitations under the License.
10 *
11 * When distributing Covered Code, include this CDDL HEADER in each
12 * file and include the License file at LICENSE.txt.
13 * If applicable, add the following below this CDDL HEADER, with the
14 * fields enclosed by brackets "[]" replaced with your own identifying
15 * information: Portions Copyright [yyyy] [name of copyright owner]
16 *
17 * CDDL HEADER END
18 */
19
20/*
21 * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
22 */
23
24/* first function definition */
25
26	ENTRY_NP(foo)
27	set	nwindows, %g1
28	ld	[%g1], %g1
29	mov	%g1, %g2
30
311:
32	save	%sp, -WINDOWSIZE, %sp
33	brnz	%g2, 1b
34	dec	%g2
35
36	mov	%g1, %g2
372:
38	restore
39	brnz	%g2, 2b
40	dec	%g2
41
42	retl
43	nop
44
45	SET_SIZE(foo)
46
47/* 2nd function definition */
48
49	ENTRY(bar)
50	rdpr	%otherwin, %g1
51	brz	%g1, 3f
52	clr	%g2
531:
54	save	%sp, -WINDOWSIZE, %sp
55	rdpr	%otherwin, %g1
56	brnz	%g1, 1b
57	add	%g2, 1, %g2
582:
59	sub	%g2, 1, %g2		! restore back to orig window
60	brnz	%g2, 2b
61	restore
623:
63	retl
64	nop
65	SET_SIZE(bar)
66
67/* definitions of the same function twice */
68
69	ENTRY2(_fce,__fce)
70	cmp	%o0, ERESTART
71	be,a	1f
72	mov	EINTR, %o0
731:
74	save	%sp, -SA(MINFRAME), %sp
75	call	___errno
76	nop
77	st	%i0, [%o0]
78	restore
79	retl
80	mov	-1, %o0
81
82	SET_SIZE(_fce)
83	SET_SIZE(__fce)
84