1 // Note: the run lines follow their respective tests, since line/column
2 // matter in this test.
3
4 void foo(int a = 42, int = 42);
5 void bar(int a, int b = 42, int c = 42);
6 void baz(int a = 42, ...);
SS7 struct S{ S(int a = 42, int = 42) {} };
8
main()9 int main() {
10 foo(42, 42);
11 bar(42, 42, 42);
12 baz(42, 42, 42);
13 S s(42, 42);
14 }
15
16 // RUN: c-index-test -code-completion-at=%s:10:9 %s | FileCheck -check-prefix=CHECK-CC1 %s
17 // CHECK-CC1: OverloadCandidate:{ResultType void}{Text foo}{LeftParen (}{Optional {CurrentParameter int a}{Optional {Comma , }{Placeholder int}}}{RightParen )} (1)
18 // CHECK-CC1: Completion contexts:
19 // CHECK-CC1-NEXT: Any type
20 // CHECK-CC1-NEXT: Any value
21 // CHECK-CC1-NEXT: Enum tag
22 // CHECK-CC1-NEXT: Union tag
23 // CHECK-CC1-NEXT: Struct tag
24 // CHECK-CC1-NEXT: Class name
25 // CHECK-CC1-NEXT: Nested name specifier
26 // CHECK-CC1-NEXT: Objective-C interface
27
28 // RUN: c-index-test -code-completion-at=%s:11:9 %s | FileCheck -check-prefix=CHECK-CC2 %s
29 // CHECK-CC2: OverloadCandidate:{ResultType void}{Text bar}{LeftParen (}{CurrentParameter int a}{Optional {Comma , }{Placeholder int b}{Optional {Comma , }{Placeholder int c}}}{RightParen )} (1)
30 // CHECK-CC2: Completion contexts:
31 // CHECK-CC2-NEXT: Any type
32 // CHECK-CC2-NEXT: Any value
33 // CHECK-CC2-NEXT: Enum tag
34 // CHECK-CC2-NEXT: Union tag
35 // CHECK-CC2-NEXT: Struct tag
36 // CHECK-CC2-NEXT: Class name
37 // CHECK-CC2-NEXT: Nested name specifier
38 // CHECK-CC2-NEXT: Objective-C interface
39
40 // RUN: c-index-test -code-completion-at=%s:11:16 %s | FileCheck -check-prefix=CHECK-CC3 %s
41 // CHECK-CC3: OverloadCandidate:{ResultType void}{Text bar}{LeftParen (}{Placeholder int a}{Optional {Comma , }{Placeholder int b}{Optional {Comma , }{CurrentParameter int c}}}{RightParen )} (1)
42 // CHECK-CC3: Completion contexts:
43 // CHECK-CC3-NEXT: Any type
44 // CHECK-CC3-NEXT: Any value
45 // CHECK-CC3-NEXT: Enum tag
46 // CHECK-CC3-NEXT: Union tag
47 // CHECK-CC3-NEXT: Struct tag
48 // CHECK-CC3-NEXT: Class name
49 // CHECK-CC3-NEXT: Nested name specifier
50 // CHECK-CC3-NEXT: Objective-C interface
51
52 // RUN: c-index-test -code-completion-at=%s:12:16 %s | FileCheck -check-prefix=CHECK-CC4 %s
53 // CHECK-CC4: OverloadCandidate:{ResultType void}{Text baz}{LeftParen (}{Optional {Placeholder int a}{Optional {Comma , }{CurrentParameter ...}}}{RightParen )} (1)
54 // CHECK-CC4: Completion contexts:
55 // CHECK-CC4-NEXT: Any type
56 // CHECK-CC4-NEXT: Any value
57 // CHECK-CC4-NEXT: Enum tag
58 // CHECK-CC4-NEXT: Union tag
59 // CHECK-CC4-NEXT: Struct tag
60 // CHECK-CC4-NEXT: Class name
61 // CHECK-CC4-NEXT: Nested name specifier
62 // CHECK-CC4-NEXT: Objective-C interface
63
64 // RUN: c-index-test -code-completion-at=%s:13:9 %s | FileCheck -check-prefix=CHECK-CC5 %s
65 // CHECK-CC5: OverloadCandidate:{Text S}{LeftParen (}{Optional {CurrentParameter int a}{Optional {Comma , }{Placeholder int}}}{RightParen )} (1)
66 // CHECK-CC5: OverloadCandidate:{Text S}{LeftParen (}{CurrentParameter const S &}{RightParen )} (1)
67 // CHECK-CC5: Completion contexts:
68 // CHECK-CC5-NEXT: Any type
69 // CHECK-CC5-NEXT: Any value
70 // CHECK-CC5-NEXT: Enum tag
71 // CHECK-CC5-NEXT: Union tag
72 // CHECK-CC5-NEXT: Struct tag
73 // CHECK-CC5-NEXT: Class name
74 // CHECK-CC5-NEXT: Nested name specifier
75 // CHECK-CC5-NEXT: Objective-C interface
76