1 /* { dg-do compile } */ 2 /* { dg-options "-O -fdump-tree-optimized" } */ 3 test1(void)4void test1(void) 5 { 6 int *p = __builtin_malloc (sizeof (int) * 4); 7 *p++ = 4; 8 __builtin_free (p); // { dg-warning "\\\[-Wfree-nonheap-object" } 9 } 10 11 /* Undefined. We can't do anything here. */ 12 13 /* { dg-final { scan-tree-dump-times "free" 1 "optimized" } } */ 14 /* { dg-final { scan-tree-dump-times "malloc" 1 "optimized" } } */ 15