aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/analyzer/malloc-ipa-6.c
blob: 62f8b55c3643bbd2fd42ab11ad2262ce431e445f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <stdlib.h>

void *
calls_malloc (void)
{
  void *result = malloc (1024); /* { dg-message "allocated here" } */
  return result; /* { dg-warning "leak of 'result'" } */
}

void test_1 ()
{
  calls_malloc (); /* { dg-message "calling 'calls_malloc' from 'test_1'" } */
}

static void callee (int i)
{
}

void test_2 (int i)
{
  callee (i);
}