diff options
| author | Julie Hockett <juliehockett@google.com> | 2018-08-02 20:10:17 +0000 |
|---|---|---|
| committer | Julie Hockett <juliehockett@google.com> | 2018-08-02 20:10:17 +0000 |
| commit | 8899c29b1e0835f06972b03adab2e8fd91339c8d (patch) | |
| tree | 51f122d564bd08a833ce38a9954852516b40f849 /clang-tools-extra/test/clang-doc/public-module.cpp | |
| parent | 31da130e4dcce5a4fe72eb187db3e169cba4ec23 (diff) | |
| download | bcm5719-llvm-8899c29b1e0835f06972b03adab2e8fd91339c8d.tar.gz bcm5719-llvm-8899c29b1e0835f06972b03adab2e8fd91339c8d.zip | |
Reland "[clang-doc] Refactoring mapper to map by scope"
Relanding with a minor change to prevent an assertion on release bots.
The result of this adjusted mapper pass is that all Function and Enum
infos are absorbed into the info of their enclosing scope (i.e. the class
or namespace in which they are defined). Namespace and Record infos are
passed along to the final output, but the second pass creates a reference
to each in its parent scope. As a result, the top-level final outputs are
Namespaces and Records.
Differential Revision: https://reviews.llvm.org/D48341
llvm-svn: 338763
Diffstat (limited to 'clang-tools-extra/test/clang-doc/public-module.cpp')
| -rw-r--r-- | clang-tools-extra/test/clang-doc/public-module.cpp | 84 |
1 files changed, 41 insertions, 43 deletions
diff --git a/clang-tools-extra/test/clang-doc/public-module.cpp b/clang-tools-extra/test/clang-doc/public-module.cpp index c7ebadda7a6..0c93d688437 100644 --- a/clang-tools-extra/test/clang-doc/public-module.cpp +++ b/clang-tools-extra/test/clang-doc/public-module.cpp @@ -1,53 +1,51 @@ -// This test requires linux because it uses `diff` and compares filepaths -// REQUIRES: system-linux +// THIS IS A GENERATED TEST. DO NOT EDIT. +// To regenerate, see clang-doc/gen_test.py docstring. +// // RUN: rm -rf %t // RUN: mkdir %t // RUN: echo "" > %t/compile_flags.txt // RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc --public --extra-arg=-fmodules-ts --doxygen -p %t %t/test.cpp -output=%t/docs-with-public-flag -// RUN: clang-doc --extra-arg=-fmodules-ts --doxygen -p %t %t/test.cpp -output=%t/docs-without -// RUN: cat %t/docs-with-public-flag/moduleFunction.yaml | FileCheck %s --check-prefix=CHECK-A -// RUN: cat %t/docs-with-public-flag/exportedModuleFunction.yaml | FileCheck %s --check-prefix=CHECK-B -// RUN: (diff -qry %t/docs-with-public-flag %t/docs-without | sed 's:.*/::' > %t/public.diff) || true -// RUN: cat %t/public.diff | FileCheck %s --check-prefix=CHECK-C export module M; -int moduleFunction(int x); //ModuleLinkage -// CHECK-A: --- -// CHECK-A-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-A-NEXT: Name: 'moduleFunction' -// CHECK-A-NEXT: Location: -// CHECK-A-NEXT: - LineNumber: 16 -// CHECK-A-NEXT: Filename: {{.*}} -// CHECK-A-NEXT: Params: -// CHECK-A-NEXT: - Type: -// CHECK-A-NEXT: Name: 'int' -// CHECK-A-NEXT: Name: 'x' -// CHECK-A-NEXT: ReturnType: -// CHECK-A-NEXT: Type: -// CHECK-A-NEXT: Name: 'int' -// CHECK-A-NEXT: ... +int moduleFunction(int x); // ModuleLinkage -static int staticModuleFunction(int x); //ModuleInternalLinkage +static int staticModuleFunction(int x); // ModuleInternalLinkage -export double exportedModuleFunction(double y, int z); //ExternalLinkage -// CHECK-B: --- -// CHECK-B-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-B-NEXT: Name: 'exportedModuleFunction' -// CHECK-B-NEXT: Location: -// CHECK-B-NEXT: - LineNumber: 34 -// CHECK-B-NEXT: Filename: {{.*}} -// CHECK-B-NEXT: Params: -// CHECK-B-NEXT: - Type: -// CHECK-B-NEXT: Name: 'double' -// CHECK-B-NEXT: Name: 'y' -// CHECK-B-NEXT: - Type: -// CHECK-B-NEXT: Name: 'int' -// CHECK-B-NEXT: Name: 'z' -// CHECK-B-NEXT: ReturnType: -// CHECK-B-NEXT: Type: -// CHECK-B-NEXT: Name: 'double' -// CHECK-B-NEXT: ... +export double exportedModuleFunction(double y, int z); // ExternalLinkage -// CHECK-C: docs-without: staticModuleFunction.yaml +// RUN: clang-doc --format=yaml --doxygen --public --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs + + +// RUN: cat %t/docs/./GlobalNamespace.yaml | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: --- +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: ChildFunctions: +// CHECK-0-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'moduleFunction' +// CHECK-0-NEXT: Location: +// CHECK-0-NEXT: - LineNumber: 11 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: Params: +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'x' +// CHECK-0-NEXT: ReturnType: +// CHECK-0-NEXT: Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'exportedModuleFunction' +// CHECK-0-NEXT: Location: +// CHECK-0-NEXT: - LineNumber: 15 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: Params: +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'double' +// CHECK-0-NEXT: Name: 'y' +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'z' +// CHECK-0-NEXT: ReturnType: +// CHECK-0-NEXT: Type: +// CHECK-0-NEXT: Name: 'double' +// CHECK-0-NEXT: ... |

