gcc/libmudflap/testsuite/libmudflap.c/fail27-frag.c
Ben Elliston 89da36ae12 re PR libmudflap/38462 (test libmudflap.c/fail27-frag.c fails output pattern test for ppc64)
PR libmudflap/38462
	* testsuite/libmudflap.c/fail27-frag.c: Match `mudflap dead
	object', not `mudflap object'.

From-SVN: r145328
2009-03-31 12:56:52 +11:00

25 lines
504 B
C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char volatile *
__attribute__((noinline))
foo (unsigned i)
{
char volatile buffer[10];
char volatile *k = i ? & buffer[i] : NULL; /* defeat addr-of-local-returned warning */
return k;
}
int main ()
{
char volatile *f = foo (5);
f[0] = 'b';
return 0;
}
/* { dg-output "mudflap violation 1.*" } */
/* { dg-output "Nearby object.*" } */
/* { dg-output "mudflap dead object.*buffer.*alloc.*dealloc" } */
/* { dg-do run { xfail *-*-* } } */