xref: /aosp_15_r20/external/clang/test/Index/retain-comments-from-system-headers.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // Run lines are sensitive to line numbers and come below the code.
2*67e74705SXin Li 
3*67e74705SXin Li #include "retain-comments-from-system-headers.h"
4*67e74705SXin Li 
5*67e74705SXin Li /**
6*67e74705SXin Li  * user_function
7*67e74705SXin Li  * \param a Aaa.
8*67e74705SXin Li  */
9*67e74705SXin Li int user_function(int a);
10*67e74705SXin Li 
11*67e74705SXin Li // RUN: rm -rf %t/cache
12*67e74705SXin Li // RUN: c-index-test -test-load-source all %s -I %S/Inputs | FileCheck %s
13*67e74705SXin Li // RUN: c-index-test -test-load-source all %s -fretain-comments-from-system-headers -I %S/Inputs | FileCheck %s -check-prefix=CHECK-RETAIN
14*67e74705SXin Li 
15*67e74705SXin Li // Modules:
16*67e74705SXin Li // RUN: c-index-test -test-load-source all %s -I %S/Inputs -fmodules -fmodules-cache-path=%t/cache -fmodule-map-file=%S/Inputs/retain-comments-from-system-headers-module.map | FileCheck %s
17*67e74705SXin Li // RUN: c-index-test -test-load-source all %s -fretain-comments-from-system-headers -I %S/Inputs -fmodules -fmodules-cache-path=%t/cache -fmodule-map-file=%S/Inputs/retain-comments-from-system-headers-module.map | FileCheck %s -check-prefix=CHECK-RETAIN
18*67e74705SXin Li 
19*67e74705SXin Li // CHECK: retain-comments-from-system-headers.h:7:5: FunctionDecl=system_function:7:5 Extent=[7:1 - 7:27]
20*67e74705SXin Li // CHECK: retain-comments-from-system-headers.c:9:5: FunctionDecl=user_function:9:5 RawComment=[/**\n * user_function\n * \param a Aaa.\n */] RawCommentRange=[5:1 - 8:4] BriefComment=[user_function]
21*67e74705SXin Li 
22*67e74705SXin Li // CHECK-RETAIN: retain-comments-from-system-headers.h:7:5: FunctionDecl=system_function:7:5 RawComment=[/**\n * system_function\n * \param a Aaa.\n */] RawCommentRange=[3:1 - 6:4] BriefComment=[system_function]
23*67e74705SXin Li // CHECK-RETAIN: retain-comments-from-system-headers.c:9:5: FunctionDecl=user_function:9:5 RawComment=[/**\n * user_function\n * \param a Aaa.\n */] RawCommentRange=[5:1 - 8:4] BriefComment=[user_function]
24