summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/chkp-remove-bndint-2.c
blob: 942f555b3a1760087577df2d72a4d92358844a06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do compile } */
/* { dg-require-effective-target mpx } */
/* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -fdump-tree-optimized -Wchkp" } */
/* { dg-final { scan-tree-dump-not "bndint" "optimized" } } */

struct S
{
  int a;
  int b;
  int c;
};

int test (struct S *ps)
{
  int *pi = &ps->b;
  return *(pi + 1); /* { dg-warning "memory access check always fail" "" } */
}