Ted Kremenek | 565e465 | 2010-02-05 02:06:54 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem %s -analyzer-store=basic -verify |
| 2 | // RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem %s -analyzer-store=region -verify |
Ted Kremenek | 5c456fe | 2008-10-18 03:28:48 +0000 | [diff] [blame] | 3 | |
| 4 | unsigned foo(); |
| 5 | typedef struct bf { unsigned x:2; } bf; |
| 6 | void bar() { |
| 7 | bf y; |
| 8 | *(unsigned*)&y = foo(); |
| 9 | y.x = 1; |
| 10 | } |
Zhongxing Xu | 5414a5c | 2009-06-21 13:24:24 +0000 | [diff] [blame] | 11 | |
| 12 | struct s { |
| 13 | int n; |
| 14 | }; |
| 15 | |
| 16 | void f() { |
| 17 | struct s a; |
| 18 | int *p = &(a.n) + 1; |
| 19 | } |