aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/chkp-narrow-bounds.c
blob: ab1b122479a96f4c428dea31cc5d2286f14c6935 (plain)
1
2
3
4
5
6
7
8
9
10
11
/* { dg-do compile { target { ! x32 } } } */
/* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkp" } */
/* { dg-final { scan-tree-dump "bndcl" "chkp" } } */
/* { dg-final { scan-tree-dump "bndcu" "chkp" } } */

int
test (int *p)
{
  int *p1 = __bnd_narrow_ptr_bounds (p - 10, p, sizeof (int) * 20);
  return p1[10];
}