aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/analyzer/attr-const-2.c
blob: ab79514acf8613e9fe787c9e17baf3653936d432 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
extern int const_p (int) __attribute__((const));
extern void do_stuff (void);

void test (int a)
{
  void *p;
  if (const_p (a))
    {
      p = __builtin_malloc (1024);
      if (!p)
	return;
    }
  do_stuff ();
  if (const_p (a))
    __builtin_free (p); /* { dg-bogus "uninit" } */
}