• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core %s -analyzer-store=region -verify
2 
3 unsigned foo();
4 typedef struct bf { unsigned x:2; } bf;
bar()5 void bar() {
6   bf y;
7   *(unsigned*)&y = foo();
8   y.x = 1;
9 }
10 
11 struct s {
12   int n;
13 };
14 
f()15 void f() {
16   struct s a;
17   int *p = &(a.n) + 1;
18 }
19 
20 typedef struct {
21   int x,y;
22 } Point;
23 
24 Point getit(void);
test()25 void test() {
26   Point p;
27   (void)(p = getit()).x;
28 }
29