annotate clang/test/Index/complete-exprs.c @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // Note: the run lines follow their respective tests, since line/column
anatofuz
parents:
diff changeset
2 // matter in this test.
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 int f(int) __attribute__((unavailable));
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 int test(int i, int j, int k, int l) {
anatofuz
parents:
diff changeset
7 return i | j | k & l;
anatofuz
parents:
diff changeset
8 }
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 struct X __attribute__((deprecated)) f1 = { 17 };
anatofuz
parents:
diff changeset
11 void f2() { f1(17); }
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 const char *str = "Hello, \nWorld";
anatofuz
parents:
diff changeset
14
anatofuz
parents:
diff changeset
15 void f3(const char*, ...) __attribute__((sentinel(0)));
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 #define NULL __null
anatofuz
parents:
diff changeset
18 void f4(const char* str) {
anatofuz
parents:
diff changeset
19 f3(str, NULL);
anatofuz
parents:
diff changeset
20 }
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 typedef int type;
anatofuz
parents:
diff changeset
23 void f5(float f) {
anatofuz
parents:
diff changeset
24 (type)f;
anatofuz
parents:
diff changeset
25 }
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 // RUN: c-index-test -code-completion-at=%s:7:10 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s
anatofuz
parents:
diff changeset
28 // RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:7:10 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s
anatofuz
parents:
diff changeset
29 // CHECK-CC1: NotImplemented:{TypedText __PRETTY_FUNCTION__} (65)
anatofuz
parents:
diff changeset
30 // CHECK-CC1: macro definition:{TypedText __VERSION__} (70)
anatofuz
parents:
diff changeset
31 // CHECK-CC1: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (12) (unavailable)
anatofuz
parents:
diff changeset
32 // CHECK-CC1-NOT: NotImplemented:{TypedText float} (65)
anatofuz
parents:
diff changeset
33 // CHECK-CC1: ParmDecl:{ResultType int}{TypedText j} (8)
anatofuz
parents:
diff changeset
34 // CHECK-CC1: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40)
anatofuz
parents:
diff changeset
35 // RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:7:10 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s
anatofuz
parents:
diff changeset
36 // RUN: c-index-test -code-completion-at=%s:7:14 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s
anatofuz
parents:
diff changeset
37 // RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:7:14 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s
anatofuz
parents:
diff changeset
38
anatofuz
parents:
diff changeset
39 // RUN: c-index-test -code-completion-at=%s:7:18 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s
anatofuz
parents:
diff changeset
40 // RUN: c-index-test -code-completion-at=%s:7:22 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s
anatofuz
parents:
diff changeset
41 // RUN: c-index-test -code-completion-at=%s:7:2 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC2 %s
anatofuz
parents:
diff changeset
42 // CHECK-CC2: macro definition:{TypedText __VERSION__} (70)
anatofuz
parents:
diff changeset
43 // CHECK-CC2: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50)
anatofuz
parents:
diff changeset
44 // CHECK-CC2: NotImplemented:{TypedText float} (50)
anatofuz
parents:
diff changeset
45 // CHECK-CC2: ParmDecl:{ResultType int}{TypedText j} (34)
anatofuz
parents:
diff changeset
46 // CHECK-CC2: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40)
anatofuz
parents:
diff changeset
47 // RUN: c-index-test -code-completion-at=%s:11:16 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC4 %s
anatofuz
parents:
diff changeset
48 // CHECK-CC4: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50)
anatofuz
parents:
diff changeset
49 // CHECK-CC4: VarDecl:{ResultType struct X}{TypedText f1} (50) (deprecated)
anatofuz
parents:
diff changeset
50
anatofuz
parents:
diff changeset
51 // RUN: c-index-test -code-completion-at=%s:19:3 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC6 %s
anatofuz
parents:
diff changeset
52 // CHECK-CC6: FunctionDecl:{ResultType void}{TypedText f3}{LeftParen (}{Placeholder const char *, ...}{Text , NULL}{RightParen )} (50)
anatofuz
parents:
diff changeset
53 // CHECK-CC6: NotImplemented:{TypedText void} (50)
anatofuz
parents:
diff changeset
54 // CHECK-CC6: NotImplemented:{TypedText volatile} (50)
anatofuz
parents:
diff changeset
55
anatofuz
parents:
diff changeset
56 // RUN: c-index-test -code-completion-at=%s:24:4 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC7 %s
anatofuz
parents:
diff changeset
57 // RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:24:4 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC7 %s
anatofuz
parents:
diff changeset
58 // CHECK-CC7: ParmDecl:{ResultType float}{TypedText f} (34)
anatofuz
parents:
diff changeset
59 // CHECK-CC7: VarDecl:{ResultType struct X}{TypedText f1} (50) (deprecated)
anatofuz
parents:
diff changeset
60 // CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f2}{LeftParen (}{RightParen )} (50)
anatofuz
parents:
diff changeset
61 // CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f3}{LeftParen (}{Placeholder const char *, ...}{Text , NULL}{RightParen )} (50)
anatofuz
parents:
diff changeset
62 // CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f4}{LeftParen (}{Placeholder const char *str}{RightParen )} (50)
anatofuz
parents:
diff changeset
63 // CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f5}{LeftParen (}{Placeholder float f}{RightParen )} (50)
anatofuz
parents:
diff changeset
64 // CHECK-CC7: TypedefDecl:{TypedText type} (50)