2011-08-26 06:24:47 +08:00
|
|
|
struct _MyS {
|
|
|
|
int foo;
|
|
|
|
} MyS;
|
|
|
|
|
|
|
|
struct _MyS ww;
|
|
|
|
|
2012-06-09 11:03:02 +08:00
|
|
|
int x, y;
|
|
|
|
|
2015-03-13 12:40:07 +08:00
|
|
|
typedef union {
|
|
|
|
struct {
|
|
|
|
int field : 16;
|
|
|
|
};
|
|
|
|
} r_t;
|
|
|
|
|
|
|
|
void test() {
|
|
|
|
r_t reg;
|
|
|
|
reg.field = 1;
|
|
|
|
}
|
|
|
|
|
2011-08-26 06:24:47 +08:00
|
|
|
// RUN: c-index-test -cursor-at=%s:1:9 \
|
|
|
|
// RUN: -cursor-at=%s:2:9 \
|
|
|
|
// RUN: -cursor-at=%s:5:9 \
|
2012-06-09 11:03:02 +08:00
|
|
|
// RUN: -cursor-at=%s:7:5 \
|
|
|
|
// RUN: -cursor-at=%s:7:8 \
|
2015-03-13 12:40:07 +08:00
|
|
|
// RUN: -cursor-at=%s:17:8 \
|
2011-08-26 06:24:47 +08:00
|
|
|
// RUN: %s | FileCheck %s
|
|
|
|
|
|
|
|
// CHECK: StructDecl=_MyS:1:8 (Definition)
|
|
|
|
// CHECK: FieldDecl=foo:2:7 (Definition)
|
|
|
|
// CHECK: TypeRef=struct _MyS:1:8
|
2012-06-09 11:03:02 +08:00
|
|
|
// CHECK: VarDecl=x:7:5
|
|
|
|
// CHECK: VarDecl=y:7:8
|
2015-03-13 12:40:07 +08:00
|
|
|
// CHECK: 17:7 MemberRefExpr=field:11:9
|