145
|
1 /* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
|
|
2
|
111
|
3 struct foo
|
|
4 {
|
|
5 int a, b, c, d;
|
|
6 double doubl;
|
|
7 } s1, s2;
|
|
8
|
|
9 #ifndef ONLY2
|
|
10
|
|
11 struct foo
|
|
12 structret (s1, i1, i2, s2)
|
|
13 struct foo s1, s2;
|
|
14 int i1, i2;
|
|
15 {
|
|
16 if (i1 != i2)
|
|
17 {
|
|
18 if (i1 < i2)
|
|
19 return s1;
|
|
20 else
|
|
21 return s2;
|
|
22 }
|
|
23 s2.a = 11;
|
|
24 s2.b = 22;
|
|
25 s2.c = s1.c;
|
|
26 s2.d = s1.d;
|
|
27 return s2;
|
|
28 }
|
|
29
|
|
30 #endif
|
|
31
|
|
32 #ifndef ONLY1
|
|
33
|
|
34 struct foo
|
|
35 mani (a, b)
|
|
36 {
|
|
37 return structret (s1, a, b, s2);
|
|
38 }
|
|
39
|
|
40 init ()
|
|
41 {
|
|
42 s1.a = 1;
|
|
43 s1.b = 2;
|
|
44 s1.c = 3;
|
|
45 s1.d = 4;
|
|
46 s1.doubl = 3.1415;
|
|
47 s2.a = -1;
|
|
48 s2.b = -2;
|
|
49 s2.c = -3;
|
|
50 s2.d = -4;
|
|
51 s2.doubl = 2.71818;
|
|
52 }
|
|
53
|
|
54 main ()
|
|
55 {
|
|
56 struct foo s;
|
|
57
|
|
58 init ();
|
|
59 s = mani (1, 1);
|
|
60 printf ("%d, %d, %d, %d : %f\n", s.a, s.b, s.c, s.d, s.doubl);
|
|
61
|
|
62 init ();
|
|
63 s = mani (2, 1);
|
|
64 printf ("%d, %d, %d, %d : %f\n", s.a, s.b, s.c, s.d, s.doubl);
|
|
65
|
|
66 init ();
|
|
67 s = mani (1, 2);
|
|
68 printf ("%d, %d, %d, %d : %f\n", s.a, s.b, s.c, s.d, s.doubl);
|
|
69 }
|
|
70
|
|
71 #endif
|