aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/analyzer/pr99886.c
blob: da768ba62981bdadc0cceab2c7b23d6cd33ed473 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* Regression test for hang with -fanalyzer-verbosity=0.  */
/* { dg-additional-options "-fanalyzer-verbosity=0" } */

#include <stdlib.h>

struct coord {
  float x;
  float y;
};

void test_34 (void)
{
  float *q;
  struct coord *p = malloc (sizeof (struct coord));
  if (!p)
    return;
  p->x = 0.0f;
  q = &p->x;
  free (p);
  *q = 1.0f; /* { dg-warning "use after 'free' of 'q'" } */
};