diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-08-16 21:18:39 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-08-16 21:18:39 +0000 |
commit | 5f808c2bfe2f95c984029d76deb4aaebcad30cbc (patch) | |
tree | 02011ccbb7cd5c8fc779281d6d3d919a073b55be /test/Index/complete-hiding.c | |
parent | d5addb48398241e1f63c114d860dfe30346258e8 (diff) |
Implement name hiding of cached global code-completion results.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111184 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/complete-hiding.c')
-rw-r--r-- | test/Index/complete-hiding.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/Index/complete-hiding.c b/test/Index/complete-hiding.c new file mode 100644 index 0000000000..0505abfa47 --- /dev/null +++ b/test/Index/complete-hiding.c @@ -0,0 +1,29 @@ +// Note: the run lines follow their respective tests, since line/column +// matter in this test. + +struct StructA { }; +struct StructB { }; +struct StructC { }; +int ValueA; +int ValueB; + +void f() { + + int ValueA = 0; + int StructA = 0; + struct StructB { }; + + struct StructA sa = { }; +} + +// RUN: c-index-test -code-completion-at=%s:16:3 %s | FileCheck -check-prefix=CHECK-CC1 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:16:3 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: VarDecl:{ResultType int}{TypedText StructA} (8) +// CHECK-CC1: VarDecl:{ResultType int}{TypedText ValueA} (8) +// CHECK-CC1-NOT: VarDecl:{ResultType int}{TypedText ValueA} (50) +// CHECK-CC1: VarDecl:{ResultType int}{TypedText ValueB} (50) +// RUN: c-index-test -code-completion-at=%s:16:10 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: StructDecl:{TypedText StructA} (40) +// CHECK-CC2-NOT: StructDecl:{TypedText StructB} (40) +// CHECK-CC2: StructDecl:{TypedText StructC} (40) +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:16:10 %s | FileCheck -check-prefix=CHECK-CC2 %s |