blob: 4b23421a3de65341ccd1d52909906e3d03d04373 [file] [log] [blame]
Zhongxing Xuef8b28e2008-10-17 05:19:52 +00001// RUN: clang -checker-simple -verify %s
Zhongxing Xu2e971202008-10-25 14:11:23 +00002// RUN: clang -checker-simple -analyzer-store-region -verify %s
Zhongxing Xuef8b28e2008-10-17 05:19:52 +00003
Zhongxing Xu72e16822008-10-24 08:51:58 +00004struct s {
5 int data;
6 int data_array[10];
7};
Zhongxing Xuef8b28e2008-10-17 05:19:52 +00008
9void f(void) {
10 int a[10];
11 int (*p)[10];
12 p = &a;
13 (*p)[3] = 1;
14
15 struct s d;
16 struct s *q;
17 q = &d;
Zhongxing Xu72e16822008-10-24 08:51:58 +000018 q->data = 3;
19 d.data_array[9] = 17;
Zhongxing Xuef8b28e2008-10-17 05:19:52 +000020}
Zhongxing Xu2e971202008-10-25 14:11:23 +000021
22void f2() {
23 char *p = "/usr/local";
24 char (*q)[4];
25 q = &"abc";
26}