]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.target/i386/mpx/builtin-bnd-set-ptr-bounds-2-lbv.c
bbc578abd2c711b24b65d657160f0e7fe9dc296e
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / i386 / mpx / builtin-bnd-set-ptr-bounds-2-lbv.c
1 /* { dg-do run } */
2 /* { dg-shouldfail "bounds violation" } */
3 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */
4
5
6 #define SHOULDFAIL
7
8 #include "mpx-check.h"
9
10 int buf[100];
11
12 int mpx_test (int argc, const char **argv)
13 {
14 int *p = __bnd_set_ptr_bounds (buf + 10, sizeof (int) * 10);
15 p[-1] = argc;
16 return 0;
17 }