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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.dg/] [free-1.c] - Diff between revs 298 and 338

Only display areas with differences | Details | Blame | View Log

Rev 298 Rev 338
/* PR c/36970 */
/* PR c/36970 */
/* { dg-do compile } */
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-options "-O2" } */
 
 
extern void free (void *);
extern void free (void *);
 
 
char *p, buf3[10], d;
char *p, buf3[10], d;
struct S { char a; int b; } *r;
struct S { char a; int b; } *r;
 
 
void foo (void)
void foo (void)
{
{
  char buf[10], buf2[10], c;
  char buf[10], buf2[10], c;
  static char buf4[10], e;
  static char buf4[10], e;
  char *q = buf;
  char *q = buf;
  free (p);
  free (p);
  free (q);           /* { dg-warning "attempt to free a non-heap object" } */
  free (q);           /* { dg-warning "attempt to free a non-heap object" } */
  free (buf2);        /* { dg-warning "attempt to free a non-heap object" } */
  free (buf2);        /* { dg-warning "attempt to free a non-heap object" } */
  free (&c);          /* { dg-warning "attempt to free a non-heap object" } */
  free (&c);          /* { dg-warning "attempt to free a non-heap object" } */
  free (buf3);        /* { dg-warning "attempt to free a non-heap object" } */
  free (buf3);        /* { dg-warning "attempt to free a non-heap object" } */
  free (&d);          /* { dg-warning "attempt to free a non-heap object" } */
  free (&d);          /* { dg-warning "attempt to free a non-heap object" } */
  free (buf4);        /* { dg-warning "attempt to free a non-heap object" } */
  free (buf4);        /* { dg-warning "attempt to free a non-heap object" } */
  free (&e);          /* { dg-warning "attempt to free a non-heap object" } */
  free (&e);          /* { dg-warning "attempt to free a non-heap object" } */
  free (&r->a);
  free (&r->a);
  free ("abcd");      /* { dg-warning "attempt to free a non-heap object" } */
  free ("abcd");      /* { dg-warning "attempt to free a non-heap object" } */
  free (L"abcd");     /* { dg-warning "attempt to free a non-heap object" } */
  free (L"abcd");     /* { dg-warning "attempt to free a non-heap object" } */
}
}
 
 

powered by: WebSVN 2.1.0

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