blob: 326b8a7a0cdf183f8817b482be5ffe02285378fc [file] [log] [blame]
Douglas Gregor55817af2010-08-25 17:04:25 +00001// Note: the run lines follow their respective tests, since line/column
2// matter in this test.
3
4const char *in_string = "string";
5char in_char = 'a';
6// in comment
7/* in comment */
8#warning blarg
9#error blarg
10#pragma mark this is the spot
11// RUN: c-index-test -code-completion-at=%s:4:32 %s > %t
12// RUN: echo "DONE" >> %t
13// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t
Douglas Gregor3da626b2011-07-07 16:03:39 +000014// CHECK-CC1: Completion contexts:
15// CHECK-CC1-NEXT: Natural language
16// CHECK-CC1-NEXT: DONE
Douglas Gregor55817af2010-08-25 17:04:25 +000017// RUN: c-index-test -code-completion-at=%s:5:18 %s > %t
18// RUN: echo "DONE" >> %t
19// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t
20// RUN: c-index-test -code-completion-at=%s:6:7 %s > %t
21// RUN: echo "DONE" >> %t
22// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t
23// RUN: c-index-test -code-completion-at=%s:7:7 %s > %t
24// RUN: echo "DONE" >> %t
25// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t
26// RUN: c-index-test -code-completion-at=%s:8:10 %s > %t
27// RUN: echo "DONE" >> %t
28// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t
29// RUN: c-index-test -code-completion-at=%s:9:9 %s > %t
30// RUN: echo "DONE" >> %t
31// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t
32// RUN: c-index-test -code-completion-at=%s:10:19 %s > %t
33// RUN: echo "DONE" >> %t
34// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t
35
Douglas Gregor44f57f02010-08-25 17:11:34 +000036// Same tests as above, but with completion caching.
37// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:4:32 %s > %t
38// RUN: echo "DONE" >> %t
39// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t
40// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:5:18 %s > %t
41// RUN: echo "DONE" >> %t
42// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t
43// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:6:7 %s > %t
44// RUN: echo "DONE" >> %t
45// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t
46// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:7:7 %s > %t
47// RUN: echo "DONE" >> %t
48// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t
49// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:8:10 %s > %t
50// RUN: echo "DONE" >> %t
51// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t
52// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:9:9 %s > %t
53// RUN: echo "DONE" >> %t
54// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t
55// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:10:19 %s > %t
56// RUN: echo "DONE" >> %t
57// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t