PR testsuite/52641
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / builtin-free.c
blob67dd071406d329c514ff18cf8c5d564a0190a69d
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 void bar (void *);
5 void foo(unsigned n)
7 void *p = __builtin_malloc (n);
8 if (p)
10 bar (p);
11 __builtin_free (p);
12 p = 0;
14 __builtin_free (p);
17 /* We should remove the redundant call to free. */
19 /* { dg-final { scan-tree-dump-times "free" 1 "optimized" } } */
20 /* { dg-final { cleanup-tree-dump "optimized" } } */