Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / mpx / va-arg-pack-1-nov.c
blob4beda02b9515746b612ef81d8ed163450d23a07f
1 /* { dg-do run } */
2 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */
4 /* { dg-additional-options "-Wno-attributes" } */
6 #include "mpx-check.h"
7 #include <stdarg.h>
9 int
10 foo2 (int i1, int *p1, ...)
12 va_list argp;
13 int i;
14 int res;
16 va_start(argp, p1);
17 i = va_arg(argp, int);
19 res = p1[i + i1];
20 printf("%d\n", res);
22 return res;
25 static __attribute__((always_inline)) int
26 foo1 (int *p1, ...)
28 return foo2 (10, p1, __builtin_va_arg_pack ());
31 int prebuf[100];
32 int buf[100];
33 int postbuf[100];
35 int mpx_test (int argc, const char **argv)
37 foo1 (buf, 89);
38 foo1 (buf, -9);
39 return 0;