blob: 58d03e783d8439acd2b095193fb289da55dccbe8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
/* { dg-do run } */
/* { dg-shouldfail "bounds violation" } */
/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
#define SHOULDFAIL
#include "mpx-check.h"
struct s1 {
int *p[2];
} s1;
int rd (struct s1 s, int i)
{
int res = s.p[0][i];
printf ("%d\n", res);
return res;
}
int buf[100];
int buf1[100];
int mpx_test (int argc, const char **argv)
{
struct s1 s = { {buf, buf1} };
rd (s, -1);
return 0;
}
|