repo.or.cz
/
netbsd-mini2440.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Sync usage with man page.
[netbsd-mini2440.git]
/
gnu
/
dist
/
gcc4
/
gcc
/
testsuite
/
gcc.c-torture
/
execute
/
strct-stdarg-1.c
blob
508c954705a876beba1fa78500d54ca99a68ae62
1
#include <stdarg.h>
2
3
struct
tiny
4
{
5
char
c
;
6
char
d
;
7
char
e
;
8
char
f
;
9
char
g
;
10
};
11
12
f
(
int
n
, ...)
13
{
14
struct
tiny x
;
15
int
i
;
16
17
va_list
ap
;
18
va_start
(
ap
,
n
);
19
for
(
i
=
0
;
i
<
n
;
i
++)
20
{
21
x
=
va_arg
(
ap
,
struct
tiny
);
22
if
(
x
.
c
!=
i
+
10
)
23
abort
();
24
if
(
x
.
d
!=
i
+
20
)
25
abort
();
26
if
(
x
.
e
!=
i
+
30
)
27
abort
();
28
if
(
x
.
f
!=
i
+
40
)
29
abort
();
30
if
(
x
.
g
!=
i
+
50
)
31
abort
();
32
}
33
{
34
long
x
=
va_arg
(
ap
,
long
);
35
if
(
x
!=
123
)
36
abort
();
37
}
38
va_end
(
ap
);
39
}
40
41
main
()
42
{
43
struct
tiny x
[
3
];
44
x
[
0
].
c
=
10
;
45
x
[
1
].
c
=
11
;
46
x
[
2
].
c
=
12
;
47
x
[
0
].
d
=
20
;
48
x
[
1
].
d
=
21
;
49
x
[
2
].
d
=
22
;
50
x
[
0
].
e
=
30
;
51
x
[
1
].
e
=
31
;
52
x
[
2
].
e
=
32
;
53
x
[
0
].
f
=
40
;
54
x
[
1
].
f
=
41
;
55
x
[
2
].
f
=
42
;
56
x
[
0
].
g
=
50
;
57
x
[
1
].
g
=
51
;
58
x
[
2
].
g
=
52
;
59
f
(
3
,
x
[
0
],
x
[
1
],
x
[
2
], (
long
)
123
);
60
exit
(
0
);
61
}