Index: clang-tools-extra/clang-doc/gen_tests.py =================================================================== --- /dev/null +++ clang-tools-extra/clang-doc/gen_tests.py @@ -0,0 +1,200 @@ +#!/usr/bin/env python3 +# +#===- gen_tests.py - clang-doc test generator ----------------*- python -*--===# +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +#===------------------------------------------------------------------------===# +""" +clang-doc test generator +========================== + +Generates tests for clang-doc given a certain set of flags, a prefix for the +test file, and a given clang-doc binary. Please check emitted tests for +accuracy before using. + +To generate all current tests: +- Generate mapper tests: + gen_tests.py --flag='--dump-mapper' --flag='--doxygen' --prefix mapper + +- Generate reducer tests: + gen_tests.py --flag='--dump-intermediate' --flag='--doxygen' --prefix bc + +- Generate yaml tests: + gen_tests.py --flag='--format=yaml' --flag='--doxygen' --prefix yaml + +This script was written on/for Linux, and has not been tested on any other +platform and so it may not work. + +""" + +import argparse +import glob +import os +import shutil +import subprocess + +RUN_CLANG_DOC = """ +// RUN: clang-doc {0} -p %t %t/test.cpp -output=%t/docs +""" +RUN = """ +// RUN: {0} %t/{1} | FileCheck %s --check-prefix CHECK-{2} +""" + +CHECK = '// CHECK-{0}: ' + +CHECK_NEXT = '// CHECK-{0}-NEXT: ' + + +def clear_test_prefix_files(prefix, tests_path): + if os.path.isdir(tests_path): + for root, dirs, files in os.walk(tests_path): + for filename in files: + if filename.startswith(prefix): + os.remove(os.path.join(root, filename)) + + +def copy_to_test_file(test_case_path, test_cases_path): + # Copy file to 'test.cpp' to preserve file-dependent USRs + test_file = os.path.join(test_cases_path, 'test.cpp') + shutil.copyfile(test_case_path, test_file) + return test_file + + +def run_clang_doc(args, out_dir, test_file): + # Run clang-doc. + current_cmd = [args.clangdoc] + current_cmd.extend(args.flags) + current_cmd.append('--output=' + out_dir) + current_cmd.append(test_file) + print('Running ' + ' '.join(current_cmd)) + return_code = subprocess.call(current_cmd) + if return_code: + return 1 + return 0 + + +def get_test_case_code(test_case_path, flags): + # Get the test case code + code = '' + with open(test_case_path, 'r') as code_file: + code = code_file.read() + + code += RUN_CLANG_DOC.format(flags) + return code + + +def get_output(root, out_file, case_out_path, flags, checkname, bcanalyzer): + output = '' + run_cmd = '' + if '--dump-mapper' in flags or '--dump-intermediate' in flags: + # Run llvm-bcanalyzer + output = subprocess.check_output( + [bcanalyzer, '--dump', + os.path.join(root, out_file)]) + output = output[:output.find('Summary of ')].rstrip() + run_cmd = RUN.format('llvm-bcanalyzer --dump', + os.path.join('docs', 'bc', out_file), checkname) + else: + # Run cat + output = subprocess.check_output(['cat', os.path.join(root, out_file)]) + run_cmd = RUN.format( + 'cat', + os.path.join('docs', os.path.relpath(root, case_out_path), + out_file), checkname) + + # Format output. + output = output.replace('blob data = \'test\'', 'blob data = \'{{.*}}\'') + output = CHECK.format(checkname) + output.rstrip() + output = run_cmd + output.replace('\n', + '\n' + CHECK_NEXT.format(checkname)) + + return output + '\n' + + +def main(): + parser = argparse.ArgumentParser(description='Generate clang-doc tests.') + parser.add_argument( + '-flag', + action='append', + default=[], + dest='flags', + help='Flags to pass to clang-doc.') + parser.add_argument( + '-prefix', + type=str, + default='', + dest='prefix', + help='Prefix for this test group.') + parser.add_argument( + '-clang-doc-binary', + dest='clangdoc', + metavar="PATH", + default='clang-doc', + help='path to clang-doc binary') + parser.add_argument( + '-llvm-bcanalyzer-binary', + dest='bcanalyzer', + metavar="PATH", + default='llvm-bcanalyzer', + help='path to llvm-bcanalyzer binary') + args = parser.parse_args() + + flags = ' '.join(args.flags) + + clang_doc_path = os.path.dirname(__file__) + tests_path = os.path.join(clang_doc_path, '..', 'test', 'clang-doc') + test_cases_path = os.path.join(tests_path, 'test_cases') + + clear_test_prefix_files(args.prefix, tests_path) + + for test_case_path in glob.glob(os.path.join(test_cases_path, '*')): + if test_case_path.endswith( + 'compile_flags.txt') or test_case_path.endswith( + 'compile_commands.json'): + continue + + # Name of this test case + case_name = os.path.basename(test_case_path).split('.')[0] + + test_file = copy_to_test_file(test_case_path, test_cases_path) + out_dir = os.path.join(test_cases_path, case_name) + + if run_clang_doc(args, out_dir, test_file): + return 1 + + # Retrieve output and format as FileCheck tests + all_output = '' + num_outputs = 0 + for root, dirs, files in os.walk(out_dir): + for out_file in files: + # Make the file check the first 3 letters (there's a very small chance + # that this will collide, but the fix is to simply change the decl name) + usr = os.path.basename(out_file).split('.') + # If the usr is less than 2, this isn't one of the test files. + if len(usr) < 2: + continue + all_output += get_output(root, out_file, out_dir, args.flags, + num_outputs, args.bcanalyzer) + num_outputs += 1 + + # Add test case code to test + all_output = get_test_case_code(test_case_path, + flags) + '\n' + all_output + + # Write to test case file in /test. + test_out_path = os.path.join( + tests_path, args.prefix + '-' + os.path.basename(test_case_path)) + with open(test_out_path, 'w+') as o: + o.write(all_output) + + # Clean up + shutil.rmtree(out_dir) + os.remove(test_file) + + +if __name__ == '__main__': + main() Index: clang-tools-extra/test/clang-doc/bc-comment.cpp =================================================================== --- clang-tools-extra/test/clang-doc/bc-comment.cpp +++ clang-tools-extra/test/clang-doc/bc-comment.cpp @@ -2,9 +2,7 @@ // RUN: mkdir %t // RUN: echo "" > %t/compile_flags.txt // RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc --dump-intermediate -doxygen -p %t %t/test.cpp -output=%t/docs -// RUN: llvm-bcanalyzer %t/docs/bc/7574630614A535710E5A6ABCFFF98BCA2D06A4CA.bc --dump | FileCheck %s - + /// \brief Brief description. /// /// Extended description that @@ -26,172 +24,176 @@ /// Bonus comment on definition void F(int I, int J) {} -// CHECK: -// CHECK-NEXT: - // CHECK-NEXT: -// CHECK-NEXT: -// CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'F' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'FullComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParagraphComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'BlockCommandComment' - // CHECK-NEXT: blob data = 'brief' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParagraphComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: blob data = ' Brief description.' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParagraphComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: blob data = ' Extended description that' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: blob data = ' continues onto the next line.' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParagraphComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'HTMLStartTagComment' - // CHECK-NEXT: blob data = 'ul' - // CHECK-NEXT: blob data = 'class' - // CHECK-NEXT: blob data = 'test' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'HTMLStartTagComment' - // CHECK-NEXT: blob data = 'li' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: blob data = ' Testing.' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'HTMLEndTagComment' - // CHECK-NEXT: blob data = 'ul' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParagraphComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'VerbatimBlockComment' - // CHECK-NEXT: blob data = 'verbatim' - // CHECK-NEXT: blob data = 'endverbatim' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'VerbatimBlockLineComment' - // CHECK-NEXT: blob data = ' The description continues.' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParagraphComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: blob data = ' --' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParamCommandComment' - // CHECK-NEXT: blob data = '[out]' - // CHECK-NEXT: blob data = 'I' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParagraphComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: blob data = ' is a parameter.' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParamCommandComment' - // CHECK-NEXT: blob data = '[in]' - // CHECK-NEXT: blob data = 'J' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParagraphComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: blob data = ' is a parameter.' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'BlockCommandComment' - // CHECK-NEXT: blob data = 'return' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParagraphComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: blob data = ' void' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'FullComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParagraphComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: blob data = ' Bonus comment on definition' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = '{{.*}}' - // CHECK-NEXT: blob data = '{{.*}}' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'void' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'int' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'I' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'int' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'J' - // CHECK-NEXT: -// CHECK-NEXT: +// RUN: clang-doc --dump-intermediate --doxygen -p %t %t/test.cpp -output=%t/docs + + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/7574630614A535710E5A6ABCFFF98BCA2D06A4CA.bc | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'F' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'FullComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'BlockCommandComment' +// CHECK-0-NEXT: blob data = 'brief' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: blob data = ' Brief description.' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: blob data = ' Extended description that' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: blob data = ' continues onto the next line.' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'HTMLStartTagComment' +// CHECK-0-NEXT: blob data = 'ul' +// CHECK-0-NEXT: blob data = 'class' +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'HTMLStartTagComment' +// CHECK-0-NEXT: blob data = 'li' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: blob data = ' Testing.' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'HTMLEndTagComment' +// CHECK-0-NEXT: blob data = 'ul' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'VerbatimBlockComment' +// CHECK-0-NEXT: blob data = 'verbatim' +// CHECK-0-NEXT: blob data = 'endverbatim' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'VerbatimBlockLineComment' +// CHECK-0-NEXT: blob data = ' The description continues.' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: blob data = ' --' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParamCommandComment' +// CHECK-0-NEXT: blob data = '[out]' +// CHECK-0-NEXT: blob data = 'I' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: blob data = ' is a parameter.' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParamCommandComment' +// CHECK-0-NEXT: blob data = '[in]' +// CHECK-0-NEXT: blob data = 'J' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: blob data = ' is a parameter.' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'BlockCommandComment' +// CHECK-0-NEXT: blob data = 'return' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: blob data = ' void' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'FullComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: blob data = ' Bonus comment on definition' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'void' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'int' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'I' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'int' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'J' +// CHECK-0-NEXT: +// CHECK-0-NEXT: Index: clang-tools-extra/test/clang-doc/bc-namespace.cpp =================================================================== --- clang-tools-extra/test/clang-doc/bc-namespace.cpp +++ clang-tools-extra/test/clang-doc/bc-namespace.cpp @@ -2,18 +2,8 @@ // RUN: mkdir %t // RUN: echo "" > %t/compile_flags.txt // RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc --dump-intermediate -doxygen -p %t %t/test.cpp -output=%t/docs -// RUN: llvm-bcanalyzer %t/docs/bc/8D042EFFC98B373450BC6B5B90A330C25A150E9C.bc --dump | FileCheck %s --check-prefix CHECK-A -// RUN: llvm-bcanalyzer %t/docs/bc/E21AF79E2A9D02554BA090D10DF39FE273F5CDB5.bc --dump | FileCheck %s --check-prefix CHECK-B -// RUN: llvm-bcanalyzer %t/docs/bc/39D3C95A5F7CE2BA4937BD7B01BAE09EBC2AD8AC.bc --dump | FileCheck %s --check-prefix CHECK-F -// RUN: llvm-bcanalyzer %t/docs/bc/9A82CB33ED0FDF81EE383D31CD0957D153C5E840.bc --dump | FileCheck %s --check-prefix CHECK-FUNC -// RUN: llvm-bcanalyzer %t/docs/bc/E9ABF7E7E2425B626723D41E76E4BC7E7A5BD775.bc --dump | FileCheck %s --check-prefix CHECK-E - + namespace A { -// CHECK-A: - // CHECK-A-NEXT: - // CHECK-A-NEXT: blob data = 'A' -// CHECK-A-NEXT: void f(); @@ -22,88 +12,125 @@ namespace A { void f(){}; -// CHECK-F: - // CHECK-F-NEXT: - // CHECK-F-NEXT: blob data = 'f' - // CHECK-F-NEXT: - // CHECK-F-NEXT: - // CHECK-F-NEXT: blob data = 'A' - // CHECK-F-NEXT: - // CHECK-F-NEXT: - // CHECK-F-NEXT: - // CHECK-F-NEXT: blob data = '{{.*}}' - // CHECK-F-NEXT: blob data = '{{.*}}' - // CHECK-F-NEXT: - // CHECK-F-NEXT: - // CHECK-F-NEXT: blob data = 'void' - // CHECK-F-NEXT: - // CHECK-F-NEXT: - // CHECK-F-NEXT: -// CHECK-F-NEXT: namespace B { -// CHECK-B: - // CHECK-B-NEXT: - // CHECK-B-NEXT: blob data = 'B' - // CHECK-B-NEXT: - // CHECK-B-NEXT: - // CHECK-B-NEXT: blob data = 'A' - // CHECK-B-NEXT: - // CHECK-B-NEXT: - // CHECK-B-NEXT: -// CHECK-B-NEXT: enum E { X }; -// CHECK-E: - // CHECK-E-NEXT: - // CHECK-E-NEXT: blob data = 'E' - // CHECK-E-NEXT: - // CHECK-E-NEXT: - // CHECK-E-NEXT: blob data = 'B' - // CHECK-E-NEXT: - // CHECK-E-NEXT: - // CHECK-E-NEXT: - // CHECK-E-NEXT: - // CHECK-E-NEXT: - // CHECK-E-NEXT: blob data = 'A' - // CHECK-E-NEXT: - // CHECK-E-NEXT: - // CHECK-E-NEXT: - // CHECK-E-NEXT: blob data = '{{.*}}' - // CHECK-E-NEXT: blob data = 'X' -// CHECK-E-NEXT: E func(int i) { return X; } -// CHECK-FUNC: - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: blob data = 'func' - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: blob data = 'B' - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: blob data = 'A' - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: blob data = '{{.*}}' - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: blob data = 'enum A::B::E' - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: blob data = 'int' - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: - // CHECK-FUNC-NEXT: blob data = 'i' - // CHECK-FUNC-NEXT: -// CHECK-FUNC-NEXT: } // namespace B } // namespace A + +// RUN: clang-doc --dump-intermediate --doxygen -p %t %t/test.cpp -output=%t/docs + + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/E9ABF7E7E2425B626723D41E76E4BC7E7A5BD775.bc | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'E' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'B' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'A' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: blob data = 'X' +// CHECK-0-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/39D3C95A5F7CE2BA4937BD7B01BAE09EBC2AD8AC.bc | FileCheck %s --check-prefix CHECK-1 +// CHECK-1: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'f' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'A' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = '{{.*}}' +// CHECK-1-NEXT: blob data = '{{.*}}' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'void' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/9A82CB33ED0FDF81EE383D31CD0957D153C5E840.bc | FileCheck %s --check-prefix CHECK-2 +// CHECK-2: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'func' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'B' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'A' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = '{{.*}}' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'enum A::B::E' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'int' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'i' +// CHECK-2-NEXT: +// CHECK-2-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/8D042EFFC98B373450BC6B5B90A330C25A150E9C.bc | FileCheck %s --check-prefix CHECK-3 +// CHECK-3: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'A' +// CHECK-3-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/E21AF79E2A9D02554BA090D10DF39FE273F5CDB5.bc | FileCheck %s --check-prefix CHECK-4 +// CHECK-4: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'B' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'A' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: Index: clang-tools-extra/test/clang-doc/bc-record.cpp =================================================================== --- clang-tools-extra/test/clang-doc/bc-record.cpp +++ clang-tools-extra/test/clang-doc/bc-record.cpp @@ -1,120 +1,23 @@ -// This test requires Linux due to the system-dependent USR for the -// inner class in function H. +// This test requires Linux due to system-dependent USR for the inner class. // REQUIRES: system-linux // RUN: rm -rf %t // RUN: mkdir %t // RUN: echo "" > %t/compile_flags.txt // RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc --dump-intermediate -doxygen -p %t %t/test.cpp -output=%t/docs -// RUN: llvm-bcanalyzer %t/docs/bc/ACE81AFA6627B4CEF2B456FB6E1252925674AF7E.bc --dump | FileCheck %s --check-prefix CHECK-A -// RUN: llvm-bcanalyzer %t/docs/bc/FC07BD34D5E77782C263FA944447929EA8753740.bc --dump | FileCheck %s --check-prefix CHECK-B -// RUN: llvm-bcanalyzer %t/docs/bc/1E3438A08BA22025C0B46289FF0686F92C8924C5.bc --dump | FileCheck %s --check-prefix CHECK-BC -// RUN: llvm-bcanalyzer %t/docs/bc/06B5F6A19BA9F6A832E127C9968282B94619B210.bc --dump | FileCheck %s --check-prefix CHECK-C -// RUN: llvm-bcanalyzer %t/docs/bc/0921737541208B8FA9BB42B60F78AC1D779AA054.bc --dump | FileCheck %s --check-prefix CHECK-D -// RUN: llvm-bcanalyzer %t/docs/bc/289584A8E0FF4178A794622A547AA622503967A1.bc --dump | FileCheck %s --check-prefix CHECK-E -// RUN: llvm-bcanalyzer %t/docs/bc/DEB4AC1CD9253CD9EF7FBE6BCAC506D77984ABD4.bc --dump | FileCheck %s --check-prefix CHECK-ECON -// RUN: llvm-bcanalyzer %t/docs/bc/BD2BDEBD423F80BACCEA75DE6D6622D355FC2D17.bc --dump | FileCheck %s --check-prefix CHECK-EDES -// RUN: llvm-bcanalyzer %t/docs/bc/E3B54702FABFF4037025BA194FC27C47006330B5.bc --dump | FileCheck %s --check-prefix CHECK-F -// RUN: llvm-bcanalyzer %t/docs/bc/B6AC4C5C9F2EA3F2B3ECE1A33D349F4EE502B24E.bc --dump | FileCheck %s --check-prefix CHECK-H -// RUN: llvm-bcanalyzer %t/docs/bc/6BA1EE2B3DAEACF6E4306F10AF44908F4807927C.bc --dump | FileCheck %s --check-prefix CHECK-I -// RUN: llvm-bcanalyzer %t/docs/bc/5093D428CDC62096A67547BA52566E4FB9404EEE.bc --dump | FileCheck %s --check-prefix CHECK-PM -// RUN: llvm-bcanalyzer %t/docs/bc/CA7C7935730B5EACD25F080E9C83FA087CCDC75E.bc --dump | FileCheck %s --check-prefix CHECK-X -// RUN: llvm-bcanalyzer %t/docs/bc/641AB4A3D36399954ACDE29C7A8833032BF40472.bc --dump | FileCheck %s --check-prefix CHECK-Y void H() { class I {}; } -// CHECK-H: - // CHECK-H-NEXT: - // CHECK-H-NEXT: blob data = 'H' - // CHECK-H-NEXT: blob data = '{{.*}}' - // CHECK-H-NEXT: - // CHECK-H-NEXT: - // CHECK-H-NEXT: blob data = 'void' - // CHECK-H-NEXT: - // CHECK-H-NEXT: - // CHECK-H-NEXT: -// CHECK-H-NEXT: - - -// CHECK-I: - // CHECK-I-NEXT: - // CHECK-I-NEXT: blob data = 'I' - // CHECK-I-NEXT: - // CHECK-I-NEXT: - // CHECK-I-NEXT: blob data = 'H' - // CHECK-I-NEXT: - // CHECK-I-NEXT: - // CHECK-I-NEXT: - // CHECK-I-NEXT: blob data = '{{.*}}' - // CHECK-I-NEXT: -// CHECK-I-NEXT: union A { int X; int Y; }; -// CHECK-A: - // CHECK-A-NEXT: - // CHECK-A-NEXT: blob data = 'A' - // CHECK-A-NEXT: blob data = '{{.*}}' - // CHECK-A-NEXT: - // CHECK-A-NEXT: - // CHECK-A-NEXT: - // CHECK-A-NEXT: blob data = 'int' - // CHECK-A-NEXT: - // CHECK-A-NEXT: - // CHECK-A-NEXT: blob data = 'X' - // CHECK-A-NEXT: - // CHECK-A-NEXT: - // CHECK-A-NEXT: - // CHECK-A-NEXT: - // CHECK-A-NEXT: blob data = 'int' - // CHECK-A-NEXT: - // CHECK-A-NEXT: - // CHECK-A-NEXT: blob data = 'Y' - // CHECK-A-NEXT: - // CHECK-A-NEXT: -// CHECK-A-NEXT: enum B { X, Y }; -// CHECK-B: - // CHECK-B-NEXT: - // CHECK-B-NEXT: blob data = 'B' - // CHECK-B-NEXT: blob data = '{{.*}}' - // CHECK-B-NEXT: blob data = 'X' - // CHECK-B-NEXT: blob data = 'Y' -// CHECK-B-NEXT: enum class Bc { A, B }; -// CHECK-BC: - // CHECK-BC-NEXT: - // CHECK-BC-NEXT: blob data = 'Bc' - // CHECK-BC-NEXT: blob data = '{{.*}}' - // CHECK-BC-NEXT: - // CHECK-BC-NEXT: blob data = 'A' - // CHECK-BC-NEXT: blob data = 'B' -// CHECK-BC-NEXT: struct C { int i; }; -// CHECK-C: - // CHECK-C-NEXT: - // CHECK-C-NEXT: blob data = 'C' - // CHECK-C-NEXT: blob data = '{{.*}}' - // CHECK-C-NEXT: - // CHECK-C-NEXT: - // CHECK-C-NEXT: blob data = 'int' - // CHECK-C-NEXT: - // CHECK-C-NEXT: - // CHECK-C-NEXT: blob data = 'i' - // CHECK-C-NEXT: - // CHECK-C-NEXT: -// CHECK-C-NEXT: class D {}; -// CHECK-D: - // CHECK-D-NEXT: - // CHECK-D-NEXT: blob data = 'D' - // CHECK-D-NEXT: blob data = '{{.*}}' - // CHECK-D-NEXT: -// CHECK-D-NEXT: class E { public: @@ -124,131 +27,292 @@ protected: void ProtectedMethod(); }; -// CHECK-E: - // CHECK-E-NEXT: - // CHECK-E-NEXT: blob data = 'E' - // CHECK-E-NEXT: blob data = '{{.*}}' - // CHECK-E-NEXT: -// CHECK-E-NEXT: - -// CHECK-ECON: - // CHECK-ECON-NEXT: - // CHECK-ECON-NEXT: blob data = 'E' - // CHECK-ECON-NEXT: - // CHECK-ECON-NEXT: - // CHECK-ECON-NEXT: blob data = 'E' - // CHECK-ECON-NEXT: - // CHECK-ECON-NEXT: - // CHECK-ECON-NEXT: - // CHECK-ECON-NEXT: - // CHECK-ECON-NEXT: blob data = '{{.*}}' - // CHECK-ECON-NEXT: - // CHECK-ECON-NEXT: - // CHECK-ECON-NEXT: blob data = 'E' - // CHECK-ECON-NEXT: - // CHECK-ECON-NEXT: - // CHECK-ECON-NEXT: - // CHECK-ECON-NEXT: - // CHECK-ECON-NEXT: - // CHECK-ECON-NEXT: blob data = 'void' - // CHECK-ECON-NEXT: - // CHECK-ECON-NEXT: - // CHECK-ECON-NEXT: -// CHECK-ECON-NEXT: - -// CHECK-EDES: - // CHECK-EDES-NEXT: - // CHECK-EDES-NEXT: blob data = '~E' - // CHECK-EDES-NEXT: - // CHECK-EDES-NEXT: - // CHECK-EDES-NEXT: blob data = 'E' - // CHECK-EDES-NEXT: - // CHECK-EDES-NEXT: - // CHECK-EDES-NEXT: - // CHECK-EDES-NEXT: - // CHECK-EDES-NEXT: blob data = '{{.*}}' - // CHECK-EDES-NEXT: - // CHECK-EDES-NEXT: - // CHECK-EDES-NEXT: blob data = 'E' - // CHECK-EDES-NEXT: - // CHECK-EDES-NEXT: - // CHECK-EDES-NEXT: - // CHECK-EDES-NEXT: - // CHECK-EDES-NEXT: - // CHECK-EDES-NEXT: blob data = 'void' - // CHECK-EDES-NEXT: - // CHECK-EDES-NEXT: - // CHECK-EDES-NEXT: -// CHECK-EDES-NEXT: void E::ProtectedMethod() {} -// CHECK-PM: - // CHECK-PM-NEXT: - // CHECK-PM-NEXT: blob data = 'ProtectedMethod' - // CHECK-PM-NEXT: - // CHECK-PM-NEXT: - // CHECK-PM-NEXT: blob data = 'E' - // CHECK-PM-NEXT: - // CHECK-PM-NEXT: - // CHECK-PM-NEXT: - // CHECK-PM-NEXT: - // CHECK-PM-NEXT: blob data = '{{.*}}' - // CHECK-PM-NEXT: blob data = '{{.*}}' - // CHECK-PM-NEXT: - // CHECK-PM-NEXT: - // CHECK-PM-NEXT: blob data = 'E' - // CHECK-PM-NEXT: - // CHECK-PM-NEXT: - // CHECK-PM-NEXT: - // CHECK-PM-NEXT: - // CHECK-PM-NEXT: - // CHECK-PM-NEXT: blob data = 'void' - // CHECK-PM-NEXT: - // CHECK-PM-NEXT: - // CHECK-PM-NEXT: -// CHECK-PM-NEXT: - - class F : virtual private D, public E {}; -// CHECK-F: - // CHECK-F-NEXT: - // CHECK-F-NEXT: blob data = 'F' - // CHECK-F-NEXT: blob data = '{{.*}}' - // CHECK-F-NEXT: - // CHECK-F-NEXT: - // CHECK-F-NEXT: - // CHECK-F-NEXT: blob data = 'E' - // CHECK-F-NEXT: - // CHECK-F-NEXT: - // CHECK-F-NEXT: - // CHECK-F-NEXT: - // CHECK-F-NEXT: - // CHECK-F-NEXT: blob data = 'D' - // CHECK-F-NEXT: - // CHECK-F-NEXT: - // CHECK-F-NEXT: -// CHECK-F-NEXT: class X { class Y {}; }; -// CHECK-X: - // CHECK-X-NEXT: - // CHECK-X-NEXT: blob data = 'X' - // CHECK-X-NEXT: blob data = '{{.*}}' - // CHECK-X-NEXT: -// CHECK-X-NEXT: - -// CHECK-Y: - // CHECK-Y-NEXT: - // CHECK-Y-NEXT: blob data = 'Y' - // CHECK-Y-NEXT: - // CHECK-Y-NEXT: - // CHECK-Y-NEXT: blob data = 'X' - // CHECK-Y-NEXT: - // CHECK-Y-NEXT: - // CHECK-Y-NEXT: - // CHECK-Y-NEXT: blob data = '{{.*}}' - // CHECK-Y-NEXT: -// CHECK-Y-NEXT: + +// RUN: clang-doc --dump-intermediate --doxygen -p %t %t/test.cpp -output=%t/docs + + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/289584A8E0FF4178A794622A547AA622503967A1.bc | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'E' +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/5093D428CDC62096A67547BA52566E4FB9404EEE.bc | FileCheck %s --check-prefix CHECK-1 +// CHECK-1: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'ProtectedMethod' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'E' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = '{{.*}}' +// CHECK-1-NEXT: blob data = '{{.*}}' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'E' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'void' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/CA7C7935730B5EACD25F080E9C83FA087CCDC75E.bc | FileCheck %s --check-prefix CHECK-2 +// CHECK-2: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'X' +// CHECK-2-NEXT: blob data = '{{.*}}' +// CHECK-2-NEXT: +// CHECK-2-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/B6AC4C5C9F2EA3F2B3ECE1A33D349F4EE502B24E.bc | FileCheck %s --check-prefix CHECK-3 +// CHECK-3: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'H' +// CHECK-3-NEXT: blob data = '{{.*}}' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'void' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/06B5F6A19BA9F6A832E127C9968282B94619B210.bc | FileCheck %s --check-prefix CHECK-4 +// CHECK-4: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'C' +// CHECK-4-NEXT: blob data = '{{.*}}' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'int' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'i' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/BD2BDEBD423F80BACCEA75DE6D6622D355FC2D17.bc | FileCheck %s --check-prefix CHECK-5 +// CHECK-5: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = '~E' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'E' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = '{{.*}}' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'E' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'void' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/E60CA1CC7048098A7F4A48C3A53D45A533BDC39B.bc | FileCheck %s --check-prefix CHECK-6 +// CHECK-6: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'I' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'H' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = '{{.*}}' +// CHECK-6-NEXT: +// CHECK-6-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/DEB4AC1CD9253CD9EF7FBE6BCAC506D77984ABD4.bc | FileCheck %s --check-prefix CHECK-7 +// CHECK-7: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'E' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'E' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = '{{.*}}' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'E' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'void' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/641AB4A3D36399954ACDE29C7A8833032BF40472.bc | FileCheck %s --check-prefix CHECK-8 +// CHECK-8: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'Y' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'X' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = '{{.*}}' +// CHECK-8-NEXT: +// CHECK-8-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/FC07BD34D5E77782C263FA944447929EA8753740.bc | FileCheck %s --check-prefix CHECK-9 +// CHECK-9: +// CHECK-9-NEXT: +// CHECK-9-NEXT: +// CHECK-9-NEXT: +// CHECK-9-NEXT: +// CHECK-9-NEXT: +// CHECK-9-NEXT: blob data = 'B' +// CHECK-9-NEXT: blob data = '{{.*}}' +// CHECK-9-NEXT: blob data = 'X' +// CHECK-9-NEXT: blob data = 'Y' +// CHECK-9-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/0921737541208B8FA9BB42B60F78AC1D779AA054.bc | FileCheck %s --check-prefix CHECK-10 +// CHECK-10: +// CHECK-10-NEXT: +// CHECK-10-NEXT: +// CHECK-10-NEXT: +// CHECK-10-NEXT: +// CHECK-10-NEXT: +// CHECK-10-NEXT: blob data = 'D' +// CHECK-10-NEXT: blob data = '{{.*}}' +// CHECK-10-NEXT: +// CHECK-10-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/E3B54702FABFF4037025BA194FC27C47006330B5.bc | FileCheck %s --check-prefix CHECK-11 +// CHECK-11: +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: blob data = 'F' +// CHECK-11-NEXT: blob data = '{{.*}}' +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: blob data = 'E' +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: blob data = 'D' +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/ACE81AFA6627B4CEF2B456FB6E1252925674AF7E.bc | FileCheck %s --check-prefix CHECK-12 +// CHECK-12: +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: blob data = 'A' +// CHECK-12-NEXT: blob data = '{{.*}}' +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: blob data = 'int' +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: blob data = 'X' +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: blob data = 'int' +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: blob data = 'Y' +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/1E3438A08BA22025C0B46289FF0686F92C8924C5.bc | FileCheck %s --check-prefix CHECK-13 +// CHECK-13: +// CHECK-13-NEXT: +// CHECK-13-NEXT: +// CHECK-13-NEXT: +// CHECK-13-NEXT: +// CHECK-13-NEXT: +// CHECK-13-NEXT: blob data = 'Bc' +// CHECK-13-NEXT: blob data = '{{.*}}' +// CHECK-13-NEXT: +// CHECK-13-NEXT: blob data = 'A' +// CHECK-13-NEXT: blob data = 'B' +// CHECK-13-NEXT: Index: clang-tools-extra/test/clang-doc/mapper-class-in-class.cpp =================================================================== --- clang-tools-extra/test/clang-doc/mapper-class-in-class.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// RUN: rm -rf %t -// RUN: mkdir %t -// RUN: echo "" > %t/compile_flags.txt -// RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc --dump-mapper -doxygen -p %t %t/test.cpp -output=%t/docs -// RUN: llvm-bcanalyzer %t/docs/bc/641AB4A3D36399954ACDE29C7A8833032BF40472.bc --dump | FileCheck %s --check-prefix CHECK-X-Y -// RUN: llvm-bcanalyzer %t/docs/bc/CA7C7935730B5EACD25F080E9C83FA087CCDC75E.bc --dump | FileCheck %s --check-prefix CHECK-X - -class X { - class Y {}; -}; - -// CHECK-X: -// CHECK-X-NEXT: - // CHECK-X-NEXT: -// CHECK-X-NEXT: -// CHECK-X-NEXT: - // CHECK-X-NEXT: - // CHECK-X-NEXT: blob data = 'X' - // CHECK-X-NEXT: blob data = '{{.*}}' - // CHECK-X-NEXT: -// CHECK-X-NEXT: - - -// CHECK-X-Y: -// CHECK-X-Y-NEXT: - // CHECK-X-Y-NEXT: -// CHECK-X-Y-NEXT: -// CHECK-X-Y-NEXT: - // CHECK-X-Y-NEXT: - // CHECK-X-Y-NEXT: blob data = 'Y' - // CHECK-X-Y-NEXT: - // CHECK-X-Y-NEXT: - // CHECK-X-Y-NEXT: blob data = 'X' - // CHECK-X-Y-NEXT: - // CHECK-X-Y-NEXT: - // CHECK-X-Y-NEXT: - // CHECK-X-Y-NEXT: blob data = '{{.*}}' - // CHECK-X-Y-NEXT: -// CHECK-X-Y-NEXT: Index: clang-tools-extra/test/clang-doc/mapper-class-in-function.cpp =================================================================== --- clang-tools-extra/test/clang-doc/mapper-class-in-function.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// This test requires Linux due to the system-dependent USR for the -// inner class. -// REQUIRES: system-linux -// RUN: rm -rf %t -// RUN: mkdir %t -// RUN: echo "" > %t/compile_flags.txt -// RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc --dump-mapper -doxygen -p %t %t/test.cpp -output=%t/docs -// RUN: llvm-bcanalyzer %t/docs/bc/B6AC4C5C9F2EA3F2B3ECE1A33D349F4EE502B24E.bc --dump | FileCheck %s --check-prefix CHECK-H -// RUN: llvm-bcanalyzer %t/docs/bc/01A95F3F73F53281B3E50109A577FD2493159365.bc --dump | FileCheck %s --check-prefix CHECK-H-I - -void H() { - class I {}; -} - -// CHECK-H: -// CHECK-H-NEXT: - // CHECK-H-NEXT: -// CHECK-H-NEXT: -// CHECK-H-NEXT: - // CHECK-H-NEXT: - // CHECK-H-NEXT: blob data = 'H' - // CHECK-H-NEXT: blob data = '{{.*}}' - // CHECK-H-NEXT: - // CHECK-H-NEXT: - // CHECK-H-NEXT: blob data = 'void' - // CHECK-H-NEXT: - // CHECK-H-NEXT: - // CHECK-H-NEXT: -// CHECK-H-NEXT: - -// CHECK-H-I: -// CHECK-H-I-NEXT: - // CHECK-H-I-NEXT: -// CHECK-H-I-NEXT: -// CHECK-H-I-NEXT: - // CHECK-H-I-NEXT: - // CHECK-H-I-NEXT: blob data = 'I' - // CHECK-H-I-NEXT: - // CHECK-H-I-NEXT: - // CHECK-H-I-NEXT: blob data = 'H' - // CHECK-H-I-NEXT: - // CHECK-H-I-NEXT: - // CHECK-H-I-NEXT: - // CHECK-H-I-NEXT: blob data = '{{.*}}' - // CHECK-H-I-NEXT: -// CHECK-H-I-NEXT: - - Index: clang-tools-extra/test/clang-doc/mapper-class.cpp =================================================================== --- clang-tools-extra/test/clang-doc/mapper-class.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// RUN: rm -rf %t -// RUN: mkdir %t -// RUN: echo "" > %t/compile_flags.txt -// RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc --dump-mapper -doxygen -p %t %t/test.cpp -output=%t/docs -// RUN: llvm-bcanalyzer %t/docs/bc/289584A8E0FF4178A794622A547AA622503967A1.bc --dump | FileCheck %s - -class E {}; - -// CHECK: -// CHECK-NEXT: - // CHECK-NEXT: -// CHECK-NEXT: -// CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'E' - // CHECK-NEXT: blob data = '{{.*}}' - // CHECK-NEXT: -// CHECK-NEXT: Index: clang-tools-extra/test/clang-doc/mapper-comment.cpp =================================================================== --- /dev/null +++ clang-tools-extra/test/clang-doc/mapper-comment.cpp @@ -0,0 +1,69 @@ +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo "" > %t/compile_flags.txt +// RUN: cp "%s" "%t/test.cpp" + +/// \brief Brief description. +/// +/// Extended description that +/// continues onto the next line. +/// +///
    +///
  • Testing. +///
