2 /* { dg-do compile } */
3 /* { dg-options "-O2" } */
5 extern void free (void *);
8 struct S { char a; int b; } *r;
12 char buf[10], buf2[10], c;
13 static char buf4[10], e;
16 free (q); /* { dg-warning "attempt to free a non-heap object" } */
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" } */
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" } */