xref: /llvm-project/clang/test/Index/complete-documentation.cpp (revision 3292d06a1ba34eaa99226cc2133e03b47c471c3b)
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 
20 void test() {
21 
22   T2 t2;
23   t2.
24 }
25 
26 // RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:21:1 %s | FileCheck -check-prefix=CC1 %s
27 // CHECK-CC1: FunctionDecl:{ResultType void}{TypedText T1}{{.*}}(brief comment: Aaa.)
28 // CHECK-CC1: ClassDecl:{TypedText T2}{{.*}}(brief comment: Bbb.)
29 // CHECK-CC1: Namespace:{TypedText T5}{{.*}}(brief comment: Eee.)
30 
31 // RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:23:6 %s | FileCheck -check-prefix=CC2 %s
32 // CHECK-CC2: CXXMethod:{ResultType void}{TypedText T3}{{.*}}(brief comment: Ccc.)
33 // CHECK-CC2: FieldDecl:{ResultType int}{TypedText T4}{{.*}}(brief comment: Ddd.)
34