33 lines · c
1struct _MyS {2 int foo;3} MyS;4 5struct _MyS ww;6 7int x, y;8 9typedef union {10 struct {11 int field : 16;12 };13} r_t;14 15void test() {16 r_t reg;17 reg.field = 1;18}19 20// RUN: c-index-test -cursor-at=%s:1:9 \21// RUN: -cursor-at=%s:2:9 \22// RUN: -cursor-at=%s:5:9 \23// RUN: -cursor-at=%s:7:5 \24// RUN: -cursor-at=%s:7:8 \25// RUN: -cursor-at=%s:17:8 \26// RUN: %s | FileCheck %s27 28// CHECK: StructDecl=_MyS:1:8 (Definition)29// CHECK: FieldDecl=foo:2:7 (Definition)30// CHECK: TypeRef=struct _MyS:1:831// CHECK: VarDecl=x:7:532// CHECK: VarDecl=y:7:833// CHECK: 17:7 MemberRefExpr=field:11:9