+/// +/// \verbatim +/// The description continues. +/// \endverbatim +/// -- +/// \param [out] I is a parameter. +/// \param J is a parameter. +/// \return void +void F(int I, int J); + +/// Bonus comment on definition +void F(int I, int J) {} + +// RUN: clang-doc --dump-mapper --doxygen -p %t %t/test.cpp -output=%t/docs + + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/7574630614A535710E5A6ABCFFF98BCA2D06A4CA.bc | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'F' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'FullComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: blob data = ' Bonus comment on definition' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'void' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'int' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'I' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'int' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'J' +// CHECK-0-NEXT: +// CHECK-0-NEXT: Index: clang-tools-extra/test/clang-doc/mapper-comments.cpp =================================================================== --- clang-tools-extra/test/clang-doc/mapper-comments.cpp +++ /dev/null @@ -1,181 +0,0 @@ -// RUN: rm -rf %t -// RUN: mkdir %t -// RUN: echo "" > %t/compile_flags.txt -// RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc --dump-mapper -doxygen -p %t %t/test.cpp -output=%t/docs -// RUN: llvm-bcanalyzer %t/docs/bc/7574630614A535710E5A6ABCFFF98BCA2D06A4CA.bc --dump | FileCheck %s - -/// \brief Brief description. -/// -/// Extended description that -/// continues onto the next line. -/// -///
    class="test"> -///
  • Testing. -///
