get-cursor.c 651 B

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