summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/mpx/builtin-bnd-init-ptr-bounds-2-nov.c
blob: da44e7a96421b5919e21b853cee61a938ce84259 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do run } */
/* { dg-options "-fcheck-pointer-bounds -mmpx" } */


#include "mpx-check.h"

int buf[100];

int mpx_test (int argc, const char **argv)
{
  int *p = __bnd_set_ptr_bounds (buf + 10, sizeof (int) * 10);
  p = __bnd_init_ptr_bounds (p);
  p[-1] = argc;
  p[10] = argc;
  return 0;
}