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