summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/chkp-remove-bndint-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/chkp-remove-bndint-2.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/chkp-remove-bndint-2.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/chkp-remove-bndint-2.c b/gcc/testsuite/gcc.target/i386/chkp-remove-bndint-2.c
new file mode 100644
index 00000000000..c97ac277893
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/chkp-remove-bndint-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { 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" "" } */
+}