xref: /illumos-gate/usr/src/test/os-tests/tests/saveargs/functional/small-struct-ret-and-spill.c (revision b41e2fb6b2658a36accc73b3b86d99375e700dba)
1*b41e2fb6SRichard Lowe /*
2*b41e2fb6SRichard Lowe  * This file and its contents are supplied under the terms of the
3*b41e2fb6SRichard Lowe  * Common Development and Distribution License ("CDDL"), version 1.0.
4*b41e2fb6SRichard Lowe  * You may only use this file in accordance with the terms of version
5*b41e2fb6SRichard Lowe  * 1.0 of the CDDL.
6*b41e2fb6SRichard Lowe  *
7*b41e2fb6SRichard Lowe  * A full copy of the text of the CDDL should have accompanied this
8*b41e2fb6SRichard Lowe  * source.  A copy of the CDDL is also available via the Internet at
9*b41e2fb6SRichard Lowe  * http://www.illumos.org/license/CDDL.
10*b41e2fb6SRichard Lowe  */
11*b41e2fb6SRichard Lowe 
12*b41e2fb6SRichard Lowe /*
13*b41e2fb6SRichard Lowe  * Copyright 2012, Richard Lowe.
14*b41e2fb6SRichard Lowe  */
15*b41e2fb6SRichard Lowe 
16*b41e2fb6SRichard Lowe #include <stdio.h>
17*b41e2fb6SRichard Lowe #include <unistd.h>
18*b41e2fb6SRichard Lowe 
19*b41e2fb6SRichard Lowe struct foo {
20*b41e2fb6SRichard Lowe 	long a;
21*b41e2fb6SRichard Lowe 	long b;
22*b41e2fb6SRichard Lowe };
23*b41e2fb6SRichard Lowe 
24*b41e2fb6SRichard Lowe struct foo
test(long a,long b,long c,long d,long e,long f,long g,long h)25*b41e2fb6SRichard Lowe test(long a, long b, long c, long d, long e, long f, long g, long h)
26*b41e2fb6SRichard Lowe {
27*b41e2fb6SRichard Lowe 	struct foo ret = {0};
28*b41e2fb6SRichard Lowe 	printf("%ld %ld %ld %ld %ld %ld %ld %ld\n", a, b, c, d, e, f, g, h);
29*b41e2fb6SRichard Lowe 	fflush(stdout);
30*b41e2fb6SRichard Lowe 
31*b41e2fb6SRichard Lowe 	for (;;)
32*b41e2fb6SRichard Lowe 		(void) sleep(60);
33*b41e2fb6SRichard Lowe 
34*b41e2fb6SRichard Lowe 	/* not reached */
35*b41e2fb6SRichard Lowe 	return (ret);
36*b41e2fb6SRichard Lowe }
37*b41e2fb6SRichard Lowe 
38*b41e2fb6SRichard Lowe int
main(int argc,char ** argv)39*b41e2fb6SRichard Lowe main(int argc, char **argv)
40*b41e2fb6SRichard Lowe {
41*b41e2fb6SRichard Lowe 	(void) test(1, 2, 3, 4, 5, 6, 7, 8);
42*b41e2fb6SRichard Lowe 	return (0);
43*b41e2fb6SRichard Lowe }
44