2015-12-10 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / chkp-narrow-bounds.c
blob60e4ed2d6025a107608f1769bc73c301f74f4643
1 /* { dg-do compile } */
2 /* { dg-require-effective-target mpx } */
3 /* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-chkp" } */
4 /* { dg-final { scan-tree-dump "bndcl" "chkp" } } */
5 /* { dg-final { scan-tree-dump "bndcu" "chkp" } } */
7 int
8 test (int *p)
10 int *p1 = __bnd_narrow_ptr_bounds (p - 10, p, sizeof (int) * 20);
11 return p1[10];