blob: a64e62f239def261029681a774cda2cc9598ed84 [file] [log] [blame]
Dmitri Gribenkod99ef532012-07-02 17:35:10 +00001// Note: the run lines follow their respective tests, since line/column
2// matter in this test.
3
4/// Aaa.
5void T1(float x, float y);
6
7/// Bbb.
8class T2 {
9public:
10 /// Ccc.
11 void T3();
12
13 int T4; ///< Ddd.
14};
15
16/// Eee.
17namespace T5 {
18}
19
Dmitri Gribenkof50555e2012-08-11 00:51:43 +000020struct T6 {
21 /// \brief Fff.
22 void T7();
Dmitri Gribenkod99ef532012-07-02 17:35:10 +000023
Dmitri Gribenkof50555e2012-08-11 00:51:43 +000024 /// \brief Ggg.
25 void T8();
26};
27
28void T6::T7() {
Dmitri Gribenkod99ef532012-07-02 17:35:10 +000029}
30
Dmitri Gribenkof50555e2012-08-11 00:51:43 +000031void 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 Gribenkod99ef532012-07-02 17:35:10 +000041// 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 Gribenkof50555e2012-08-11 00:51:43 +000045// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:34:6 %s | FileCheck -check-prefix=CC2 %s
Dmitri Gribenkod99ef532012-07-02 17:35:10 +000046// CHECK-CC2: CXXMethod:{ResultType void}{TypedText T3}{{.*}}(brief comment: Ccc.)
47// CHECK-CC2: FieldDecl:{ResultType int}{TypedText T4}{{.*}}(brief comment: Ddd.)
Dmitri Gribenkof50555e2012-08-11 00:51:43 +000048
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.)