YouCompleteMe/cpp/llvm/tools/clang/test/Analysis/fields.c
Strahinja Val Markovic 1f51a89d39 Adding more llvm/clang files
These were ignored by git accidentally. We want ALL OF THEM since they all came
in the llvm/clang source distribution.
2012-07-05 17:55:45 -07:00

29 lines
405 B
C

// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core %s -analyzer-store=region -verify
unsigned foo();
typedef struct bf { unsigned x:2; } bf;
void bar() {
bf y;
*(unsigned*)&y = foo();
y.x = 1;
}
struct s {
int n;
};
void f() {
struct s a;
int *p = &(a.n) + 1;
}
typedef struct {
int x,y;
} Point;
Point getit(void);
void test() {
Point p;
(void)(p = getit()).x;
}