]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.target/i386/mpx/field-addr-9-ubv.c
Daily bump.
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / i386 / mpx / field-addr-9-ubv.c
CommitLineData
ee8f136a
IE
1/* { dg-do run } */
2/* { dg-shouldfail "bounds violation" } */
3/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
4
5/* { dg-additional-options "-fchkp-narrow-to-innermost-array" } */
6
7#define SHOULDFAIL
8
9#include "mpx-check.h"
10
11struct S {
12 int first;
13 int a[10];
14 int b;
15} S;
16
17struct S1 {
18 int a;
19 struct S b[10];
20 int c;
21} S1;
22
23struct S2 {
24 int x;
25 struct S1 a[10];
26 struct S1 b;
27} S2;
28
29int foo (int *p, int i)
30{
31 int res = p[i];
32 printf ("%d\n", res);
33 return res;
34}
35
36struct S2 s1;
37struct S2 *s2 = &s1;
38
39int mpx_test (int argc, const char **argv)
40{
41 foo (&(s2->a[argc].b[5].a[0]), 10);
42
43 return 0;
44}