OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [free-2.c] - Blame information for rev 301

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

Line No. Rev Author Line
1 298 jeremybenn
/* PR c/36970 */
2
/* { dg-do compile } */
3
/* { dg-options "-O0" } */
4
 
5
extern void free (void *);
6
 
7
char *p, buf3[10], d;
8
struct S { char a; int b; } *r;
9
 
10
void foo (void)
11
{
12
  char buf[10], buf2[10], c;
13
  static char buf4[10], e;
14
  char *q = buf;
15
  free (p);
16
  free (q);           /* At -O0 no warning is reported here.  */
17
  free (buf2);        /* { dg-warning "attempt to free a non-heap object" } */
18
  free (&c);          /* { dg-warning "attempt to free a non-heap object" } */
19
  free (buf3);        /* { dg-warning "attempt to free a non-heap object" } */
20
  free (&d);          /* { dg-warning "attempt to free a non-heap object" } */
21
  free (buf4);        /* { dg-warning "attempt to free a non-heap object" } */
22
  free (&e);          /* { dg-warning "attempt to free a non-heap object" } */
23
  free (&r->a);
24
  free ("abcd");      /* { dg-warning "attempt to free a non-heap object" } */
25
  free (L"abcd");     /* { dg-warning "attempt to free a non-heap object" } */
26
}

powered by: WebSVN 2.1.0

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