xref: /llvm-project/clang/test/CodeCompletion/paren_locs.cpp (revision cf9b25e0adc42546e4dc5ff51ee8674d45bac26b)
1 void foo(int a, int b);
2 void foo(int a, int b, int c);
3 
test()4 void test() {
5   foo(10, );
6   // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):10 %s -o - \
7   // RUN: | FileCheck -check-prefix=CHECK-CC1 %s
8   // CHECK-CC1: OPENING_PAREN_LOC: {{.*}}paren_locs.cpp:5:6
9 
10 #define FOO foo(
11   FOO 10, );
12 #undef FOO
13   // RUN: not %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-2):10 %s -o - \
14   // RUN: | FileCheck -check-prefix=CHECK-CC2 %s
15   // CHECK-CC2: OPENING_PAREN_LOC: {{.*}}paren_locs.cpp:11:3
16 
17   struct Foo {
18     Foo(int a, int b);
19     Foo(int a, int b, int c);
20   };
21   Foo a(10, );
22   // RUN: not %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):12 %s -o - \
23   // RUN: | FileCheck -check-prefix=CHECK-CC3 %s
24   // CHECK-CC3: OPENING_PAREN_LOC: {{.*}}paren_locs.cpp:21:8
25   Foo(10, );
26   // RUN: not %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):10 %s -o - \
27   // RUN: | FileCheck -check-prefix=CHECK-CC4 %s
28   // CHECK-CC4: OPENING_PAREN_LOC: {{.*}}paren_locs.cpp:25:6
29   new Foo(10, );
30   // RUN: not %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-1):15 %s -o - \
31   // RUN: | FileCheck -check-prefix=CHECK-CC5 %s
32   // CHECK-CC5: OPENING_PAREN_LOC: {{.*}}paren_locs.cpp:29:10
33 }
34