OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libmudflap/] [testsuite/] [libmudflap.c/] [fail27-frag.c] - Rev 764

Go to most recent revision | Compare with Previous | Blame | View Log

#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 *-*-* } } */
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.