Dmitri Gribenko | d99ef53 | 2012-07-02 17:35:10 +0000 | [diff] [blame] | 1 | // Note: the run lines follow their respective tests, since line/column |
| 2 | // matter in this test. |
| 3 | |
| 4 | /// Aaa. |
| 5 | void T1(float x, float y); |
| 6 | |
| 7 | /// Bbb. |
| 8 | class T2 { |
| 9 | public: |
| 10 | /// Ccc. |
| 11 | void T3(); |
| 12 | |
| 13 | int T4; ///< Ddd. |
| 14 | }; |
| 15 | |
| 16 | /// Eee. |
| 17 | namespace T5 { |
| 18 | } |
| 19 | |
Dmitri Gribenko | f50555e | 2012-08-11 00:51:43 +0000 | [diff] [blame^] | 20 | struct T6 { |
| 21 | /// \brief Fff. |
| 22 | void T7(); |
Dmitri Gribenko | d99ef53 | 2012-07-02 17:35:10 +0000 | [diff] [blame] | 23 | |
Dmitri Gribenko | f50555e | 2012-08-11 00:51:43 +0000 | [diff] [blame^] | 24 | /// \brief Ggg. |
| 25 | void T8(); |
| 26 | }; |
| 27 | |
| 28 | void T6::T7() { |
Dmitri Gribenko | d99ef53 | 2012-07-02 17:35:10 +0000 | [diff] [blame] | 29 | } |
| 30 | |
Dmitri Gribenko | f50555e | 2012-08-11 00:51:43 +0000 | [diff] [blame^] | 31 | void test1() { |
| 32 | |
| 33 | T2 t2; |
| 34 | t2.T4; |
| 35 | |
| 36 | T6 t6; |
| 37 | t6.T8(); |
| 38 | } |
| 39 | |
| 40 | // RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:32:1 %s | FileCheck -check-prefix=CC1 %s |
Dmitri Gribenko | d99ef53 | 2012-07-02 17:35:10 +0000 | [diff] [blame] | 41 | // CHECK-CC1: FunctionDecl:{ResultType void}{TypedText T1}{{.*}}(brief comment: Aaa.) |
| 42 | // CHECK-CC1: ClassDecl:{TypedText T2}{{.*}}(brief comment: Bbb.) |
| 43 | // CHECK-CC1: Namespace:{TypedText T5}{{.*}}(brief comment: Eee.) |
| 44 | |
Dmitri Gribenko | f50555e | 2012-08-11 00:51:43 +0000 | [diff] [blame^] | 45 | // RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:34:6 %s | FileCheck -check-prefix=CC2 %s |
Dmitri Gribenko | d99ef53 | 2012-07-02 17:35:10 +0000 | [diff] [blame] | 46 | // CHECK-CC2: CXXMethod:{ResultType void}{TypedText T3}{{.*}}(brief comment: Ccc.) |
| 47 | // CHECK-CC2: FieldDecl:{ResultType int}{TypedText T4}{{.*}}(brief comment: Ddd.) |
Dmitri Gribenko | f50555e | 2012-08-11 00:51:43 +0000 | [diff] [blame^] | 48 | |
| 49 | // RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:37:6 %s | FileCheck -check-prefix=CC3 %s |
| 50 | // CHECK-CC3: CXXMethod:{ResultType void}{TypedText T7}{LeftParen (}{RightParen )} (34) (parent: StructDecl 'T6')(brief comment: Fff.) |
| 51 | // CHECK-CC3: CXXMethod:{ResultType void}{TypedText T8}{LeftParen (}{RightParen )} (34) (parent: StructDecl 'T6')(brief comment: Ggg.) |