blob: deca6fd6a97bc81f6b3368d3bc22b85a5597e35a (
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
32
33
|
/* { dg-do run } */
/* { dg-shouldfail "bounds violation" } */
/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
#define SHOULDFAIL
#include "mpx-check.h"
struct s {
int a;
int b : 10;
int c : 1;
int e : 10;
} s;
#define HH (unsigned char)1
int foo (struct s *p)
{
int val = p->b;
printf ("%d\n", val);
return val == HH;
}
int mpx_test (int argc, const char **argv)
{
struct s buf[100];
foo (buf - 1);
return 0;
}
|