Change the semantics for Entity.
Entity can now refer to declarations that are not visible outside the translation unit.
It is a wrapper of a pointer union, it's either a Decl* for declarations that don't
"cross" translation units, or an EntityImpl* which is associated with the specific "visible" Decl.
Included is a test case for handling fields across translation units.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76515 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Index/find-refs.c b/test/Index/find-refs.c
index 5212c24..9212922 100644
--- a/test/Index/find-refs.c
+++ b/test/Index/find-refs.c
@@ -39,3 +39,8 @@
// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:16:7 -print-refs > %t &&
// RUN: cat %t | count 1 &&
// RUN: grep 't1.c:22:3,' %t
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:7:11 -print-refs > %t &&
+// RUN: cat %t | count 2 &&
+// RUN: grep 't1.c:25:3,' %t &&
+// RUN: grep 't2.c:10:3,' %t
diff --git a/test/Index/foo.h b/test/Index/foo.h
index 2e3b403..7670c00 100644
--- a/test/Index/foo.h
+++ b/test/Index/foo.h
@@ -2,3 +2,7 @@
void foo_func(int param1);
void bar_func(void);
+
+struct MyStruct {
+ int field_var;
+};
diff --git a/test/Index/t1.c b/test/Index/t1.c
index 17cdb7d..d6ca995 100644
--- a/test/Index/t1.c
+++ b/test/Index/t1.c
@@ -20,4 +20,7 @@
struct S1 s1;
s1.x = 0;
((struct S2 *)0)->x = 0;
+
+ struct MyStruct ms;
+ ms.field_var = 10;
}
diff --git a/test/Index/t2.c b/test/Index/t2.c
index 8e405cc..76d5d6c 100644
--- a/test/Index/t2.c
+++ b/test/Index/t2.c
@@ -5,4 +5,7 @@
void bar_func(void) {
global_var += 100;
foo_func(global_var);
+
+ struct MyStruct *ms;
+ ms->field_var = 10;
}