repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
* intrinsics/access.c: Include <stdlib.h>.
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.dg
/
vla-14.c
blob
3dbb11ed1a717d2b1454a3e2dfb6ea7b0789a7d0
1
/* Test for VLA size evaluation in va_arg. */
2
/* Origin: Joseph Myers <joseph@codesourcery.com> */
3
/* { dg-do run } */
4
/* { dg-options "-std=gnu99" } */
5
6
#include <stdarg.h>
7
8
extern
void
exit
(
int
);
9
extern
void
abort
(
void
);
10
11
int
a
[
10
];
12
int
i
=
9
;
13
14
void
15
f
(
int
n
, ...)
16
{
17
va_list
ap
;
18
void
*
p
;
19
va_start
(
ap
,
n
);
20
p
=
va_arg
(
ap
,
typeof
(
int
(*)[++
i
]));
21
if
(
p
!=
a
)
22
abort
();
23
if
(
i
!=
n
)
24
abort
();
25
va_end
(
ap
);
26
}
27
28
int
29
main
(
void
)
30
{
31
f
(
10
, &
a
);
32
exit
(
0
);
33
}