blob: 2e72c77d9face6a430239df54492a14efb5e38ae [file] [log] [blame]
Ted Kremenek033a07e2011-08-03 23:14:55 +00001// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core %s -analyzer-store=region -verify
Ted Kremenek5c456fe2008-10-18 03:28:48 +00002
3unsigned foo();
4typedef struct bf { unsigned x:2; } bf;
5void bar() {
6 bf y;
7 *(unsigned*)&y = foo();
8 y.x = 1;
9}
Zhongxing Xu5414a5c2009-06-21 13:24:24 +000010
11struct s {
12 int n;
13};
14
15void f() {
16 struct s a;
17 int *p = &(a.n) + 1;
18}
Argyrios Kyrtzidisc2e20d02011-02-03 22:01:32 +000019
20typedef struct {
21 int x,y;
22} Point;
23
24Point getit(void);
25void test() {
26 Point p;
27 (void)(p = getit()).x;
28}