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

int test (int flag)
{
  int other_flag;
  if (flag)
    other_flag = 1;
  else
    other_flag = 0;

  /* With state-merging, we lose the relationship between 'flag' and 'other_flag'.  */
  __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */

  if (other_flag)
    __analyzer_eval (flag); /* { dg-warning "UNKNOWN" } */
  else
    __analyzer_eval (flag); /* { dg-warning "UNKNOWN" } */
}