Clang Project

clang_source_code/test/CodeCompletion/paren_locs.cpp
1void foo(int a, int b);
2void foo(int a, int b, int c);
3
4void test() {
5  foo(10, );
6  // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:5: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:11: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:21: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:25: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:29:15 %s -o - \
31  // RUN: | FileCheck -check-prefix=CHECK-CC5 %s
32  // CHECK-CC5: OPENING_PAREN_LOC: {{.*}}paren_locs.cpp:29:10
33}
34