Douglas Gregor | f696152 | 2010-08-27 21:18:54 +0000 | [diff] [blame] | 1 | // The run lines are below, because this test is line- and |
| 2 | // column-number sensitive. |
| 3 | |
| 4 | struct A { |
| 5 | virtual void foo(int x, int y); |
| 6 | virtual void bar(double x); |
| 7 | virtual void bar(float x); |
| 8 | }; |
| 9 | |
| 10 | struct B : A { |
| 11 | void foo(int a, int b); |
| 12 | void bar(float real); |
| 13 | }; |
| 14 | |
| 15 | void B::foo(int a, int b) { |
| 16 | A::foo(a, b); |
| 17 | } |
| 18 | |
| 19 | void B::bar(float real) { |
| 20 | A::bar(real); |
| 21 | } |
| 22 | |
| 23 | // RUN: c-index-test -code-completion-at=%s:16:3 %s | FileCheck -check-prefix=CHECK-FOO-UNQUAL %s |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 24 | // CHECK-FOO-UNQUAL: CXXMethod:{Text A::}{TypedText foo}{LeftParen (}{Placeholder a}{Comma , }{Placeholder b}{RightParen )} (20) |
Douglas Gregor | f696152 | 2010-08-27 21:18:54 +0000 | [diff] [blame] | 25 | |
| 26 | // RUN: c-index-test -code-completion-at=%s:20:3 %s | FileCheck -check-prefix=CHECK-BAR-UNQUAL %s |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 27 | // CHECK-BAR-UNQUAL: CXXMethod:{Text A::}{TypedText bar}{LeftParen (}{Placeholder real}{RightParen )} (20) |
| 28 | // CHECK-BAR-UNQUAL: CXXMethod:{ResultType void}{TypedText bar}{LeftParen (}{Placeholder float real}{RightParen )} (34) |
| 29 | // CHECK-BAR-UNQUAL: CXXMethod:{ResultType void}{Text A::}{TypedText bar}{LeftParen (}{Placeholder double x}{RightParen )} (36) |
Douglas Gregor | f696152 | 2010-08-27 21:18:54 +0000 | [diff] [blame] | 30 | |
| 31 | // RUN: c-index-test -code-completion-at=%s:16:6 %s | FileCheck -check-prefix=CHECK-FOO-QUAL %s |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 32 | // CHECK-FOO-QUAL: CXXMethod:{TypedText foo}{LeftParen (}{Placeholder a}{Comma , }{Placeholder b}{RightParen )} (20) |
Douglas Gregor | f696152 | 2010-08-27 21:18:54 +0000 | [diff] [blame] | 33 | |
Douglas Gregor | 10ccf12 | 2012-04-10 17:56:28 +0000 | [diff] [blame] | 34 | // RUN: c-index-test -code-completion-at=%s:5:1 %s | FileCheck -check-prefix=CHECK-ACCESS %s |
| 35 | // CHECK-ACCESS: NotImplemented:{TypedText private} (40) |
| 36 | // CHECK-ACCESS: NotImplemented:{TypedText protected} (40) |
| 37 | // CHECK-ACCESS: NotImplemented:{TypedText public} (40) |
| 38 | |
| 39 | // RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:5:1 %s | FileCheck -check-prefix=CHECK-ACCESS-PATTERN %s |
| 40 | // CHECK-ACCESS-PATTERN: NotImplemented:{TypedText private}{Colon :} (40) |
| 41 | // CHECK-ACCESS-PATTERN: NotImplemented:{TypedText protected}{Colon :} (40) |
| 42 | // CHECK-ACCESS-PATTERN: NotImplemented:{TypedText public}{Colon :} (40) |