aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/chkp-remove-bndint-2.c
blob: 413941abcc2fd4296e0cdf1402019803332f74f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do compile { target { ! x32 } } } */
/* { 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" "" } */
}