-/// -/// \verbatim -/// The description continues. -/// \endverbatim -/// -/// \param [out] I is a parameter. -/// \param J is a parameter. -/// \return int -int F(int I, int J); - -// CHECK: -// CHECK-NEXT: - // CHECK-NEXT: -// CHECK-NEXT: -// CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'F' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'FullComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParagraphComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'BlockCommandComment' - // CHECK-NEXT: blob data = 'brief' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParagraphComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: blob data = ' Brief description.' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParagraphComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: blob data = ' Extended description that' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: blob data = ' continues onto the next line.' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParagraphComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'HTMLStartTagComment' - // CHECK-NEXT: blob data = 'ul' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: blob data = ' class="test">' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'HTMLStartTagComment' - // CHECK-NEXT: blob data = 'li' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: blob data = ' Testing.' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'HTMLEndTagComment' - // CHECK-NEXT: blob data = 'ul' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParagraphComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'VerbatimBlockComment' - // CHECK-NEXT: blob data = 'verbatim' - // CHECK-NEXT: blob data = 'endverbatim' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'VerbatimBlockLineComment' - // CHECK-NEXT: blob data = ' The description continues.' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParagraphComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParamCommandComment' - // CHECK-NEXT: blob data = '[out]' - // CHECK-NEXT: blob data = 'I' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParagraphComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: blob data = ' is a parameter.' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParamCommandComment' - // CHECK-NEXT: blob data = '[in]' - // CHECK-NEXT: blob data = 'J' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParagraphComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: blob data = ' is a parameter.' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'BlockCommandComment' - // CHECK-NEXT: blob data = 'return' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'ParagraphComment' - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'TextComment' - // CHECK-NEXT: blob data = ' int' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = '{{.*}}' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'int' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'int' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'I' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'int' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'J' - // CHECK-NEXT: -// CHECK-NEXT: Index: clang-tools-extra/test/clang-doc/mapper-enum.cpp =================================================================== --- clang-tools-extra/test/clang-doc/mapper-enum.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// RUN: rm -rf %t -// RUN: mkdir %t -// RUN: echo "" > %t/compile_flags.txt -// RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc --dump-mapper -doxygen -p %t %t/test.cpp -output=%t/docs -// RUN: llvm-bcanalyzer %t/docs/bc/FC07BD34D5E77782C263FA944447929EA8753740.bc --dump | FileCheck %s --check-prefix CHECK-B -// RUN: llvm-bcanalyzer %t/docs/bc/020E6C32A700C3170C009FCCD41671EDDBEAF575.bc --dump | FileCheck %s --check-prefix CHECK-C - -enum B { X, Y }; - -// CHECK-B: -// CHECK-B-NEXT: - // CHECK-B-NEXT: -// CHECK-B-NEXT: -// CHECK-B-NEXT: - // CHECK-B-NEXT: - // CHECK-B-NEXT: blob data = 'B' - // CHECK-B-NEXT: blob data = '{{.*}}' - // CHECK-B-NEXT: blob data = 'X' - // CHECK-B-NEXT: blob data = 'Y' -// CHECK-B-NEXT: - -enum class C { A, B }; - -// CHECK-C: -// CHECK-C-NEXT: - // CHECK-C-NEXT: -// CHECK-C-NEXT: -// CHECK-C-NEXT: - // CHECK-C-NEXT: - // CHECK-C-NEXT: blob data = 'C' - // CHECK-C-NEXT: blob data = '{{.*}}' - // CHECK-C-NEXT: - // CHECK-C-NEXT: blob data = 'A' - // CHECK-C-NEXT: blob data = 'B' -// CHECK-C-NEXT: Index: clang-tools-extra/test/clang-doc/mapper-function.cpp =================================================================== --- clang-tools-extra/test/clang-doc/mapper-function.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// RUN: rm -rf %t -// RUN: mkdir %t -// RUN: echo "" > %t/compile_flags.txt -// RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc --dump-mapper -doxygen -p %t %t/test.cpp -output=%t/docs -// RUN: llvm-bcanalyzer %t/docs/bc/A44B32CC3C087C9AF75DAF50DE193E85E7B2C16B.bc --dump | FileCheck %s - -int F(int param) { return param; } - -// CHECK: -// CHECK-NEXT: - // CHECK-NEXT: -// CHECK-NEXT: -// CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'F' - // CHECK-NEXT: blob data = '{{.*}}' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'int' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'int' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'param' - // CHECK-NEXT: -// CHECK-NEXT: Index: clang-tools-extra/test/clang-doc/mapper-method.cpp =================================================================== --- clang-tools-extra/test/clang-doc/mapper-method.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// RUN: rm -rf %t -// RUN: mkdir %t -// RUN: echo "" > %t/compile_flags.txt -// RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc --dump-mapper -doxygen -p %t %t/test.cpp -output=%t/docs -// RUN: llvm-bcanalyzer %t/docs/bc/F0F9FC65FC90F54F690144A7AFB15DFC3D69B6E6.bc --dump | FileCheck %s --check-prefix CHECK-G-F -// RUN: llvm-bcanalyzer %t/docs/bc/4202E8BF0ECB12AE354C8499C52725B0EE30AED5.bc --dump | FileCheck %s --check-prefix CHECK-G - -class G { -public: - int Method(int param) { return param; } -}; - -// CHECK-G: -// CHECK-G-NEXT: - // CHECK-G-NEXT: -// CHECK-G-NEXT: -// CHECK-G-NEXT: - // CHECK-G-NEXT: - // CHECK-G-NEXT: blob data = 'G' - // CHECK-G-NEXT: blob data = '{{.*}}' - // CHECK-G-NEXT: -// CHECK-G-NEXT: - -// CHECK-G-F: -// CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: -// CHECK-G-F-NEXT: -// CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: blob data = 'Method' - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: blob data = 'G' - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: blob data = '{{.*}}' - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: blob data = 'G' - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: blob data = 'int' - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: blob data = 'int' - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: - // CHECK-G-F-NEXT: blob data = 'param' - // CHECK-G-F-NEXT: -// CHECK-G-F-NEXT: Index: clang-tools-extra/test/clang-doc/mapper-namespace.cpp =================================================================== --- clang-tools-extra/test/clang-doc/mapper-namespace.cpp +++ clang-tools-extra/test/clang-doc/mapper-namespace.cpp @@ -2,16 +2,134 @@ // RUN: mkdir %t // RUN: echo "" > %t/compile_flags.txt // RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc --dump-mapper -doxygen -p %t %t/test.cpp -output=%t/docs -// RUN: llvm-bcanalyzer %t/docs/bc/8D042EFFC98B373450BC6B5B90A330C25A150E9C.bc --dump | FileCheck %s - -namespace A {} - -// CHECK: -// CHECK-NEXT: - // CHECK-NEXT: -// CHECK-NEXT: -// CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'A' -// CHECK-NEXT: + +namespace A { + +void f(); + +} // namespace A + +namespace A { + +void f(){}; + +namespace B { + +enum E { X }; + +E func(int i) { return X; } + +} // namespace B +} // namespace A + +// RUN: clang-doc --dump-mapper --doxygen -p %t %t/test.cpp -output=%t/docs + + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/E9ABF7E7E2425B626723D41E76E4BC7E7A5BD775.bc | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'E' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'B' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'A' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: blob data = 'X' +// CHECK-0-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/39D3C95A5F7CE2BA4937BD7B01BAE09EBC2AD8AC.bc | FileCheck %s --check-prefix CHECK-1 +// CHECK-1: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'f' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'A' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = '{{.*}}' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'void' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/9A82CB33ED0FDF81EE383D31CD0957D153C5E840.bc | FileCheck %s --check-prefix CHECK-2 +// CHECK-2: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'func' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'B' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'A' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = '{{.*}}' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'enum A::B::E' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'int' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'i' +// CHECK-2-NEXT: +// CHECK-2-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/8D042EFFC98B373450BC6B5B90A330C25A150E9C.bc | FileCheck %s --check-prefix CHECK-3 +// CHECK-3: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'A' +// CHECK-3-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/E21AF79E2A9D02554BA090D10DF39FE273F5CDB5.bc | FileCheck %s --check-prefix CHECK-4 +// CHECK-4: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'B' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'A' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: Index: clang-tools-extra/test/clang-doc/mapper-record.cpp =================================================================== --- /dev/null +++ clang-tools-extra/test/clang-doc/mapper-record.cpp @@ -0,0 +1,314 @@ +// This test requires Linux due to system-dependent USR for the inner class. +// REQUIRES: system-linux +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo "" > %t/compile_flags.txt +// RUN: cp "%s" "%t/test.cpp" + +void H() { + class I {}; +} + +union A { int X; int Y; }; + +enum B { X, Y }; + +enum class Bc { A, B }; + +struct C { int i; }; + +class D {}; + +class E { +public: + E() {} + ~E() {} + +protected: + void ProtectedMethod(); +}; + +void E::ProtectedMethod() {} + +class F : virtual private D, public E {}; + +class X { + class Y {}; +}; + +// RUN: clang-doc --dump-mapper --doxygen -p %t %t/test.cpp -output=%t/docs + + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/289584A8E0FF4178A794622A547AA622503967A1.bc | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'E' +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/5093D428CDC62096A67547BA52566E4FB9404EEE.bc | FileCheck %s --check-prefix CHECK-1 +// CHECK-1: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'ProtectedMethod' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'E' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = '{{.*}}' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'E' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'void' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/CA7C7935730B5EACD25F080E9C83FA087CCDC75E.bc | FileCheck %s --check-prefix CHECK-2 +// CHECK-2: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'X' +// CHECK-2-NEXT: blob data = '{{.*}}' +// CHECK-2-NEXT: +// CHECK-2-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/B6AC4C5C9F2EA3F2B3ECE1A33D349F4EE502B24E.bc | FileCheck %s --check-prefix CHECK-3 +// CHECK-3: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'H' +// CHECK-3-NEXT: blob data = '{{.*}}' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'void' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/06B5F6A19BA9F6A832E127C9968282B94619B210.bc | FileCheck %s --check-prefix CHECK-4 +// CHECK-4: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'C' +// CHECK-4-NEXT: blob data = '{{.*}}' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'int' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'i' +// CHECK-4-NEXT: +// CHECK-4-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/BD2BDEBD423F80BACCEA75DE6D6622D355FC2D17.bc | FileCheck %s --check-prefix CHECK-5 +// CHECK-5: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = '~E' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'E' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = '{{.*}}' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'E' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'void' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/E60CA1CC7048098A7F4A48C3A53D45A533BDC39B.bc | FileCheck %s --check-prefix CHECK-6 +// CHECK-6: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'I' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'H' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = '{{.*}}' +// CHECK-6-NEXT: +// CHECK-6-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/DEB4AC1CD9253CD9EF7FBE6BCAC506D77984ABD4.bc | FileCheck %s --check-prefix CHECK-7 +// CHECK-7: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'E' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'E' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = '{{.*}}' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'E' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'void' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/641AB4A3D36399954ACDE29C7A8833032BF40472.bc | FileCheck %s --check-prefix CHECK-8 +// CHECK-8: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'Y' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'X' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = '{{.*}}' +// CHECK-8-NEXT: +// CHECK-8-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/FC07BD34D5E77782C263FA944447929EA8753740.bc | FileCheck %s --check-prefix CHECK-9 +// CHECK-9: +// CHECK-9-NEXT: +// CHECK-9-NEXT: +// CHECK-9-NEXT: +// CHECK-9-NEXT: +// CHECK-9-NEXT: +// CHECK-9-NEXT: blob data = 'B' +// CHECK-9-NEXT: blob data = '{{.*}}' +// CHECK-9-NEXT: blob data = 'X' +// CHECK-9-NEXT: blob data = 'Y' +// CHECK-9-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/0921737541208B8FA9BB42B60F78AC1D779AA054.bc | FileCheck %s --check-prefix CHECK-10 +// CHECK-10: +// CHECK-10-NEXT: +// CHECK-10-NEXT: +// CHECK-10-NEXT: +// CHECK-10-NEXT: +// CHECK-10-NEXT: +// CHECK-10-NEXT: blob data = 'D' +// CHECK-10-NEXT: blob data = '{{.*}}' +// CHECK-10-NEXT: +// CHECK-10-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/E3B54702FABFF4037025BA194FC27C47006330B5.bc | FileCheck %s --check-prefix CHECK-11 +// CHECK-11: +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: blob data = 'F' +// CHECK-11-NEXT: blob data = '{{.*}}' +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: blob data = 'E' +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: blob data = 'D' +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: +// CHECK-11-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/ACE81AFA6627B4CEF2B456FB6E1252925674AF7E.bc | FileCheck %s --check-prefix CHECK-12 +// CHECK-12: +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: blob data = 'A' +// CHECK-12-NEXT: blob data = '{{.*}}' +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: blob data = 'int' +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: blob data = 'X' +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: blob data = 'int' +// CHECK-12-NEXT: +// CHECK-12-NEXT: +// CHECK-12-NEXT: blob data = 'Y' +// CHECK-12-NEXT: +// CHECK-12-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/1E3438A08BA22025C0B46289FF0686F92C8924C5.bc | FileCheck %s --check-prefix CHECK-13 +// CHECK-13: +// CHECK-13-NEXT: +// CHECK-13-NEXT: +// CHECK-13-NEXT: +// CHECK-13-NEXT: +// CHECK-13-NEXT: +// CHECK-13-NEXT: blob data = 'Bc' +// CHECK-13-NEXT: blob data = '{{.*}}' +// CHECK-13-NEXT: +// CHECK-13-NEXT: blob data = 'A' +// CHECK-13-NEXT: blob data = 'B' +// CHECK-13-NEXT: Index: clang-tools-extra/test/clang-doc/mapper-struct.cpp =================================================================== --- clang-tools-extra/test/clang-doc/mapper-struct.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// RUN: rm -rf %t -// RUN: mkdir %t -// RUN: echo "" > %t/compile_flags.txt -// RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc --dump-mapper -doxygen -p %t %t/test.cpp -output=%t/docs -// RUN: llvm-bcanalyzer %t/docs/bc/06B5F6A19BA9F6A832E127C9968282B94619B210.bc --dump | FileCheck %s - -struct C { int i; }; - -// CHECK: -// CHECK-NEXT: - // CHECK-NEXT: -// CHECK-NEXT: -// CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'C' - // CHECK-NEXT: blob data = '{{.*}}' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'int' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'i' - // CHECK-NEXT: -// CHECK-NEXT: Index: clang-tools-extra/test/clang-doc/mapper-union.cpp =================================================================== --- clang-tools-extra/test/clang-doc/mapper-union.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// RUN: rm -rf %t -// RUN: mkdir %t -// RUN: echo "" > %t/compile_flags.txt -// RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc --dump-mapper -doxygen -p %t %t/test.cpp -output=%t/docs -// RUN: llvm-bcanalyzer %t/docs/bc/0B8A6B938B939B77C6325CCCC8AA3E938BF9E2E8.bc --dump | FileCheck %s - -union D { int X; int Y; }; - -// CHECK: -// CHECK-NEXT: - // CHECK-NEXT: -// CHECK-NEXT: -// CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'D' - // CHECK-NEXT: blob data = '{{.*}}' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'int' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'X' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'int' - // CHECK-NEXT: - // CHECK-NEXT: - // CHECK-NEXT: blob data = 'Y' - // CHECK-NEXT: -// CHECK-NEXT: Index: clang-tools-extra/test/clang-doc/test_cases/comment.cpp =================================================================== --- /dev/null +++ clang-tools-extra/test/clang-doc/test_cases/comment.cpp @@ -0,0 +1,25 @@ +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo "" > %t/compile_flags.txt +// RUN: cp "%s" "%t/test.cpp" + +/// \brief Brief description. +/// +/// Extended description that +/// continues onto the next line. +/// +///
    +///
  • Testing. +///
