]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.target/i386/mpx/return-struct-4-lbv.c
Daily bump.
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / i386 / mpx / return-struct-4-lbv.c
CommitLineData
ee8f136a
IE
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
10struct s1
11{
12 int *p;
13 int i1;
14 int i2;
15} s1;
16
17int buf[100];
18
19struct s1 __attribute__((noinline)) get ()
20{
21 struct s1 s;
22 s.p = buf;
23 return s;
24}
25
26int __attribute__((noinline)) rd (struct s1 s, int i)
27{
28 int res = s.p[i];
29 printf ("%d\n", res);
30 return res;
31}
32
33int mpx_test (int argc, const char **argv)
34{
35 struct s1 s = get ();
36
37 rd (s, -1);
38
39 return 0;
40}