]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.target/i386/mpx/field-addr-2-lbv.c
Daily bump.
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / i386 / mpx / field-addr-2-lbv.c
1 /* { dg-do run } */
2 /* { dg-shouldfail "bounds violation" } */
3 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */
4
5 /* { dg-additional-options "-fchkp-first-field-has-own-bounds" } */
6
7 #define SHOULDFAIL
8
9 #include "mpx-check.h"
10
11 struct S {
12 int a;
13 int b[100];
14 int c;
15 } S;
16
17 int foo (int *i, int k)
18 {
19 printf ("%d\n", i[k]);
20 return i[k];
21 }
22
23 int mpx_test (int argc, const char **argv)
24 {
25 struct S s;
26
27 foo(&s.a, -1);
28
29 return 0;
30 }