Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / mpx / vararg-2-ubv.c
blobb4463712e2bf05d9b57a15f8f74e411230533856
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
15 rd (int *pppp, int n, ...)
17 va_list argp;
18 int *p;
19 int i;
20 int res;
22 va_start (argp, n);
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, 1, buf1, buf, 100, buf1);
37 return 0;