+/// +/// \verbatim +/// The description continues. +/// \endverbatim +/// -- +/// \param [out] I is a parameter. +/// \param J is a parameter. +/// \return void +void F(int I, int J); + +/// Bonus comment on definition +void F(int I, int J) {} Index: clang-tools-extra/test/clang-doc/test_cases/namespace.cpp =================================================================== --- /dev/null +++ clang-tools-extra/test/clang-doc/test_cases/namespace.cpp @@ -0,0 +1,23 @@ +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo "" > %t/compile_flags.txt +// RUN: cp "%s" "%t/test.cpp" + +namespace A { + +void f(); + +} // namespace A + +namespace A { + +void f(){}; + +namespace B { + +enum E { X }; + +E func(int i) { return X; } + +} // namespace B +} // namespace A Index: clang-tools-extra/test/clang-doc/test_cases/record.cpp =================================================================== --- /dev/null +++ clang-tools-extra/test/clang-doc/test_cases/record.cpp @@ -0,0 +1,37 @@ +// This test requires Linux due to system-dependent USR for the inner class. +// REQUIRES: system-linux +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo "" > %t/compile_flags.txt +// RUN: cp "%s" "%t/test.cpp" + +void H() { + class I {}; +} + +union A { int X; int Y; }; + +enum B { X, Y }; + +enum class Bc { A, B }; + +struct C { int i; }; + +class D {}; + +class E { +public: + E() {} + ~E() {} + +protected: + void ProtectedMethod(); +}; + +void E::ProtectedMethod() {} + +class F : virtual private D, public E {}; + +class X { + class Y {}; +}; Index: clang-tools-extra/test/clang-doc/yaml-comment.cpp =================================================================== --- /dev/null +++ clang-tools-extra/test/clang-doc/yaml-comment.cpp @@ -0,0 +1,133 @@ +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo "" > %t/compile_flags.txt +// RUN: cp "%s" "%t/test.cpp" + +/// \brief Brief description. +/// +/// Extended description that +/// continues onto the next line. +/// +///
    +///
  • Testing. +///
