1 #include <stdlib.h>
2 
3 void *
calls_malloc(void)4 calls_malloc (void)
5 {
6   void *result = malloc (1024); /* { dg-message "allocated here" } */
7   return result; /* { dg-warning "leak of 'result'" } */
8 }
9 
test_1()10 void test_1 ()
11 {
12   calls_malloc (); /* { dg-message "calling 'calls_malloc' from 'test_1'" } */
13 }
14 
callee(int i)15 static void callee (int i)
16 {
17 }
18 
test_2(int i)19 void test_2 (int i)
20 {
21   callee (i);
22 }
23