OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
PR middle-end/35456
[pf3gnuchains/gcc-fork.git]
/
gcc
/
testsuite
/
gcc.c-torture
/
execute
/
931004-12.c
1
#include <stdarg.h>
2
3
struct tiny
4
{
5
char c;
6
char d;
7
char e;
8
};
9
10
f (int n, ...)
11
{
12
struct tiny x;
13
int i;
14
15
va_list ap;
16
va_start (ap,n);
17
for (i = 0; i < n; i++)
18
{
19
x = va_arg (ap,struct tiny);
20
if (x.c != i + 10)
21
abort();
22
if (x.d != i + 20)
23
abort();
24
if (x.e != i + 30)
25
abort();
26
}
27
{
28
long x = va_arg (ap, long);
29
if (x != 123)
30
abort();
31
}
32
va_end (ap);
33
}
34
35
main ()
36
{
37
struct tiny x[3];
38
x[0].c = 10;
39
x[1].c = 11;
40
x[2].c = 12;
41
x[0].d = 20;
42
x[1].d = 21;
43
x[2].d = 22;
44
x[0].e = 30;
45
x[1].e = 31;
46
x[2].e = 32;
47
f (3, x[0], x[1], x[2], (long) 123);
48
exit(0);
49
}
50