Ted Kremenek | 8382cf5 | 2009-11-13 18:46:29 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -analyze -analyzer-experimental-internal-checks -std=gnu99 -checker-cfref -analyzer-store=region -verify %s |
Zhongxing Xu | 5c86b19 | 2009-04-29 09:24:35 +0000 | [diff] [blame] | 2 | |
3 | |||||
4 | // The store for 'a[1]' should not be removed mistakenly. SymbolicRegions may | ||||
5 | // also be live roots. | ||||
6 | void f14(int *a) { | ||||
7 | int i; | ||||
8 | a[1] = 1; | ||||
9 | i = a[1]; | ||||
10 | if (i != 1) { | ||||
11 | int *p = 0; | ||||
12 | i = *p; // no-warning | ||||
13 | } | ||||
14 | } |