1/* { dg-do compile { target { ! x32 } } } */
2/* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkp" } */
3/* { dg-final { scan-tree-dump "bndcl" "chkp" } } */
4/* { dg-final { scan-tree-dump "bndcu" "chkp" } } */
5/* { dg-final { cleanup-tree-dump "chkp" } } */
6
7int
8test (int *p)
9{
10  int *p1 = __bnd_narrow_ptr_bounds (p - 10, p, sizeof (int) * 20);
11  return p1[10];
12}
13