Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / mpx / va-arg-pack-2-ubv.c
blob4af59758fb01eaf654c8dd823e141c36790791a8
1 /* { dg-do run } */
2 /* { dg-shouldfail "bounds violation" } */
3 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */
5 /* { dg-additional-options "-Wno-attributes" } */
7 #define SHOULDFAIL
9 #include "mpx-check.h"
10 #include <stdarg.h>
12 int
13 foo2 (int i1, int *p1, ...)
15 va_list argp;
16 int *p;
17 int i;
18 int res;
20 va_start(argp, p1);
21 p = va_arg(argp, int *);
22 i = va_arg(argp, int);
24 res = p[i + i1];
25 printf("%d\n", res);
27 return res;
30 static __attribute__((always_inline)) int
31 foo1 (int *p1, ...)
33 return foo2 (10, p1, __builtin_va_arg_pack ());
36 int prebuf[100];
37 int buf[100];
38 int buf1[100];
39 int postbuf[100];
41 int mpx_test (int argc, const char **argv)
43 foo1 (buf, buf1, 90);
44 return 0;