aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/analyzer/symbolic-6.c
blob: 10d4e97229933d8357bbe0cb6c6353e62b5c5e06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "analyzer-decls.h"

int a[1024];
int b[1024];

extern void escape (void *ptr);

void test_1 (int *p)
{
  int c, d;
  escape (&c);

  *p = 42;
  __analyzer_eval (*p == 42); /* { dg-warning "TRUE" } */

  /* These writes shouldn't affect *p.  */
  c = 33;
  d = 44;
  __analyzer_eval (*p == 42); /* { dg-warning "TRUE" } */

  /* This write could affect *p.  */
  a[16] = 55;
  __analyzer_eval (*p == 42); /* { dg-warning "UNKNOWN" } */
}