summaryrefslogtreecommitdiff
path: root/libmudflap/testsuite/libmudflap.c/fail68-frag.c
blob: 7b2f8cf2cb04aeb4a3e0c4448958dc60b2878849 (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
/* PR libmudflap/40778 */

char p[32];
static int j;

__attribute__((noinline))
static void foo (int i)
{
  if (j++ == 0)
    p[i + 4] = 12;
  else
    p[i - 4] = 13;
}

int
main ()
{
  foo (30);
  foo (30);
  foo (30);
  return 0;
}

/* { dg-output "mudflap violation 1.*" } */
/* { dg-output "Nearby object 1.*" } */
/* { dg-output "mudflap object.*name.*p" } */
/* { dg-do run { xfail *-*-* } } */