+/// +/// \verbatim +/// The description continues. +/// \endverbatim +/// -- +/// \param [out] I is a parameter. +/// \param J is a parameter. +/// \return void +void F(int I, int J); + +/// Bonus comment on definition +void F(int I, int J) {} + +// RUN: clang-doc --format=yaml --doxygen -p %t %t/test.cpp -output=%t/docs + + +// RUN: cat %t/docs/./F.yaml | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: --- +// CHECK-0-NEXT: USR: '7574630614A535710E5A6ABCFFF98BCA2D06A4CA' +// CHECK-0-NEXT: Name: 'F' +// CHECK-0-NEXT: Description: +// CHECK-0-NEXT: - Kind: 'FullComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'BlockCommandComment' +// CHECK-0-NEXT: Name: 'brief' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' Brief description.' +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' Extended description that' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' continues onto the next line.' +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'HTMLStartTagComment' +// CHECK-0-NEXT: Name: 'ul' +// CHECK-0-NEXT: AttrKeys: +// CHECK-0-NEXT: - 'class' +// CHECK-0-NEXT: AttrValues: +// CHECK-0-NEXT: - 'test' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'HTMLStartTagComment' +// CHECK-0-NEXT: Name: 'li' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' Testing.' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'HTMLEndTagComment' +// CHECK-0-NEXT: Name: 'ul' +// CHECK-0-NEXT: SelfClosing: true +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'VerbatimBlockComment' +// CHECK-0-NEXT: Name: 'verbatim' +// CHECK-0-NEXT: CloseName: 'endverbatim' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'VerbatimBlockLineComment' +// CHECK-0-NEXT: Text: ' The description continues.' +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' --' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'ParamCommandComment' +// CHECK-0-NEXT: Direction: '[out]' +// CHECK-0-NEXT: ParamName: 'I' +// CHECK-0-NEXT: Explicit: true +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' is a parameter.' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'ParamCommandComment' +// CHECK-0-NEXT: Direction: '[in]' +// CHECK-0-NEXT: ParamName: 'J' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' is a parameter.' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'BlockCommandComment' +// CHECK-0-NEXT: Name: 'return' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' void' +// CHECK-0-NEXT: - Kind: 'FullComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' Bonus comment on definition' +// CHECK-0-NEXT: DefLocation: +// CHECK-0-NEXT: LineNumber: 25 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: Location: +// CHECK-0-NEXT: - LineNumber: 22 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: Params: +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'I' +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'J' +// CHECK-0-NEXT: ReturnType: +// CHECK-0-NEXT: Type: +// CHECK-0-NEXT: Name: 'void' +// CHECK-0-NEXT: ... Index: clang-tools-extra/test/clang-doc/yaml-comments.cpp =================================================================== --- clang-tools-extra/test/clang-doc/yaml-comments.cpp +++ /dev/null @@ -1,129 +0,0 @@ -// RUN: rm -rf %t -// RUN: mkdir %t -// RUN: echo "" > %t/compile_flags.txt -// RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc -doxygen -p %t %t/test.cpp -output=%t/docs -// RUN: cat %t/docs/F.yaml | FileCheck %s - -/// \brief Brief description. -/// -/// Extended description that -/// continues onto the next line. -/// -///
    -///
  • Testing. -///
