Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / mpx / vararg-6-lbv.c
blob822d32a7b7b5b556934362a01f2388aea144b741
1 /* { dg-do run } */
2 /* { dg-shouldfail "bounds violation" } */
3 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */
6 #define SHOULDFAIL
8 #include "mpx-check.h"
9 #include "stdarg.h"
11 int buf[100];
12 int buf1[10];
14 int rd (int *pp, ...)
16 va_list argp;
17 int *p;
18 int i;
19 int res;
20 int n = 4;
22 va_start (argp, pp);
23 for (; n > 0; n--)
24 va_arg (argp, int *);
25 p = va_arg (argp, int *);
26 i = va_arg (argp, int);
28 res = p[i];
29 printf ("%d\n", res);
31 return res;
34 int mpx_test (int argc, const char **argv)
36 rd (buf1, buf1, buf1, buf1, buf1, buf, -1, buf1);
37 return 0;