Home | History | Annotate | Download | only in Analysis
      1 // RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental %s -analyzer-store=basic -verify
      2 // RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental %s -analyzer-store=region -verify
      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 }
     11 
     12 struct s {
     13   int n;
     14 };
     15 
     16 void f() {
     17   struct s a;
     18   int *p = &(a.n) + 1;
     19 }
     20 
     21 typedef struct {
     22   int x,y;
     23 } Point;
     24 
     25 Point getit(void);
     26 void test() {
     27   Point p;
     28   (void)(p = getit()).x;
     29 }
     30