From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/Index/complete-natural.m | 57 +++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 clang/test/Index/complete-natural.m (limited to 'clang/test/Index/complete-natural.m') diff --git a/clang/test/Index/complete-natural.m b/clang/test/Index/complete-natural.m new file mode 100644 index 0000000..326b8a7 --- /dev/null +++ b/clang/test/Index/complete-natural.m @@ -0,0 +1,57 @@ +// Note: the run lines follow their respective tests, since line/column +// matter in this test. + +const char *in_string = "string"; +char in_char = 'a'; +// in comment +/* in comment */ +#warning blarg +#error blarg +#pragma mark this is the spot +// RUN: c-index-test -code-completion-at=%s:4:32 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// CHECK-CC1: Completion contexts: +// CHECK-CC1-NEXT: Natural language +// CHECK-CC1-NEXT: DONE +// RUN: c-index-test -code-completion-at=%s:5:18 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: c-index-test -code-completion-at=%s:6:7 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: c-index-test -code-completion-at=%s:7:7 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: c-index-test -code-completion-at=%s:8:10 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: c-index-test -code-completion-at=%s:9:9 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: c-index-test -code-completion-at=%s:10:19 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t + +// Same tests as above, but with completion caching. +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:4:32 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:5:18 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:6:7 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:7:7 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:8:10 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:9:9 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:10:19 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t -- cgit v1.2.3