-/// -/// \verbatim -/// The description continues. -/// \endverbatim -/// -/// \param [out] I is a parameter. -/// \param J is a parameter. -/// \return void -void F(int I, int J); - -/// Bonus comment on definition -void F(int I, int J) {} - -// CHECK: --- -// CHECK-NEXT: USR: '7574630614A535710E5A6ABCFFF98BCA2D06A4CA' -// CHECK-NEXT: Name: 'F' -// CHECK-NEXT: Description: -// CHECK-NEXT: - Kind: 'FullComment' -// CHECK-NEXT: Children: -// CHECK-NEXT: - Kind: 'ParagraphComment' -// CHECK-NEXT: Children: -// CHECK-NEXT: - Kind: 'TextComment' -// CHECK-NEXT: - Kind: 'BlockCommandComment' -// CHECK-NEXT: Name: 'brief' -// CHECK-NEXT: Children: -// CHECK-NEXT: - Kind: 'ParagraphComment' -// CHECK-NEXT: Children: -// CHECK-NEXT: - Kind: 'TextComment' -// CHECK-NEXT: Text: ' Brief description.' -// CHECK-NEXT: - Kind: 'ParagraphComment' -// CHECK-NEXT: Children: -// CHECK-NEXT: - Kind: 'TextComment' -// CHECK-NEXT: Text: ' Extended description that' -// CHECK-NEXT: - Kind: 'TextComment' -// CHECK-NEXT: Text: ' continues onto the next line.' -// CHECK-NEXT: - Kind: 'ParagraphComment' -// CHECK-NEXT: Children: -// CHECK-NEXT: - Kind: 'TextComment' -// CHECK-NEXT: - Kind: 'HTMLStartTagComment' -// CHECK-NEXT: Name: 'ul' -// CHECK-NEXT: AttrKeys: -// CHECK-NEXT: - 'class' -// CHECK-NEXT: AttrValues: -// CHECK-NEXT: - 'test' -// CHECK-NEXT: - Kind: 'TextComment' -// CHECK-NEXT: - Kind: 'HTMLStartTagComment' -// CHECK-NEXT: Name: 'li' -// CHECK-NEXT: - Kind: 'TextComment' -// CHECK-NEXT: Text: ' Testing.' -// CHECK-NEXT: - Kind: 'TextComment' -// CHECK-NEXT: - Kind: 'HTMLEndTagComment' -// CHECK-NEXT: Name: 'ul' -// CHECK-NEXT: SelfClosing: true -// CHECK-NEXT: - Kind: 'ParagraphComment' -// CHECK-NEXT: Children: -// CHECK-NEXT: - Kind: 'TextComment' -// CHECK-NEXT: - Kind: 'VerbatimBlockComment' -// CHECK-NEXT: Name: 'verbatim' -// CHECK-NEXT: CloseName: 'endverbatim' -// CHECK-NEXT: Children: -// CHECK-NEXT: - Kind: 'VerbatimBlockLineComment' -// CHECK-NEXT: Text: ' The description continues.' -// CHECK-NEXT: - Kind: 'ParagraphComment' -// CHECK-NEXT: Children: -// CHECK-NEXT: - Kind: 'TextComment' -// CHECK-NEXT: - Kind: 'ParamCommandComment' -// CHECK-NEXT: Direction: '[out]' -// CHECK-NEXT: ParamName: 'I' -// CHECK-NEXT: Explicit: true -// CHECK-NEXT: Children: -// CHECK-NEXT: - Kind: 'ParagraphComment' -// CHECK-NEXT: Children: -// CHECK-NEXT: - Kind: 'TextComment' -// CHECK-NEXT: Text: ' is a parameter.' -// CHECK-NEXT: - Kind: 'TextComment' -// CHECK-NEXT: - Kind: 'ParamCommandComment' -// CHECK-NEXT: Direction: '[in]' -// CHECK-NEXT: ParamName: 'J' -// CHECK-NEXT: Children: -// CHECK-NEXT: - Kind: 'ParagraphComment' -// CHECK-NEXT: Children: -// CHECK-NEXT: - Kind: 'TextComment' -// CHECK-NEXT: Text: ' is a parameter.' -// CHECK-NEXT: - Kind: 'TextComment' -// CHECK-NEXT: - Kind: 'BlockCommandComment' -// CHECK-NEXT: Name: 'return' -// CHECK-NEXT: Children: -// CHECK-NEXT: - Kind: 'ParagraphComment' -// CHECK-NEXT: Children: -// CHECK-NEXT: - Kind: 'TextComment' -// CHECK-NEXT: Text: ' void' -// CHECK-NEXT: - Kind: 'FullComment' -// CHECK-NEXT: Children: -// CHECK-NEXT: - Kind: 'ParagraphComment' -// CHECK-NEXT: Children: -// CHECK-NEXT: - Kind: 'TextComment' -// CHECK-NEXT: Text: ' Bonus comment on definition' -// CHECK-NEXT: DefLocation: -// CHECK-NEXT: LineNumber: 27 -// CHECK-NEXT: Filename: '{{.*}}' -// CHECK-NEXT: Location: -// CHECK-NEXT: - LineNumber: 24 -// CHECK-NEXT: Filename: '{{.*}}' -// CHECK-NEXT: Params: -// CHECK-NEXT: - Type: -// CHECK-NEXT: Name: 'int' -// CHECK-NEXT: Name: 'I' -// CHECK-NEXT: - Type: -// CHECK-NEXT: Name: 'int' -// CHECK-NEXT: Name: 'J' -// CHECK-NEXT: ReturnType: -// CHECK-NEXT: Type: -// CHECK-NEXT: Name: 'void' -// CHECK-NEXT: ... Index: clang-tools-extra/test/clang-doc/yaml-namespace.cpp =================================================================== --- clang-tools-extra/test/clang-doc/yaml-namespace.cpp +++ clang-tools-extra/test/clang-doc/yaml-namespace.cpp @@ -2,21 +2,9 @@ // RUN: mkdir %t // RUN: echo "" > %t/compile_flags.txt // RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc -doxygen -p %t %t/test.cpp -output=%t/docs -// RUN: cat %t/docs/A.yaml | FileCheck %s --check-prefix=CHECK-A -// RUN: cat %t/docs/A/B.yaml | FileCheck %s --check-prefix=CHECK-B -// RUN: cat %t/docs/A/f.yaml | FileCheck %s --check-prefix=CHECK-F -// RUN: cat %t/docs/A/B/E.yaml | FileCheck %s --check-prefix=CHECK-E -// RUN: cat %t/docs/A/B/func.yaml | FileCheck %s --check-prefix=CHECK-FUNC namespace A { -// CHECK-A: --- -// CHECK-A-NEXT: USR: '8D042EFFC98B373450BC6B5B90A330C25A150E9C' -// CHECK-A-NEXT: Name: 'A' -// CHECK-A-NEXT: ... - - void f(); } // namespace A @@ -25,78 +13,90 @@ void f(){}; -// CHECK-F: --- -// CHECK-F-NEXT: USR: '39D3C95A5F7CE2BA4937BD7B01BAE09EBC2AD8AC' -// CHECK-F-NEXT: Name: 'f' -// CHECK-F-NEXT: Namespace: -// CHECK-F-NEXT: - Type: Namespace -// CHECK-F-NEXT: Name: 'A' -// CHECK-F-NEXT: USR: '8D042EFFC98B373450BC6B5B90A330C25A150E9C' -// CHECK-F-NEXT: DefLocation: -// CHECK-F-NEXT: LineNumber: 26 -// CHECK-F-NEXT: Filename: '{{.*}}' -// CHECK-F-NEXT: Location: -// CHECK-F-NEXT: - LineNumber: 20 -// CHECK-F-NEXT: Filename: 'test' -// CHECK-F-NEXT: ReturnType: -// CHECK-F-NEXT: Type: -// CHECK-F-NEXT: Name: 'void' -// CHECK-F-NEXT: ... - namespace B { - -// CHECK-B: --- -// CHECK-B-NEXT: USR: 'E21AF79E2A9D02554BA090D10DF39FE273F5CDB5' -// CHECK-B-NEXT: Name: 'B' -// CHECK-B-NEXT: Namespace: -// CHECK-B-NEXT: - Type: Namespace -// CHECK-B-NEXT: Name: 'A' -// CHECK-B-NEXT: USR: '8D042EFFC98B373450BC6B5B90A330C25A150E9C' -// CHECK-B-NEXT: ... - enum E { X }; -// CHECK-E: --- -// CHECK-E-NEXT: USR: 'E9ABF7E7E2425B626723D41E76E4BC7E7A5BD775' -// CHECK-E-NEXT: Name: 'E' -// CHECK-E-NEXT: Namespace: -// CHECK-E-NEXT: - Type: Namespace -// CHECK-E-NEXT: Name: 'B' -// CHECK-E-NEXT: USR: 'E21AF79E2A9D02554BA090D10DF39FE273F5CDB5' -// CHECK-E-NEXT: - Type: Namespace -// CHECK-E-NEXT: Name: 'A' -// CHECK-E-NEXT: USR: '8D042EFFC98B373450BC6B5B90A330C25A150E9C' -// CHECK-E-NEXT: DefLocation: -// CHECK-E-NEXT: LineNumber: 58 -// CHECK-E-NEXT: Filename: '{{.*}}' -// CHECK-E-NEXT: Members: -// CHECK-E-NEXT: - 'X' -// CHECK-E-NEXT: ... - E func(int i) { return X; } -// CHECK-FUNC: --- -// CHECK-FUNC-NEXT: USR: '9A82CB33ED0FDF81EE383D31CD0957D153C5E840' -// CHECK-FUNC-NEXT: Name: 'func' -// CHECK-FUNC-NEXT: Namespace: -// CHECK-FUNC-NEXT: - Type: Namespace -// CHECK-FUNC-NEXT: Name: 'B' -// CHECK-FUNC-NEXT: USR: 'E21AF79E2A9D02554BA090D10DF39FE273F5CDB5' -// CHECK-FUNC-NEXT: - Type: Namespace -// CHECK-FUNC-NEXT: Name: 'A' -// CHECK-FUNC-NEXT: USR: '8D042EFFC98B373450BC6B5B90A330C25A150E9C' -// CHECK-FUNC-NEXT: DefLocation: -// CHECK-FUNC-NEXT: LineNumber: 77 -// CHECK-FUNC-NEXT: Filename: '{{.*}}' -// CHECK-FUNC-NEXT: Params: -// CHECK-FUNC-NEXT: - Type: -// CHECK-FUNC-NEXT: Name: 'int' -// CHECK-FUNC-NEXT: Name: 'i' -// CHECK-FUNC-NEXT: ReturnType: -// CHECK-FUNC-NEXT: Type: -// CHECK-FUNC-NEXT: Name: 'enum A::B::E' -// CHECK-FUNC-NEXT: ... - } // namespace B } // namespace A + +// RUN: clang-doc --format=yaml --doxygen -p %t %t/test.cpp -output=%t/docs + + +// RUN: cat %t/docs/./A.yaml | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: --- +// CHECK-0-NEXT: USR: '8D042EFFC98B373450BC6B5B90A330C25A150E9C' +// CHECK-0-NEXT: Name: 'A' +// CHECK-0-NEXT: ... + +// RUN: cat %t/docs/A/f.yaml | FileCheck %s --check-prefix CHECK-1 +// CHECK-1: --- +// CHECK-1-NEXT: USR: '39D3C95A5F7CE2BA4937BD7B01BAE09EBC2AD8AC' +// CHECK-1-NEXT: Name: 'f' +// CHECK-1-NEXT: Namespace: +// CHECK-1-NEXT: - Type: Namespace +// CHECK-1-NEXT: Name: 'A' +// CHECK-1-NEXT: USR: '8D042EFFC98B373450BC6B5B90A330C25A150E9C' +// CHECK-1-NEXT: DefLocation: +// CHECK-1-NEXT: LineNumber: 14 +// CHECK-1-NEXT: Filename: 'test' +// CHECK-1-NEXT: Location: +// CHECK-1-NEXT: - LineNumber: 8 +// CHECK-1-NEXT: Filename: 'test' +// CHECK-1-NEXT: ReturnType: +// CHECK-1-NEXT: Type: +// CHECK-1-NEXT: Name: 'void' +// CHECK-1-NEXT: ... + +// RUN: cat %t/docs/A/B.yaml | FileCheck %s --check-prefix CHECK-2 +// CHECK-2: --- +// CHECK-2-NEXT: USR: 'E21AF79E2A9D02554BA090D10DF39FE273F5CDB5' +// CHECK-2-NEXT: Name: 'B' +// CHECK-2-NEXT: Namespace: +// CHECK-2-NEXT: - Type: Namespace +// CHECK-2-NEXT: Name: 'A' +// CHECK-2-NEXT: USR: '8D042EFFC98B373450BC6B5B90A330C25A150E9C' +// CHECK-2-NEXT: ... + +// RUN: cat %t/docs/A/B/E.yaml | FileCheck %s --check-prefix CHECK-3 +// CHECK-3: --- +// CHECK-3-NEXT: USR: 'E9ABF7E7E2425B626723D41E76E4BC7E7A5BD775' +// CHECK-3-NEXT: Name: 'E' +// CHECK-3-NEXT: Namespace: +// CHECK-3-NEXT: - Type: Namespace +// CHECK-3-NEXT: Name: 'B' +// CHECK-3-NEXT: USR: 'E21AF79E2A9D02554BA090D10DF39FE273F5CDB5' +// CHECK-3-NEXT: - Type: Namespace +// CHECK-3-NEXT: Name: 'A' +// CHECK-3-NEXT: USR: '8D042EFFC98B373450BC6B5B90A330C25A150E9C' +// CHECK-3-NEXT: DefLocation: +// CHECK-3-NEXT: LineNumber: 18 +// CHECK-3-NEXT: Filename: 'test' +// CHECK-3-NEXT: Members: +// CHECK-3-NEXT: - 'X' +// CHECK-3-NEXT: ... + +// RUN: cat %t/docs/A/B/func.yaml | FileCheck %s --check-prefix CHECK-4 +// CHECK-4: --- +// CHECK-4-NEXT: USR: '9A82CB33ED0FDF81EE383D31CD0957D153C5E840' +// CHECK-4-NEXT: Name: 'func' +// CHECK-4-NEXT: Namespace: +// CHECK-4-NEXT: - Type: Namespace +// CHECK-4-NEXT: Name: 'B' +// CHECK-4-NEXT: USR: 'E21AF79E2A9D02554BA090D10DF39FE273F5CDB5' +// CHECK-4-NEXT: - Type: Namespace +// CHECK-4-NEXT: Name: 'A' +// CHECK-4-NEXT: USR: '8D042EFFC98B373450BC6B5B90A330C25A150E9C' +// CHECK-4-NEXT: DefLocation: +// CHECK-4-NEXT: LineNumber: 20 +// CHECK-4-NEXT: Filename: 'test' +// CHECK-4-NEXT: Params: +// CHECK-4-NEXT: - Type: +// CHECK-4-NEXT: Name: 'int' +// CHECK-4-NEXT: Name: 'i' +// CHECK-4-NEXT: ReturnType: +// CHECK-4-NEXT: Type: +// CHECK-4-NEXT: Name: 'enum A::B::E' +// CHECK-4-NEXT: ... Index: clang-tools-extra/test/clang-doc/yaml-record.cpp =================================================================== --- clang-tools-extra/test/clang-doc/yaml-record.cpp +++ clang-tools-extra/test/clang-doc/yaml-record.cpp @@ -1,250 +1,249 @@ +// This test requires Linux due to system-dependent USR for the inner class. +// REQUIRES: system-linux // RUN: rm -rf %t // RUN: mkdir %t // RUN: echo "" > %t/compile_flags.txt // RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc -doxygen -p %t %t/test.cpp -output=%t/docs -// RUN: cat %t/docs/A.yaml | FileCheck %s --check-prefix=CHECK-A -// RUN: cat %t/docs/Bc.yaml | FileCheck %s --check-prefix=CHECK-BC -// RUN: cat %t/docs/B.yaml | FileCheck %s --check-prefix=CHECK-B -// RUN: cat %t/docs/C.yaml | FileCheck %s --check-prefix=CHECK-C -// RUN: cat %t/docs/D.yaml | FileCheck %s --check-prefix=CHECK-D -// RUN: cat %t/docs/E.yaml | FileCheck %s --check-prefix=CHECK-E -// RUN: cat %t/docs/E/ProtectedMethod.yaml | FileCheck %s --check-prefix=CHECK-EPM -// RUN: cat %t/docs/E/E.yaml | FileCheck %s --check-prefix=CHECK-ECON -// RUN: cat %t/docs/E/'~E.yaml' | FileCheck %s --check-prefix=CHECK-EDES -// RUN: cat %t/docs/F.yaml | FileCheck %s --check-prefix=CHECK-F -// RUN: cat %t/docs/X.yaml | FileCheck %s --check-prefix=CHECK-X -// RUN: cat %t/docs/X/Y.yaml | FileCheck %s --check-prefix=CHECK-Y -// RUN: cat %t/docs/H.yaml | FileCheck %s --check-prefix=CHECK-H -// RUN: cat %t/docs/H/I.yaml | FileCheck %s --check-prefix=CHECK-I -union A { int X; int Y; }; - -// CHECK-A: --- -// CHECK-A-NEXT: USR: 'ACE81AFA6627B4CEF2B456FB6E1252925674AF7E' -// CHECK-A-NEXT: Name: 'A' -// CHECK-A-NEXT: DefLocation: -// CHECK-A-NEXT: LineNumber: 21 -// CHECK-A-NEXT: Filename: '{{.*}}' -// CHECK-A-NEXT: TagType: Union -// CHECK-A-NEXT: Members: -// CHECK-A-NEXT: - Type: -// CHECK-A-NEXT: Name: 'int' -// CHECK-A-NEXT: Name: 'X' -// CHECK-A-NEXT: - Type: -// CHECK-A-NEXT: Name: 'int' -// CHECK-A-NEXT: Name: 'Y' -// CHECK-A-NEXT: ... +void H() { + class I {}; +} +union A { int X; int Y; }; enum B { X, Y }; -// CHECK-B: --- -// CHECK-B-NEXT: USR: 'FC07BD34D5E77782C263FA944447929EA8753740' -// CHECK-B-NEXT: Name: 'B' -// CHECK-B-NEXT: DefLocation: -// CHECK-B-NEXT: LineNumber: 40 -// CHECK-B-NEXT: Filename: '{{.*}}' -// CHECK-B-NEXT: Members: -// CHECK-B-NEXT: - 'X' -// CHECK-B-NEXT: - 'Y' -// CHECK-B-NEXT: ... - enum class Bc { A, B }; -// CHECK-BC: --- -// CHECK-BC-NEXT: USR: '1E3438A08BA22025C0B46289FF0686F92C8924C5' -// CHECK-BC-NEXT: Name: 'Bc' -// CHECK-BC-NEXT: DefLocation: -// CHECK-BC-NEXT: LineNumber: 53 -// CHECK-BC-NEXT: Filename: '{{.*}}' -// CHECK-BC-NEXT: Scoped: true -// CHECK-BC-NEXT: Members: -// CHECK-BC-NEXT: - 'A' -// CHECK-BC-NEXT: - 'B' -// CHECK-BC-NEXT: ... - struct C { int i; }; -// CHECK-C: --- -// CHECK-C-NEXT: USR: '06B5F6A19BA9F6A832E127C9968282B94619B210' -// CHECK-C-NEXT: Name: 'C' -// CHECK-C-NEXT: DefLocation: -// CHECK-C-NEXT: LineNumber: 67 -// CHECK-C-NEXT: Filename: '{{.*}}' -// CHECK-C-NEXT: Members: -// CHECK-C-NEXT: - Type: -// CHECK-C-NEXT: Name: 'int' -// CHECK-C-NEXT: Name: 'i' -// CHECK-C-NEXT: ... - class D {}; -// CHECK-D: --- -// CHECK-D-NEXT: USR: '0921737541208B8FA9BB42B60F78AC1D779AA054' -// CHECK-D-NEXT: Name: 'D' -// CHECK-D-NEXT: DefLocation: -// CHECK-D-NEXT: LineNumber: 81 -// CHECK-D-NEXT: Filename: '{{.*}}' -// CHECK-D-NEXT: TagType: Class -// CHECK-D-NEXT: ... - class E { public: E() {} - -// CHECK-ECON: --- -// CHECK-ECON-NEXT: USR: 'DEB4AC1CD9253CD9EF7FBE6BCAC506D77984ABD4' -// CHECK-ECON-NEXT: Name: 'E' -// CHECK-ECON-NEXT: Namespace: -// CHECK-ECON-NEXT: - Type: Record -// CHECK-ECON-NEXT: Name: 'E' -// CHECK-ECON-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' -// CHECK-ECON-NEXT: DefLocation: -// CHECK-ECON-NEXT: LineNumber: 94 -// CHECK-ECON-NEXT: Filename: '{{.*}}' -// CHECK-ECON-NEXT: IsMethod: true -// CHECK-ECON-NEXT: Parent: -// CHECK-ECON-NEXT: Type: Record -// CHECK-ECON-NEXT: Name: 'E' -// CHECK-ECON-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' -// CHECK-ECON-NEXT: ReturnType: -// CHECK-ECON-NEXT: Type: -// CHECK-ECON-NEXT: Name: 'void' -// CHECK-ECON-NEXT: ... - ~E() {} - -// CHECK-EDES: --- -// CHECK-EDES-NEXT: USR: 'BD2BDEBD423F80BACCEA75DE6D6622D355FC2D17' -// CHECK-EDES-NEXT: Name: '~E' -// CHECK-EDES-NEXT: Namespace: -// CHECK-EDES-NEXT: - Type: Record -// CHECK-EDES-NEXT: Name: 'E' -// CHECK-EDES-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' -// CHECK-EDES-NEXT: DefLocation: -// CHECK-EDES-NEXT: LineNumber: 116 -// CHECK-EDES-NEXT: Filename: '{{.*}}' -// CHECK-EDES-NEXT: IsMethod: true -// CHECK-EDES-NEXT: Parent: -// CHECK-EDES-NEXT: Type: Record -// CHECK-EDES-NEXT: Name: 'E' -// CHECK-EDES-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' -// CHECK-EDES-NEXT: ReturnType: -// CHECK-EDES-NEXT: Type: -// CHECK-EDES-NEXT: Name: 'void' -// CHECK-EDES-NEXT: ... - protected: void ProtectedMethod(); }; -// CHECK-E: --- -// CHECK-E-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' -// CHECK-E-NEXT: Name: 'E' -// CHECK-E-NEXT: DefLocation: -// CHECK-E-NEXT: LineNumber: 92 -// CHECK-E-NEXT: Filename: '{{.*}}' -// CHECK-E-NEXT: TagType: Class -// CHECK-E-NEXT: ... - void E::ProtectedMethod() {} -// CHECK-EPM: --- -// CHECK-EPM-NEXT: USR: '5093D428CDC62096A67547BA52566E4FB9404EEE' -// CHECK-EPM-NEXT: Name: 'ProtectedMethod' -// CHECK-EPM-NEXT: Namespace: -// CHECK-EPM-NEXT: - Type: Record -// CHECK-EPM-NEXT: Name: 'E' -// CHECK-EPM-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' -// CHECK-EPM-NEXT: DefLocation: -// CHECK-EPM-NEXT: LineNumber: 152 -// CHECK-EPM-NEXT: Filename: '{{.*}}' -// CHECK-EPM-NEXT: Location: -// CHECK-EPM-NEXT: - LineNumber: 140 -// CHECK-EPM-NEXT: Filename: '{{.*}}' -// CHECK-EPM-NEXT: IsMethod: true -// CHECK-EPM-NEXT: Parent: -// CHECK-EPM-NEXT: Type: Record -// CHECK-EPM-NEXT: Name: 'E' -// CHECK-EPM-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' -// CHECK-EPM-NEXT: ReturnType: -// CHECK-EPM-NEXT: Type: -// CHECK-EPM-NEXT: Name: 'void' -// CHECK-EPM-NEXT: ... - class F : virtual private D, public E {}; -// CHECK-F: --- -// CHECK-F-NEXT: USR: 'E3B54702FABFF4037025BA194FC27C47006330B5' -// CHECK-F-NEXT: Name: 'F' -// CHECK-F-NEXT: DefLocation: -// CHECK-F-NEXT: LineNumber: 177 -// CHECK-F-NEXT: Filename: '{{.*}}' -// CHECK-F-NEXT: TagType: Class -// CHECK-F-NEXT: Parents: -// CHECK-F-NEXT: - Type: Record -// CHECK-F-NEXT: Name: 'E' -// CHECK-F-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' -// CHECK-F-NEXT: VirtualParents: -// CHECK-F-NEXT: - Type: Record -// CHECK-F-NEXT: Name: 'D' -// CHECK-F-NEXT: USR: '0921737541208B8FA9BB42B60F78AC1D779AA054' -// CHECK-F-NEXT: ... - class X { class Y {}; - -// CHECK-Y: --- -// CHECK-Y-NEXT: USR: '641AB4A3D36399954ACDE29C7A8833032BF40472' -// CHECK-Y-NEXT: Name: 'Y' -// CHECK-Y-NEXT: Namespace: -// CHECK-Y-NEXT: - Type: Record -// CHECK-Y-NEXT: Name: 'X' -// CHECK-Y-NEXT: USR: 'CA7C7935730B5EACD25F080E9C83FA087CCDC75E' -// CHECK-Y-NEXT: DefLocation: -// CHECK-Y-NEXT: LineNumber: 197 -// CHECK-Y-NEXT: Filename: '{{.*}}' -// CHECK-Y-NEXT: TagType: Class -// CHECK-Y-NEXT: ... - }; -// CHECK-X: --- -// CHECK-X-NEXT: USR: 'CA7C7935730B5EACD25F080E9C83FA087CCDC75E' -// CHECK-X-NEXT: Name: 'X' -// CHECK-X-NEXT: DefLocation: -// CHECK-X-NEXT: LineNumber: 196 -// CHECK-X-NEXT: Filename: '{{.*}}' -// CHECK-X-NEXT: TagType: Class -// CHECK-X-NEXT: ... - -void H() { - class I {}; - -// CHECK-I: --- -// CHECK-I-NEXT: USR: '{{.*}}' -// CHECK-I-NEXT: Name: 'I' -// CHECK-I-NEXT: Namespace: -// CHECK-I-NEXT: - Type: Function -// CHECK-I-NEXT: Name: 'H' -// CHECK-I-NEXT: USR: 'B6AC4C5C9F2EA3F2B3ECE1A33D349F4EE502B24E' -// CHECK-I-NEXT: DefLocation: -// CHECK-I-NEXT: LineNumber: 224 -// CHECK-I-NEXT: Filename: 'test' -// CHECK-I-NEXT: TagType: Class -// CHECK-I-NEXT: ... - -} - -// CHECK-H: --- -// CHECK-H-NEXT: USR: 'B6AC4C5C9F2EA3F2B3ECE1A33D349F4EE502B24E' -// CHECK-H-NEXT: Name: 'H' -// CHECK-H-NEXT: DefLocation: -// CHECK-H-NEXT: LineNumber: 223 -// CHECK-H-NEXT: Filename: 'test' -// CHECK-H-NEXT: ReturnType: -// CHECK-H-NEXT: Type: -// CHECK-H-NEXT: Name: 'void' -// CHECK-H-NEXT: ... +// RUN: clang-doc --format=yaml --doxygen -p %t %t/test.cpp -output=%t/docs + + +// RUN: cat %t/docs/./C.yaml | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: --- +// CHECK-0-NEXT: USR: '06B5F6A19BA9F6A832E127C9968282B94619B210' +// CHECK-0-NEXT: Name: 'C' +// CHECK-0-NEXT: DefLocation: +// CHECK-0-NEXT: LineNumber: 18 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: Members: +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'i' +// CHECK-0-NEXT: ... + +// RUN: cat %t/docs/./A.yaml | FileCheck %s --check-prefix CHECK-1 +// CHECK-1: --- +// CHECK-1-NEXT: USR: 'ACE81AFA6627B4CEF2B456FB6E1252925674AF7E' +// CHECK-1-NEXT: Name: 'A' +// CHECK-1-NEXT: DefLocation: +// CHECK-1-NEXT: LineNumber: 12 +// CHECK-1-NEXT: Filename: 'test' +// CHECK-1-NEXT: TagType: Union +// CHECK-1-NEXT: Members: +// CHECK-1-NEXT: - Type: +// CHECK-1-NEXT: Name: 'int' +// CHECK-1-NEXT: Name: 'X' +// CHECK-1-NEXT: - Type: +// CHECK-1-NEXT: Name: 'int' +// CHECK-1-NEXT: Name: 'Y' +// CHECK-1-NEXT: ... + +// RUN: cat %t/docs/./F.yaml | FileCheck %s --check-prefix CHECK-2 +// CHECK-2: --- +// CHECK-2-NEXT: USR: 'E3B54702FABFF4037025BA194FC27C47006330B5' +// CHECK-2-NEXT: Name: 'F' +// CHECK-2-NEXT: DefLocation: +// CHECK-2-NEXT: LineNumber: 33 +// CHECK-2-NEXT: Filename: 'test' +// CHECK-2-NEXT: TagType: Class +// CHECK-2-NEXT: Parents: +// CHECK-2-NEXT: - Type: Record +// CHECK-2-NEXT: Name: 'E' +// CHECK-2-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' +// CHECK-2-NEXT: VirtualParents: +// CHECK-2-NEXT: - Type: Record +// CHECK-2-NEXT: Name: 'D' +// CHECK-2-NEXT: USR: '0921737541208B8FA9BB42B60F78AC1D779AA054' +// CHECK-2-NEXT: ... + +// RUN: cat %t/docs/./E.yaml | FileCheck %s --check-prefix CHECK-3 +// CHECK-3: --- +// CHECK-3-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' +// CHECK-3-NEXT: Name: 'E' +// CHECK-3-NEXT: DefLocation: +// CHECK-3-NEXT: LineNumber: 22 +// CHECK-3-NEXT: Filename: 'test' +// CHECK-3-NEXT: TagType: Class +// CHECK-3-NEXT: ... + +// RUN: cat %t/docs/./D.yaml | FileCheck %s --check-prefix CHECK-4 +// CHECK-4: --- +// CHECK-4-NEXT: USR: '0921737541208B8FA9BB42B60F78AC1D779AA054' +// CHECK-4-NEXT: Name: 'D' +// CHECK-4-NEXT: DefLocation: +// CHECK-4-NEXT: LineNumber: 20 +// CHECK-4-NEXT: Filename: 'test' +// CHECK-4-NEXT: TagType: Class +// CHECK-4-NEXT: ... + +// RUN: cat %t/docs/./B.yaml | FileCheck %s --check-prefix CHECK-5 +// CHECK-5: --- +// CHECK-5-NEXT: USR: 'FC07BD34D5E77782C263FA944447929EA8753740' +// CHECK-5-NEXT: Name: 'B' +// CHECK-5-NEXT: DefLocation: +// CHECK-5-NEXT: LineNumber: 14 +// CHECK-5-NEXT: Filename: 'test' +// CHECK-5-NEXT: Members: +// CHECK-5-NEXT: - 'X' +// CHECK-5-NEXT: - 'Y' +// CHECK-5-NEXT: ... + +// RUN: cat %t/docs/./X.yaml | FileCheck %s --check-prefix CHECK-6 +// CHECK-6: --- +// CHECK-6-NEXT: USR: 'CA7C7935730B5EACD25F080E9C83FA087CCDC75E' +// CHECK-6-NEXT: Name: 'X' +// CHECK-6-NEXT: DefLocation: +// CHECK-6-NEXT: LineNumber: 35 +// CHECK-6-NEXT: Filename: 'test' +// CHECK-6-NEXT: TagType: Class +// CHECK-6-NEXT: ... + +// RUN: cat %t/docs/./H.yaml | FileCheck %s --check-prefix CHECK-7 +// CHECK-7: --- +// CHECK-7-NEXT: USR: 'B6AC4C5C9F2EA3F2B3ECE1A33D349F4EE502B24E' +// CHECK-7-NEXT: Name: 'H' +// CHECK-7-NEXT: DefLocation: +// CHECK-7-NEXT: LineNumber: 8 +// CHECK-7-NEXT: Filename: 'test' +// CHECK-7-NEXT: ReturnType: +// CHECK-7-NEXT: Type: +// CHECK-7-NEXT: Name: 'void' +// CHECK-7-NEXT: ... + +// RUN: cat %t/docs/./Bc.yaml | FileCheck %s --check-prefix CHECK-8 +// CHECK-8: --- +// CHECK-8-NEXT: USR: '1E3438A08BA22025C0B46289FF0686F92C8924C5' +// CHECK-8-NEXT: Name: 'Bc' +// CHECK-8-NEXT: DefLocation: +// CHECK-8-NEXT: LineNumber: 16 +// CHECK-8-NEXT: Filename: 'test' +// CHECK-8-NEXT: Scoped: true +// CHECK-8-NEXT: Members: +// CHECK-8-NEXT: - 'A' +// CHECK-8-NEXT: - 'B' +// CHECK-8-NEXT: ... + +// RUN: cat %t/docs/H/I.yaml | FileCheck %s --check-prefix CHECK-9 +// CHECK-9: --- +// CHECK-9-NEXT: USR: 'E60CA1CC7048098A7F4A48C3A53D45A533BDC39B' +// CHECK-9-NEXT: Name: 'I' +// CHECK-9-NEXT: Namespace: +// CHECK-9-NEXT: - Type: Function +// CHECK-9-NEXT: Name: 'H' +// CHECK-9-NEXT: USR: 'B6AC4C5C9F2EA3F2B3ECE1A33D349F4EE502B24E' +// CHECK-9-NEXT: DefLocation: +// CHECK-9-NEXT: LineNumber: 9 +// CHECK-9-NEXT: Filename: 'test' +// CHECK-9-NEXT: TagType: Class +// CHECK-9-NEXT: ... + +// RUN: cat %t/docs/X/Y.yaml | FileCheck %s --check-prefix CHECK-10 +// CHECK-10: --- +// CHECK-10-NEXT: USR: '641AB4A3D36399954ACDE29C7A8833032BF40472' +// CHECK-10-NEXT: Name: 'Y' +// CHECK-10-NEXT: Namespace: +// CHECK-10-NEXT: - Type: Record +// CHECK-10-NEXT: Name: 'X' +// CHECK-10-NEXT: USR: 'CA7C7935730B5EACD25F080E9C83FA087CCDC75E' +// CHECK-10-NEXT: DefLocation: +// CHECK-10-NEXT: LineNumber: 36 +// CHECK-10-NEXT: Filename: 'test' +// CHECK-10-NEXT: TagType: Class +// CHECK-10-NEXT: ... + +// RUN: cat %t/docs/E/ProtectedMethod.yaml | FileCheck %s --check-prefix CHECK-11 +// CHECK-11: --- +// CHECK-11-NEXT: USR: '5093D428CDC62096A67547BA52566E4FB9404EEE' +// CHECK-11-NEXT: Name: 'ProtectedMethod' +// CHECK-11-NEXT: Namespace: +// CHECK-11-NEXT: - Type: Record +// CHECK-11-NEXT: Name: 'E' +// CHECK-11-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' +// CHECK-11-NEXT: DefLocation: +// CHECK-11-NEXT: LineNumber: 31 +// CHECK-11-NEXT: Filename: 'test' +// CHECK-11-NEXT: Location: +// CHECK-11-NEXT: - LineNumber: 28 +// CHECK-11-NEXT: Filename: 'test' +// CHECK-11-NEXT: IsMethod: true +// CHECK-11-NEXT: Parent: +// CHECK-11-NEXT: Type: Record +// CHECK-11-NEXT: Name: 'E' +// CHECK-11-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' +// CHECK-11-NEXT: ReturnType: +// CHECK-11-NEXT: Type: +// CHECK-11-NEXT: Name: 'void' +// CHECK-11-NEXT: ... + +// RUN: cat %t/docs/E/E.yaml | FileCheck %s --check-prefix CHECK-12 +// CHECK-12: --- +// CHECK-12-NEXT: USR: 'DEB4AC1CD9253CD9EF7FBE6BCAC506D77984ABD4' +// CHECK-12-NEXT: Name: 'E' +// CHECK-12-NEXT: Namespace: +// CHECK-12-NEXT: - Type: Record +// CHECK-12-NEXT: Name: 'E' +// CHECK-12-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' +// CHECK-12-NEXT: DefLocation: +// CHECK-12-NEXT: LineNumber: 24 +// CHECK-12-NEXT: Filename: 'test' +// CHECK-12-NEXT: IsMethod: true +// CHECK-12-NEXT: Parent: +// CHECK-12-NEXT: Type: Record +// CHECK-12-NEXT: Name: 'E' +// CHECK-12-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' +// CHECK-12-NEXT: ReturnType: +// CHECK-12-NEXT: Type: +// CHECK-12-NEXT: Name: 'void' +// CHECK-12-NEXT: ... + +// RUN: cat %t/docs/E/~E.yaml | FileCheck %s --check-prefix CHECK-13 +// CHECK-13: --- +// CHECK-13-NEXT: USR: 'BD2BDEBD423F80BACCEA75DE6D6622D355FC2D17' +// CHECK-13-NEXT: Name: '~E' +// CHECK-13-NEXT: Namespace: +// CHECK-13-NEXT: - Type: Record +// CHECK-13-NEXT: Name: 'E' +// CHECK-13-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' +// CHECK-13-NEXT: DefLocation: +// CHECK-13-NEXT: LineNumber: 25 +// CHECK-13-NEXT: Filename: 'test' +// CHECK-13-NEXT: IsMethod: true +// CHECK-13-NEXT: Parent: +// CHECK-13-NEXT: Type: Record +// CHECK-13-NEXT: Name: 'E' +// CHECK-13-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' +// CHECK-13-NEXT: ReturnType: +// CHECK-13-NEXT: Type: +// CHECK-13-NEXT: Name: 'void' +// CHECK-13-NEXT: ...