From 93be04bf1f2f87e7e18f8c0ed4795444baf5cd59 Mon Sep 17 00:00:00 2001 From: Hsin-Yi Chen Date: Mon, 4 Jul 2022 15:47:18 +0800 Subject: [PATCH] Remove -suppress-errors from header-abi-dumper The purpose of the option was to parse individual header files. It's not an effective solution to the headers that are not self-contained. Test: PATH=$PATH:$ANDROID_BUILD_TOP/out/soong/dist/bin \ development/vndk/tools/header-checker/tests/test.py Bug: 237966264 Change-Id: Id7321d7feb0bb28f6e0da39bc9d6a4348e038149 --- vndk/tools/header-checker/Android.bp | 2 - .../src/dumper/diagnostic_consumer.cpp | 73 ------ .../src/dumper/diagnostic_consumer.h | 47 ---- .../src/dumper/fake_decl_source.cpp | 208 ------------------ .../src/dumper/fake_decl_source.h | 74 ------- .../src/dumper/frontend_action.cpp | 27 +-- .../src/dumper/frontend_action.h | 8 - .../src/dumper/header_checker.cpp | 13 +- .../src/dumper/header_checker.h | 12 +- .../integration/cpp/header/known_issues.h | 22 -- .../integration/cpp/header/undeclared_types.h | 27 --- vndk/tools/header-checker/tests/module.py | 10 - .../reference_dumps/arm/known_issues.h.sdump | 46 ---- .../arm/undeclared_types.h.sdump | 113 ---------- .../arm64/known_issues.h.sdump | 46 ---- .../arm64/undeclared_types.h.sdump | 113 ---------- .../reference_dumps/mips/known_issues.h.sdump | 46 ---- .../mips/undeclared_types.h.sdump | 113 ---------- .../mips64/known_issues.h.sdump | 46 ---- .../mips64/undeclared_types.h.sdump | 113 ---------- .../reference_dumps/x86/known_issues.h.sdump | 46 ---- .../x86/undeclared_types.h.sdump | 113 ---------- .../x86_64/known_issues.h.sdump | 46 ---- .../x86_64/undeclared_types.h.sdump | 113 ---------- vndk/tools/header-checker/tests/test.py | 8 - 25 files changed, 12 insertions(+), 1473 deletions(-) delete mode 100644 vndk/tools/header-checker/src/dumper/diagnostic_consumer.cpp delete mode 100644 vndk/tools/header-checker/src/dumper/diagnostic_consumer.h delete mode 100644 vndk/tools/header-checker/src/dumper/fake_decl_source.cpp delete mode 100644 vndk/tools/header-checker/src/dumper/fake_decl_source.h delete mode 100644 vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h delete mode 100644 vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h delete mode 100644 vndk/tools/header-checker/tests/reference_dumps/arm/known_issues.h.sdump delete mode 100644 vndk/tools/header-checker/tests/reference_dumps/arm/undeclared_types.h.sdump delete mode 100644 vndk/tools/header-checker/tests/reference_dumps/arm64/known_issues.h.sdump delete mode 100644 vndk/tools/header-checker/tests/reference_dumps/arm64/undeclared_types.h.sdump delete mode 100644 vndk/tools/header-checker/tests/reference_dumps/mips/known_issues.h.sdump delete mode 100644 vndk/tools/header-checker/tests/reference_dumps/mips/undeclared_types.h.sdump delete mode 100644 vndk/tools/header-checker/tests/reference_dumps/mips64/known_issues.h.sdump delete mode 100644 vndk/tools/header-checker/tests/reference_dumps/mips64/undeclared_types.h.sdump delete mode 100644 vndk/tools/header-checker/tests/reference_dumps/x86/known_issues.h.sdump delete mode 100644 vndk/tools/header-checker/tests/reference_dumps/x86/undeclared_types.h.sdump delete mode 100644 vndk/tools/header-checker/tests/reference_dumps/x86_64/known_issues.h.sdump delete mode 100644 vndk/tools/header-checker/tests/reference_dumps/x86_64/undeclared_types.h.sdump diff --git a/vndk/tools/header-checker/Android.bp b/vndk/tools/header-checker/Android.bp index 7d8c3ca18..e626b7f24 100644 --- a/vndk/tools/header-checker/Android.bp +++ b/vndk/tools/header-checker/Android.bp @@ -63,8 +63,6 @@ cc_binary_host { srcs: [ "src/dumper/abi_wrappers.cpp", "src/dumper/ast_processing.cpp", - "src/dumper/diagnostic_consumer.cpp", - "src/dumper/fake_decl_source.cpp", "src/dumper/fixed_argv.cpp", "src/dumper/frontend_action.cpp", "src/dumper/frontend_action_factory.cpp", diff --git a/vndk/tools/header-checker/src/dumper/diagnostic_consumer.cpp b/vndk/tools/header-checker/src/dumper/diagnostic_consumer.cpp deleted file mode 100644 index 212609db7..000000000 --- a/vndk/tools/header-checker/src/dumper/diagnostic_consumer.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (C) 2018 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "dumper/diagnostic_consumer.h" - -#include -#include -#include - - -namespace header_checker { -namespace dumper { - - -HeaderCheckerDiagnosticConsumer::HeaderCheckerDiagnosticConsumer( - std::unique_ptr wrapped) - : wrapped_(std::move(wrapped)) {} - -void HeaderCheckerDiagnosticConsumer::clear() { - // Default implementation resets warning/error count. - DiagnosticConsumer::clear(); - wrapped_->clear(); -} - -void HeaderCheckerDiagnosticConsumer::BeginSourceFile( - const clang::LangOptions &lang_opts, - const clang::Preprocessor *preprocessor) { - wrapped_->BeginSourceFile(lang_opts, preprocessor); -} - -void HeaderCheckerDiagnosticConsumer::EndSourceFile() { - wrapped_->EndSourceFile(); -} - -void HeaderCheckerDiagnosticConsumer::finish() { wrapped_->finish(); } - -bool HeaderCheckerDiagnosticConsumer::IncludeInDiagnosticCounts() const { - return false; -} - -void HeaderCheckerDiagnosticConsumer::HandleDiagnostic( - clang::DiagnosticsEngine::Level level, const clang::Diagnostic &info) { - if (level < clang::DiagnosticsEngine::Level::Error) { - return; - } - unsigned id = info.getID(); - if (id == clang::diag::err_pp_hash_error || - id == clang::diag::fatal_too_many_errors) { - return; - } - unsigned category = clang::DiagnosticIDs::getCategoryNumberForDiag(id); - if (category == clang::diag::DiagCat_Semantic_Issue) { - return; - } - // Default implementation increases warning/error count. - DiagnosticConsumer::HandleDiagnostic(level, info); - wrapped_->HandleDiagnostic(level, info); -} - - -} // dumper -} // header_checker diff --git a/vndk/tools/header-checker/src/dumper/diagnostic_consumer.h b/vndk/tools/header-checker/src/dumper/diagnostic_consumer.h deleted file mode 100644 index f4738ee8d..000000000 --- a/vndk/tools/header-checker/src/dumper/diagnostic_consumer.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (C) 2018 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef DIAGNOSTIC_CONSUMER_H_ -#define DIAGNOSTIC_CONSUMER_H_ - -#include - - -namespace header_checker { -namespace dumper { - - -class HeaderCheckerDiagnosticConsumer : public clang::DiagnosticConsumer { - private: - std::unique_ptr wrapped_; - - public: - HeaderCheckerDiagnosticConsumer( - std::unique_ptr wrapped); - void clear() override; - void BeginSourceFile(const clang::LangOptions &lang_opts, - const clang::Preprocessor *preprocessor) override; - void EndSourceFile() override; - void finish() override; - bool IncludeInDiagnosticCounts() const override; - void HandleDiagnostic(clang::DiagnosticsEngine::Level level, - const clang::Diagnostic &info) override; -}; - - -} // namespace dumper -} // namespace header_checker - - -#endif // DIAGNOSTIC_CONSUMER_H_ diff --git a/vndk/tools/header-checker/src/dumper/fake_decl_source.cpp b/vndk/tools/header-checker/src/dumper/fake_decl_source.cpp deleted file mode 100644 index 57cd1e389..000000000 --- a/vndk/tools/header-checker/src/dumper/fake_decl_source.cpp +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (C) 2018 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "dumper/fake_decl_source.h" - -#include -#include - - -namespace header_checker { -namespace dumper { - - -FakeDeclSource::FakeDeclSource(const clang::CompilerInstance &ci) : ci_(ci) {} - -clang::CXXRecordDecl * -FakeDeclSource::CreateCXXRecordDecl(const clang::DeclarationName &name, - clang::DeclContext *decl_context) { - clang::CXXRecordDecl *cxx_record_decl = clang::CXXRecordDecl::Create( - ci_.getASTContext(), clang::TTK_Struct, decl_context, - clang::SourceLocation(), clang::SourceLocation(), - name.getAsIdentifierInfo(), /* PrevDecl */ nullptr); - cxx_record_decl->setInvalidDecl(true); - - return cxx_record_decl; -} - -clang::ClassTemplateDecl * -FakeDeclSource::CreateClassTemplateDecl(clang::CXXRecordDecl *cxx_record_decl, - clang::DeclContext *decl_context) { - clang::ASTContext &ast = ci_.getASTContext(); - - // Declare `template struct RecordName` in decl_context. - clang::TemplateTypeParmDecl *parm = clang::TemplateTypeParmDecl::Create( - ast, decl_context, clang::SourceLocation(), clang::SourceLocation(), - /* Depth */ 0, /* Position */ 0, /* Id */ nullptr, - /* Typename */ true, /* ParameterPack */ true); - parm->setInvalidDecl(true); - - clang::NamedDecl *parm_array[1] = {parm}; - clang::TemplateParameterList *parm_list = - clang::TemplateParameterList::Create( - ast, clang::SourceLocation(), clang::SourceLocation(), parm_array, - clang::SourceLocation(), /* RequiresClause */ nullptr); - - clang::ClassTemplateDecl *class_template_decl = - clang::ClassTemplateDecl::Create( - ast, decl_context, clang::SourceLocation(), - cxx_record_decl->getDeclName(), parm_list, cxx_record_decl); - - cxx_record_decl->setDescribedClassTemplate(class_template_decl); - class_template_decl->setInvalidDecl(true); - - return class_template_decl; -} - -clang::NamespaceDecl * -FakeDeclSource::CreateNamespaceDecl(const clang::DeclarationName &name, - clang::DeclContext *decl_context) { - clang::NamespaceDecl *namespace_decl = clang::NamespaceDecl::Create( - ci_.getASTContext(), decl_context, /* Inline */ false, - clang::SourceLocation(), clang::SourceLocation(), - name.getAsIdentifierInfo(), /* PrevDecl */ nullptr); - namespace_decl->setInvalidDecl(true); - - return namespace_decl; -} - -clang::NamedDecl * -FakeDeclSource::CreateDecl(clang::Sema::LookupNameKind kind, - const clang::DeclarationNameInfo &name_info, - clang::DeclContext *decl_context) { - const clang::DeclarationName &name = name_info.getName(); - if (name.getNameKind() != clang::DeclarationName::Identifier) { - return nullptr; - } - - clang::NamedDecl *decl; - switch (kind) { - case clang::Sema::LookupOrdinaryName: - case clang::Sema::LookupTagName: { - clang::CXXRecordDecl *cxx_record_decl = - CreateCXXRecordDecl(name, decl_context); - // If `<` follows the type name, the type must be a template. - // Otherwise, the compiler takes it as a syntax error. - const clang::Token &next_token = ci_.getPreprocessor().LookAhead(0); - if (next_token.is(clang::tok::less)) { - decl = CreateClassTemplateDecl(cxx_record_decl, decl_context); - } else { - decl = cxx_record_decl; - } - break; - } - case clang::Sema::LookupNestedNameSpecifierName: - decl = CreateNamespaceDecl(name, decl_context); - break; - default: - decl = nullptr; - } - - if (decl) { - decl_context->addDecl(decl); - } - return decl; -} - -clang::DeclContext * -FakeDeclSource::ResolveDeclContext(clang::DeclContext *member_context, - clang::Scope *scope, - clang::NestedNameSpecifier *nns) { - if (member_context) { - return member_context; - } - - if (nns) { - switch (nns->getKind()) { - case clang::NestedNameSpecifier::Namespace: - return nns->getAsNamespace(); - case clang::NestedNameSpecifier::NamespaceAlias: - return nns->getAsNamespaceAlias()->getNamespace(); - case clang::NestedNameSpecifier::TypeSpec: - case clang::NestedNameSpecifier::TypeSpecWithTemplate: - return nns->getAsRecordDecl(); - case clang::NestedNameSpecifier::Global: - return ci_.getASTContext().getTranslationUnitDecl(); - case clang::NestedNameSpecifier::Identifier: - case clang::NestedNameSpecifier::Super: - break; - } - } - - if (scope && scope->getEntity()) { - return scope->getEntity(); - } - - return ci_.getASTContext().getTranslationUnitDecl(); -} - -clang::TypoCorrection FakeDeclSource::CorrectTypo( - const clang::DeclarationNameInfo &typo, int lookup_kind, - clang::Scope *scope, clang::CXXScopeSpec *scope_spec, - clang::CorrectionCandidateCallback &ccc, clang::DeclContext *member_context, - bool entering_context, const clang::ObjCObjectPointerType *opt) { - // Skip function bodies. - if (scope && scope->getFnParent()) { - return clang::TypoCorrection(); - } - - clang::NestedNameSpecifier *nns = nullptr; - if (scope_spec && !scope_spec->isEmpty()) { - nns = scope_spec->getScopeRep(); - } - - clang::DeclContext *decl_context = - ResolveDeclContext(member_context, scope, nns); - - clang::NamedDecl *decl = - CreateDecl(clang::Sema::LookupNameKind(lookup_kind), typo, decl_context); - if (decl == nullptr) { - return clang::TypoCorrection(); - } - - return clang::TypoCorrection(decl, nns); -} - -bool FakeDeclSource::LookupUnqualified(clang::LookupResult &result, - clang::Scope *scope) { - // The compiler looks for redeclaration when it parses a known name. - if (result.isForRedeclaration()) { - return false; - } - // Skip function bodies. - if (scope && scope->getFnParent()) { - return false; - } - - clang::DeclContext *decl_context; - if (scope && scope->getEntity()) { - decl_context = scope->getEntity(); - } else { - decl_context = ci_.getASTContext().getTranslationUnitDecl(); - } - - clang::NamedDecl *decl = CreateDecl(result.getLookupKind(), - result.getLookupNameInfo(), decl_context); - if (decl == nullptr) { - return false; - } - - result.addDecl(decl); - result.resolveKind(); - return true; -} - - -} // dumper -} // header_checker diff --git a/vndk/tools/header-checker/src/dumper/fake_decl_source.h b/vndk/tools/header-checker/src/dumper/fake_decl_source.h deleted file mode 100644 index 42c855267..000000000 --- a/vndk/tools/header-checker/src/dumper/fake_decl_source.h +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (C) 2018 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef HEADER_CHECKER_ABI_DUMPER_FAKE_DECL_SOURCE_H_ -#define HEADER_CHECKER_ABI_DUMPER_FAKE_DECL_SOURCE_H_ - -#include -#include -#include - - -namespace header_checker { -namespace dumper { - - -// This class creates fake declarations when the compiler queries for unknown -// types. -class FakeDeclSource : public clang::ExternalSemaSource { - private: - const clang::CompilerInstance &ci_; - - clang::CXXRecordDecl *CreateCXXRecordDecl(const clang::DeclarationName &name, - clang::DeclContext *decl_context); - - clang::ClassTemplateDecl * - CreateClassTemplateDecl(clang::CXXRecordDecl *cxx_record_decl, - clang::DeclContext *decl_context); - - clang::NamespaceDecl *CreateNamespaceDecl(const clang::DeclarationName &name, - clang::DeclContext *decl_context); - - // This method creates a declaration in decl_context according to the lookup - // name kind and the declaration name kind. If this method doesn't support the - // kinds, it returns nullptr. - clang::NamedDecl *CreateDecl(clang::Sema::LookupNameKind kind, - const clang::DeclarationNameInfo &name, - clang::DeclContext *decl_context); - - // Return the DeclContext for CorrectTypo to create a declaration in. - clang::DeclContext *ResolveDeclContext(clang::DeclContext *member_context, - clang::Scope *scope, - clang::NestedNameSpecifier *nns); - - public: - FakeDeclSource(const clang::CompilerInstance &ci); - - clang::TypoCorrection - CorrectTypo(const clang::DeclarationNameInfo &typo, int lookup_kind, - clang::Scope *scope, clang::CXXScopeSpec *scope_spec, - clang::CorrectionCandidateCallback &ccc, - clang::DeclContext *member_context, bool entering_context, - const clang::ObjCObjectPointerType *opt) override; - - bool LookupUnqualified(clang::LookupResult &result, - clang::Scope *scope) override; -}; - - -} // namespace dumper -} // namespace header_checker - - -#endif // HEADER_CHECKER_ABI_DUMPER_FAKE_DECL_SOURCE_H_ diff --git a/vndk/tools/header-checker/src/dumper/frontend_action.cpp b/vndk/tools/header-checker/src/dumper/frontend_action.cpp index b4d6ebfa9..dfc537d9d 100644 --- a/vndk/tools/header-checker/src/dumper/frontend_action.cpp +++ b/vndk/tools/header-checker/src/dumper/frontend_action.cpp @@ -15,14 +15,11 @@ #include "dumper/frontend_action.h" #include "dumper/ast_processing.h" -#include "dumper/diagnostic_consumer.h" -#include "dumper/fake_decl_source.h" -#include "repr/ir_representation.h" -#include "utils/header_abi_util.h" #include +// FIXME: ASTFrontendAction depends on DenseMapInfo. +#include #include -#include #include @@ -42,26 +39,6 @@ HeaderCheckerFrontendAction::CreateASTConsumer(clang::CompilerInstance &ci, return std::make_unique(&ci, options_); } -bool HeaderCheckerFrontendAction::BeginInvocation(clang::CompilerInstance &ci) { - if (options_.suppress_errors_) { - ci.getFrontendOpts().SkipFunctionBodies = true; - clang::DiagnosticsEngine &diagnostics = ci.getDiagnostics(); - diagnostics.setClient( - new HeaderCheckerDiagnosticConsumer(diagnostics.takeClient()), - /* ShouldOwnClient */ true); - } - return true; -} - -bool HeaderCheckerFrontendAction::BeginSourceFileAction( - clang::CompilerInstance &ci) { - if (options_.suppress_errors_) { - ci.setExternalSemaSource(new FakeDeclSource(ci)); - ci.getPreprocessor().SetSuppressIncludeNotFoundError(true); - } - return true; -} - } // dumper } // header_checker diff --git a/vndk/tools/header-checker/src/dumper/frontend_action.h b/vndk/tools/header-checker/src/dumper/frontend_action.h index ad82850eb..d6e5f8ac4 100644 --- a/vndk/tools/header-checker/src/dumper/frontend_action.h +++ b/vndk/tools/header-checker/src/dumper/frontend_action.h @@ -20,11 +20,6 @@ #include #include -#include -#include -#include -#include - namespace clang { class ASTConsumer; @@ -46,9 +41,6 @@ class HeaderCheckerFrontendAction : public clang::ASTFrontendAction { protected: std::unique_ptr CreateASTConsumer( clang::CompilerInstance &ci, llvm::StringRef header_file) override; - - bool BeginInvocation(clang::CompilerInstance &ci) override; - bool BeginSourceFileAction(clang::CompilerInstance &ci) override; }; diff --git a/vndk/tools/header-checker/src/dumper/header_checker.cpp b/vndk/tools/header-checker/src/dumper/header_checker.cpp index 209aebb5f..6b755df24 100644 --- a/vndk/tools/header-checker/src/dumper/header_checker.cpp +++ b/vndk/tools/header-checker/src/dumper/header_checker.cpp @@ -77,11 +77,6 @@ static llvm::cl::opt no_filter( "no-filter", llvm::cl::desc("Do not filter any abi"), llvm::cl::Optional, llvm::cl::cat(header_checker_category)); -static llvm::cl::opt suppress_errors( - "suppress-errors", - llvm::cl::desc("Suppress preprocess and semantic errors"), - llvm::cl::Optional, llvm::cl::cat(header_checker_category)); - static llvm::cl::opt dump_function_declarations( "dump-function-declarations", llvm::cl::desc("Output the functions declared but not defined in the input " @@ -184,10 +179,10 @@ int main(int argc, const char **argv) { // Initialize clang tools and run front-end action. std::vector header_files{ header_file }; - HeaderCheckerOptions options( - NormalizePath(header_file, parsed_root_dirs), out_dump, - std::move(exported_headers), std::move(parsed_root_dirs), output_format, - dump_exported_only, dump_function_declarations, suppress_errors); + HeaderCheckerOptions options(NormalizePath(header_file, parsed_root_dirs), + out_dump, std::move(exported_headers), + std::move(parsed_root_dirs), output_format, + dump_exported_only, dump_function_declarations); clang::tooling::ClangTool tool(*compilations, header_files); std::unique_ptr factory( diff --git a/vndk/tools/header-checker/src/dumper/header_checker.h b/vndk/tools/header-checker/src/dumper/header_checker.h index 7a7506de7..c7b017e6c 100644 --- a/vndk/tools/header-checker/src/dumper/header_checker.h +++ b/vndk/tools/header-checker/src/dumper/header_checker.h @@ -35,20 +35,20 @@ class HeaderCheckerOptions { repr::TextFormatIR text_format_; const bool dump_exported_only_; bool dump_function_declarations_; - bool suppress_errors_; public: HeaderCheckerOptions(std::string source_file, std::string dump_name, std::set exported_headers, utils::RootDirs root_dirs, repr::TextFormatIR text_format, bool dump_exported_only, - bool dump_function_declarations, bool suppress_errors) - : source_file_(std::move(source_file)), dump_name_(std::move(dump_name)), + bool dump_function_declarations) + : source_file_(std::move(source_file)), + dump_name_(std::move(dump_name)), exported_headers_(std::move(exported_headers)), - root_dirs_(std::move(root_dirs)), text_format_(text_format), + root_dirs_(std::move(root_dirs)), + text_format_(text_format), dump_exported_only_(dump_exported_only), - dump_function_declarations_(dump_function_declarations), - suppress_errors_(suppress_errors) {} + dump_function_declarations_(dump_function_declarations) {} }; diff --git a/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h b/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h deleted file mode 100644 index 6aaec0f1e..000000000 --- a/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef KNOWN_ISSUES_H_ -#define KNOWN_ISSUES_H_ - -// header-abi-dumper is unable to output the following types correctly. - -// template struct NonTypeTemplate; -extern NonTypeTemplate<1> non_type_template; - -// namespace namespace1{ -// template class UsingTemplate; -// } -using namespace1::UsingTemplate; -extern UsingTemplate *using_template; - -// #define STDCALL __stdcall -STDCALL return_type function_with_calling_convention(); - -// class ClassInNameSpace; -template class ClassTemplate; -extern ClassTemplate<::ClassInNameSpace> template_arg_in_namespace; - -#endif // KNOWN_ISSUES_H_ diff --git a/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h b/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h deleted file mode 100644 index 30a11bde8..000000000 --- a/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef UNDECLARED_TYPES_H_ -#define UNDECLARED_TYPES_H_ - -using ::namespace_a::A; -typedef const namespace_b::B *B; -using C = namespace_c::C[]; - -extern A a; -extern namespace_b::template_b b; -extern const decltype(b) c; - -inline A &inline_function(template_c> d) { - LocalVar e; - return FunctionCall(d, e); -} - -class InvalidClass { - A member; - - D member_function(E); - virtual void virtual_function(float); -}; - -#define DECLARE_VARIABLE extern TemplateInMacro *template_in_macro -DECLARE_VARIABLE; - -#endif // UNDECLARED_TYPES_H_ diff --git a/vndk/tools/header-checker/tests/module.py b/vndk/tools/header-checker/tests/module.py index d97585c4d..9890fb8da 100755 --- a/vndk/tools/header-checker/tests/module.py +++ b/vndk/tools/header-checker/tests/module.py @@ -145,16 +145,6 @@ class LsdumpModule(Module): TEST_MODULES = [ - SdumpModule( - name='undeclared_types.h', - src='integration/cpp/header/undeclared_types.h', - arch='', - dumper_flags=['-suppress-errors', '-output-format', 'Json']), - SdumpModule( - name='known_issues.h', - src='integration/cpp/header/known_issues.h', - arch='', - dumper_flags=['-suppress-errors', '-output-format', 'Json']), LsdumpModule( name='libc_and_cpp', srcs=[ diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/known_issues.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/arm/known_issues.h.sdump deleted file mode 100644 index 791811d65..000000000 --- a/vndk/tools/header-checker/tests/reference_dumps/arm/known_issues.h.sdump +++ /dev/null @@ -1,46 +0,0 @@ -{ - "array_types" : [], - "builtin_types" : - [ - { - "alignment" : 4, - "is_integral" : true, - "linker_set_key" : "_ZTIi", - "name" : "int", - "referenced_type" : "_ZTIi", - "self_type" : "_ZTIi", - "size" : 4 - } - ], - "elf_functions" : [], - "elf_objects" : [], - "enum_types" : [], - "function_types" : [], - "functions" : [], - "global_vars" : - [ - { - "linker_set_key" : "non_type_template", - "name" : "non_type_template", - "referenced_type" : "_ZTIi", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h" - }, - { - "linker_set_key" : "return_type", - "name" : "return_type", - "referenced_type" : "_ZTI7STDCALL", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h" - }, - { - "linker_set_key" : "template_arg_in_namespace", - "name" : "template_arg_in_namespace", - "referenced_type" : "_ZTIi", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h" - } - ], - "lvalue_reference_types" : [], - "pointer_types" : [], - "qualified_types" : [], - "record_types" : [], - "rvalue_reference_types" : [] -} diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/undeclared_types.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/arm/undeclared_types.h.sdump deleted file mode 100644 index b68d6657f..000000000 --- a/vndk/tools/header-checker/tests/reference_dumps/arm/undeclared_types.h.sdump +++ /dev/null @@ -1,113 +0,0 @@ -{ - "array_types" : [], - "builtin_types" : [], - "elf_functions" : [], - "elf_objects" : [], - "enum_types" : [], - "function_types" : [], - "functions" : - [ - { - "function_name" : "inline_function", - "linker_set_key" : "_Z15inline_function10template_cIJ10template_dIJA_N11namespace_c1CEEEEE", - "parameters" : - [ - { - "referenced_type" : "_ZTI10template_cIJ10template_dIJA_N11namespace_c1CEEEEE" - } - ], - "return_type" : "_ZTIRN11namespace_a1AE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "access" : "private", - "function_name" : "InvalidClass::member_function", - "linker_set_key" : "_ZN12InvalidClass15member_functionE1E", - "parameters" : - [ - { - "is_this_ptr" : true, - "referenced_type" : "_ZTIP12InvalidClass" - }, - { - "referenced_type" : "_ZTI1E" - } - ], - "return_type" : "_ZTIN12InvalidClass1DE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "global_vars" : - [ - { - "linker_set_key" : "a", - "name" : "a", - "referenced_type" : "_ZTIN11namespace_a1AE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "linker_set_key" : "b", - "name" : "b", - "referenced_type" : "_ZTIN11namespace_b10template_bIJPKNS_1BEEEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "linker_set_key" : "c", - "name" : "c", - "referenced_type" : "_ZTIKN11namespace_b10template_bIJPKNS_1BEEEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "linker_set_key" : "template_in_macro", - "name" : "template_in_macro", - "referenced_type" : "_ZTIP15TemplateInMacroIJ1FEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "lvalue_reference_types" : - [ - { - "alignment" : 8, - "linker_set_key" : "_ZTIRN11namespace_a1AE", - "name" : "namespace_a::A &", - "referenced_type" : "_ZTIN11namespace_a1AE", - "self_type" : "_ZTIRN11namespace_a1AE", - "size" : 8, - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "pointer_types" : - [ - { - "alignment" : 8, - "linker_set_key" : "_ZTIP12InvalidClass", - "name" : "InvalidClass *", - "referenced_type" : "_ZTI12InvalidClass", - "self_type" : "_ZTIP12InvalidClass", - "size" : 8, - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "alignment" : 8, - "linker_set_key" : "_ZTIP15TemplateInMacroIJ1FEE", - "name" : "TemplateInMacro *", - "referenced_type" : "_ZTI15TemplateInMacroIJ1FEE", - "self_type" : "_ZTIP15TemplateInMacroIJ1FEE", - "size" : 8, - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "qualified_types" : - [ - { - "is_const" : true, - "linker_set_key" : "_ZTIKN11namespace_b10template_bIJPKNS_1BEEEE", - "name" : "const namespace_b::template_b", - "referenced_type" : "_ZTIN11namespace_b10template_bIJPKNS_1BEEEE", - "self_type" : "_ZTIKN11namespace_b10template_bIJPKNS_1BEEEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "record_types" : [], - "rvalue_reference_types" : [] -} diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/known_issues.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/known_issues.h.sdump deleted file mode 100644 index 791811d65..000000000 --- a/vndk/tools/header-checker/tests/reference_dumps/arm64/known_issues.h.sdump +++ /dev/null @@ -1,46 +0,0 @@ -{ - "array_types" : [], - "builtin_types" : - [ - { - "alignment" : 4, - "is_integral" : true, - "linker_set_key" : "_ZTIi", - "name" : "int", - "referenced_type" : "_ZTIi", - "self_type" : "_ZTIi", - "size" : 4 - } - ], - "elf_functions" : [], - "elf_objects" : [], - "enum_types" : [], - "function_types" : [], - "functions" : [], - "global_vars" : - [ - { - "linker_set_key" : "non_type_template", - "name" : "non_type_template", - "referenced_type" : "_ZTIi", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h" - }, - { - "linker_set_key" : "return_type", - "name" : "return_type", - "referenced_type" : "_ZTI7STDCALL", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h" - }, - { - "linker_set_key" : "template_arg_in_namespace", - "name" : "template_arg_in_namespace", - "referenced_type" : "_ZTIi", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h" - } - ], - "lvalue_reference_types" : [], - "pointer_types" : [], - "qualified_types" : [], - "record_types" : [], - "rvalue_reference_types" : [] -} diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/undeclared_types.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/undeclared_types.h.sdump deleted file mode 100644 index b68d6657f..000000000 --- a/vndk/tools/header-checker/tests/reference_dumps/arm64/undeclared_types.h.sdump +++ /dev/null @@ -1,113 +0,0 @@ -{ - "array_types" : [], - "builtin_types" : [], - "elf_functions" : [], - "elf_objects" : [], - "enum_types" : [], - "function_types" : [], - "functions" : - [ - { - "function_name" : "inline_function", - "linker_set_key" : "_Z15inline_function10template_cIJ10template_dIJA_N11namespace_c1CEEEEE", - "parameters" : - [ - { - "referenced_type" : "_ZTI10template_cIJ10template_dIJA_N11namespace_c1CEEEEE" - } - ], - "return_type" : "_ZTIRN11namespace_a1AE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "access" : "private", - "function_name" : "InvalidClass::member_function", - "linker_set_key" : "_ZN12InvalidClass15member_functionE1E", - "parameters" : - [ - { - "is_this_ptr" : true, - "referenced_type" : "_ZTIP12InvalidClass" - }, - { - "referenced_type" : "_ZTI1E" - } - ], - "return_type" : "_ZTIN12InvalidClass1DE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "global_vars" : - [ - { - "linker_set_key" : "a", - "name" : "a", - "referenced_type" : "_ZTIN11namespace_a1AE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "linker_set_key" : "b", - "name" : "b", - "referenced_type" : "_ZTIN11namespace_b10template_bIJPKNS_1BEEEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "linker_set_key" : "c", - "name" : "c", - "referenced_type" : "_ZTIKN11namespace_b10template_bIJPKNS_1BEEEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "linker_set_key" : "template_in_macro", - "name" : "template_in_macro", - "referenced_type" : "_ZTIP15TemplateInMacroIJ1FEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "lvalue_reference_types" : - [ - { - "alignment" : 8, - "linker_set_key" : "_ZTIRN11namespace_a1AE", - "name" : "namespace_a::A &", - "referenced_type" : "_ZTIN11namespace_a1AE", - "self_type" : "_ZTIRN11namespace_a1AE", - "size" : 8, - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "pointer_types" : - [ - { - "alignment" : 8, - "linker_set_key" : "_ZTIP12InvalidClass", - "name" : "InvalidClass *", - "referenced_type" : "_ZTI12InvalidClass", - "self_type" : "_ZTIP12InvalidClass", - "size" : 8, - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "alignment" : 8, - "linker_set_key" : "_ZTIP15TemplateInMacroIJ1FEE", - "name" : "TemplateInMacro *", - "referenced_type" : "_ZTI15TemplateInMacroIJ1FEE", - "self_type" : "_ZTIP15TemplateInMacroIJ1FEE", - "size" : 8, - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "qualified_types" : - [ - { - "is_const" : true, - "linker_set_key" : "_ZTIKN11namespace_b10template_bIJPKNS_1BEEEE", - "name" : "const namespace_b::template_b", - "referenced_type" : "_ZTIN11namespace_b10template_bIJPKNS_1BEEEE", - "self_type" : "_ZTIKN11namespace_b10template_bIJPKNS_1BEEEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "record_types" : [], - "rvalue_reference_types" : [] -} diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/known_issues.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/mips/known_issues.h.sdump deleted file mode 100644 index 791811d65..000000000 --- a/vndk/tools/header-checker/tests/reference_dumps/mips/known_issues.h.sdump +++ /dev/null @@ -1,46 +0,0 @@ -{ - "array_types" : [], - "builtin_types" : - [ - { - "alignment" : 4, - "is_integral" : true, - "linker_set_key" : "_ZTIi", - "name" : "int", - "referenced_type" : "_ZTIi", - "self_type" : "_ZTIi", - "size" : 4 - } - ], - "elf_functions" : [], - "elf_objects" : [], - "enum_types" : [], - "function_types" : [], - "functions" : [], - "global_vars" : - [ - { - "linker_set_key" : "non_type_template", - "name" : "non_type_template", - "referenced_type" : "_ZTIi", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h" - }, - { - "linker_set_key" : "return_type", - "name" : "return_type", - "referenced_type" : "_ZTI7STDCALL", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h" - }, - { - "linker_set_key" : "template_arg_in_namespace", - "name" : "template_arg_in_namespace", - "referenced_type" : "_ZTIi", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h" - } - ], - "lvalue_reference_types" : [], - "pointer_types" : [], - "qualified_types" : [], - "record_types" : [], - "rvalue_reference_types" : [] -} diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/undeclared_types.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/mips/undeclared_types.h.sdump deleted file mode 100644 index b68d6657f..000000000 --- a/vndk/tools/header-checker/tests/reference_dumps/mips/undeclared_types.h.sdump +++ /dev/null @@ -1,113 +0,0 @@ -{ - "array_types" : [], - "builtin_types" : [], - "elf_functions" : [], - "elf_objects" : [], - "enum_types" : [], - "function_types" : [], - "functions" : - [ - { - "function_name" : "inline_function", - "linker_set_key" : "_Z15inline_function10template_cIJ10template_dIJA_N11namespace_c1CEEEEE", - "parameters" : - [ - { - "referenced_type" : "_ZTI10template_cIJ10template_dIJA_N11namespace_c1CEEEEE" - } - ], - "return_type" : "_ZTIRN11namespace_a1AE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "access" : "private", - "function_name" : "InvalidClass::member_function", - "linker_set_key" : "_ZN12InvalidClass15member_functionE1E", - "parameters" : - [ - { - "is_this_ptr" : true, - "referenced_type" : "_ZTIP12InvalidClass" - }, - { - "referenced_type" : "_ZTI1E" - } - ], - "return_type" : "_ZTIN12InvalidClass1DE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "global_vars" : - [ - { - "linker_set_key" : "a", - "name" : "a", - "referenced_type" : "_ZTIN11namespace_a1AE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "linker_set_key" : "b", - "name" : "b", - "referenced_type" : "_ZTIN11namespace_b10template_bIJPKNS_1BEEEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "linker_set_key" : "c", - "name" : "c", - "referenced_type" : "_ZTIKN11namespace_b10template_bIJPKNS_1BEEEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "linker_set_key" : "template_in_macro", - "name" : "template_in_macro", - "referenced_type" : "_ZTIP15TemplateInMacroIJ1FEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "lvalue_reference_types" : - [ - { - "alignment" : 8, - "linker_set_key" : "_ZTIRN11namespace_a1AE", - "name" : "namespace_a::A &", - "referenced_type" : "_ZTIN11namespace_a1AE", - "self_type" : "_ZTIRN11namespace_a1AE", - "size" : 8, - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "pointer_types" : - [ - { - "alignment" : 8, - "linker_set_key" : "_ZTIP12InvalidClass", - "name" : "InvalidClass *", - "referenced_type" : "_ZTI12InvalidClass", - "self_type" : "_ZTIP12InvalidClass", - "size" : 8, - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "alignment" : 8, - "linker_set_key" : "_ZTIP15TemplateInMacroIJ1FEE", - "name" : "TemplateInMacro *", - "referenced_type" : "_ZTI15TemplateInMacroIJ1FEE", - "self_type" : "_ZTIP15TemplateInMacroIJ1FEE", - "size" : 8, - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "qualified_types" : - [ - { - "is_const" : true, - "linker_set_key" : "_ZTIKN11namespace_b10template_bIJPKNS_1BEEEE", - "name" : "const namespace_b::template_b", - "referenced_type" : "_ZTIN11namespace_b10template_bIJPKNS_1BEEEE", - "self_type" : "_ZTIKN11namespace_b10template_bIJPKNS_1BEEEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "record_types" : [], - "rvalue_reference_types" : [] -} diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/known_issues.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/known_issues.h.sdump deleted file mode 100644 index 791811d65..000000000 --- a/vndk/tools/header-checker/tests/reference_dumps/mips64/known_issues.h.sdump +++ /dev/null @@ -1,46 +0,0 @@ -{ - "array_types" : [], - "builtin_types" : - [ - { - "alignment" : 4, - "is_integral" : true, - "linker_set_key" : "_ZTIi", - "name" : "int", - "referenced_type" : "_ZTIi", - "self_type" : "_ZTIi", - "size" : 4 - } - ], - "elf_functions" : [], - "elf_objects" : [], - "enum_types" : [], - "function_types" : [], - "functions" : [], - "global_vars" : - [ - { - "linker_set_key" : "non_type_template", - "name" : "non_type_template", - "referenced_type" : "_ZTIi", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h" - }, - { - "linker_set_key" : "return_type", - "name" : "return_type", - "referenced_type" : "_ZTI7STDCALL", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h" - }, - { - "linker_set_key" : "template_arg_in_namespace", - "name" : "template_arg_in_namespace", - "referenced_type" : "_ZTIi", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h" - } - ], - "lvalue_reference_types" : [], - "pointer_types" : [], - "qualified_types" : [], - "record_types" : [], - "rvalue_reference_types" : [] -} diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/undeclared_types.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/undeclared_types.h.sdump deleted file mode 100644 index b68d6657f..000000000 --- a/vndk/tools/header-checker/tests/reference_dumps/mips64/undeclared_types.h.sdump +++ /dev/null @@ -1,113 +0,0 @@ -{ - "array_types" : [], - "builtin_types" : [], - "elf_functions" : [], - "elf_objects" : [], - "enum_types" : [], - "function_types" : [], - "functions" : - [ - { - "function_name" : "inline_function", - "linker_set_key" : "_Z15inline_function10template_cIJ10template_dIJA_N11namespace_c1CEEEEE", - "parameters" : - [ - { - "referenced_type" : "_ZTI10template_cIJ10template_dIJA_N11namespace_c1CEEEEE" - } - ], - "return_type" : "_ZTIRN11namespace_a1AE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "access" : "private", - "function_name" : "InvalidClass::member_function", - "linker_set_key" : "_ZN12InvalidClass15member_functionE1E", - "parameters" : - [ - { - "is_this_ptr" : true, - "referenced_type" : "_ZTIP12InvalidClass" - }, - { - "referenced_type" : "_ZTI1E" - } - ], - "return_type" : "_ZTIN12InvalidClass1DE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "global_vars" : - [ - { - "linker_set_key" : "a", - "name" : "a", - "referenced_type" : "_ZTIN11namespace_a1AE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "linker_set_key" : "b", - "name" : "b", - "referenced_type" : "_ZTIN11namespace_b10template_bIJPKNS_1BEEEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "linker_set_key" : "c", - "name" : "c", - "referenced_type" : "_ZTIKN11namespace_b10template_bIJPKNS_1BEEEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "linker_set_key" : "template_in_macro", - "name" : "template_in_macro", - "referenced_type" : "_ZTIP15TemplateInMacroIJ1FEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "lvalue_reference_types" : - [ - { - "alignment" : 8, - "linker_set_key" : "_ZTIRN11namespace_a1AE", - "name" : "namespace_a::A &", - "referenced_type" : "_ZTIN11namespace_a1AE", - "self_type" : "_ZTIRN11namespace_a1AE", - "size" : 8, - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "pointer_types" : - [ - { - "alignment" : 8, - "linker_set_key" : "_ZTIP12InvalidClass", - "name" : "InvalidClass *", - "referenced_type" : "_ZTI12InvalidClass", - "self_type" : "_ZTIP12InvalidClass", - "size" : 8, - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "alignment" : 8, - "linker_set_key" : "_ZTIP15TemplateInMacroIJ1FEE", - "name" : "TemplateInMacro *", - "referenced_type" : "_ZTI15TemplateInMacroIJ1FEE", - "self_type" : "_ZTIP15TemplateInMacroIJ1FEE", - "size" : 8, - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "qualified_types" : - [ - { - "is_const" : true, - "linker_set_key" : "_ZTIKN11namespace_b10template_bIJPKNS_1BEEEE", - "name" : "const namespace_b::template_b", - "referenced_type" : "_ZTIN11namespace_b10template_bIJPKNS_1BEEEE", - "self_type" : "_ZTIKN11namespace_b10template_bIJPKNS_1BEEEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "record_types" : [], - "rvalue_reference_types" : [] -} diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/known_issues.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/x86/known_issues.h.sdump deleted file mode 100644 index 791811d65..000000000 --- a/vndk/tools/header-checker/tests/reference_dumps/x86/known_issues.h.sdump +++ /dev/null @@ -1,46 +0,0 @@ -{ - "array_types" : [], - "builtin_types" : - [ - { - "alignment" : 4, - "is_integral" : true, - "linker_set_key" : "_ZTIi", - "name" : "int", - "referenced_type" : "_ZTIi", - "self_type" : "_ZTIi", - "size" : 4 - } - ], - "elf_functions" : [], - "elf_objects" : [], - "enum_types" : [], - "function_types" : [], - "functions" : [], - "global_vars" : - [ - { - "linker_set_key" : "non_type_template", - "name" : "non_type_template", - "referenced_type" : "_ZTIi", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h" - }, - { - "linker_set_key" : "return_type", - "name" : "return_type", - "referenced_type" : "_ZTI7STDCALL", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h" - }, - { - "linker_set_key" : "template_arg_in_namespace", - "name" : "template_arg_in_namespace", - "referenced_type" : "_ZTIi", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h" - } - ], - "lvalue_reference_types" : [], - "pointer_types" : [], - "qualified_types" : [], - "record_types" : [], - "rvalue_reference_types" : [] -} diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/undeclared_types.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/x86/undeclared_types.h.sdump deleted file mode 100644 index b68d6657f..000000000 --- a/vndk/tools/header-checker/tests/reference_dumps/x86/undeclared_types.h.sdump +++ /dev/null @@ -1,113 +0,0 @@ -{ - "array_types" : [], - "builtin_types" : [], - "elf_functions" : [], - "elf_objects" : [], - "enum_types" : [], - "function_types" : [], - "functions" : - [ - { - "function_name" : "inline_function", - "linker_set_key" : "_Z15inline_function10template_cIJ10template_dIJA_N11namespace_c1CEEEEE", - "parameters" : - [ - { - "referenced_type" : "_ZTI10template_cIJ10template_dIJA_N11namespace_c1CEEEEE" - } - ], - "return_type" : "_ZTIRN11namespace_a1AE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "access" : "private", - "function_name" : "InvalidClass::member_function", - "linker_set_key" : "_ZN12InvalidClass15member_functionE1E", - "parameters" : - [ - { - "is_this_ptr" : true, - "referenced_type" : "_ZTIP12InvalidClass" - }, - { - "referenced_type" : "_ZTI1E" - } - ], - "return_type" : "_ZTIN12InvalidClass1DE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "global_vars" : - [ - { - "linker_set_key" : "a", - "name" : "a", - "referenced_type" : "_ZTIN11namespace_a1AE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "linker_set_key" : "b", - "name" : "b", - "referenced_type" : "_ZTIN11namespace_b10template_bIJPKNS_1BEEEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "linker_set_key" : "c", - "name" : "c", - "referenced_type" : "_ZTIKN11namespace_b10template_bIJPKNS_1BEEEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "linker_set_key" : "template_in_macro", - "name" : "template_in_macro", - "referenced_type" : "_ZTIP15TemplateInMacroIJ1FEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "lvalue_reference_types" : - [ - { - "alignment" : 8, - "linker_set_key" : "_ZTIRN11namespace_a1AE", - "name" : "namespace_a::A &", - "referenced_type" : "_ZTIN11namespace_a1AE", - "self_type" : "_ZTIRN11namespace_a1AE", - "size" : 8, - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "pointer_types" : - [ - { - "alignment" : 8, - "linker_set_key" : "_ZTIP12InvalidClass", - "name" : "InvalidClass *", - "referenced_type" : "_ZTI12InvalidClass", - "self_type" : "_ZTIP12InvalidClass", - "size" : 8, - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "alignment" : 8, - "linker_set_key" : "_ZTIP15TemplateInMacroIJ1FEE", - "name" : "TemplateInMacro *", - "referenced_type" : "_ZTI15TemplateInMacroIJ1FEE", - "self_type" : "_ZTIP15TemplateInMacroIJ1FEE", - "size" : 8, - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "qualified_types" : - [ - { - "is_const" : true, - "linker_set_key" : "_ZTIKN11namespace_b10template_bIJPKNS_1BEEEE", - "name" : "const namespace_b::template_b", - "referenced_type" : "_ZTIN11namespace_b10template_bIJPKNS_1BEEEE", - "self_type" : "_ZTIKN11namespace_b10template_bIJPKNS_1BEEEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "record_types" : [], - "rvalue_reference_types" : [] -} diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/known_issues.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/known_issues.h.sdump deleted file mode 100644 index 791811d65..000000000 --- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/known_issues.h.sdump +++ /dev/null @@ -1,46 +0,0 @@ -{ - "array_types" : [], - "builtin_types" : - [ - { - "alignment" : 4, - "is_integral" : true, - "linker_set_key" : "_ZTIi", - "name" : "int", - "referenced_type" : "_ZTIi", - "self_type" : "_ZTIi", - "size" : 4 - } - ], - "elf_functions" : [], - "elf_objects" : [], - "enum_types" : [], - "function_types" : [], - "functions" : [], - "global_vars" : - [ - { - "linker_set_key" : "non_type_template", - "name" : "non_type_template", - "referenced_type" : "_ZTIi", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h" - }, - { - "linker_set_key" : "return_type", - "name" : "return_type", - "referenced_type" : "_ZTI7STDCALL", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h" - }, - { - "linker_set_key" : "template_arg_in_namespace", - "name" : "template_arg_in_namespace", - "referenced_type" : "_ZTIi", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h" - } - ], - "lvalue_reference_types" : [], - "pointer_types" : [], - "qualified_types" : [], - "record_types" : [], - "rvalue_reference_types" : [] -} diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/undeclared_types.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/undeclared_types.h.sdump deleted file mode 100644 index b68d6657f..000000000 --- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/undeclared_types.h.sdump +++ /dev/null @@ -1,113 +0,0 @@ -{ - "array_types" : [], - "builtin_types" : [], - "elf_functions" : [], - "elf_objects" : [], - "enum_types" : [], - "function_types" : [], - "functions" : - [ - { - "function_name" : "inline_function", - "linker_set_key" : "_Z15inline_function10template_cIJ10template_dIJA_N11namespace_c1CEEEEE", - "parameters" : - [ - { - "referenced_type" : "_ZTI10template_cIJ10template_dIJA_N11namespace_c1CEEEEE" - } - ], - "return_type" : "_ZTIRN11namespace_a1AE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "access" : "private", - "function_name" : "InvalidClass::member_function", - "linker_set_key" : "_ZN12InvalidClass15member_functionE1E", - "parameters" : - [ - { - "is_this_ptr" : true, - "referenced_type" : "_ZTIP12InvalidClass" - }, - { - "referenced_type" : "_ZTI1E" - } - ], - "return_type" : "_ZTIN12InvalidClass1DE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "global_vars" : - [ - { - "linker_set_key" : "a", - "name" : "a", - "referenced_type" : "_ZTIN11namespace_a1AE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "linker_set_key" : "b", - "name" : "b", - "referenced_type" : "_ZTIN11namespace_b10template_bIJPKNS_1BEEEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "linker_set_key" : "c", - "name" : "c", - "referenced_type" : "_ZTIKN11namespace_b10template_bIJPKNS_1BEEEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "linker_set_key" : "template_in_macro", - "name" : "template_in_macro", - "referenced_type" : "_ZTIP15TemplateInMacroIJ1FEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "lvalue_reference_types" : - [ - { - "alignment" : 8, - "linker_set_key" : "_ZTIRN11namespace_a1AE", - "name" : "namespace_a::A &", - "referenced_type" : "_ZTIN11namespace_a1AE", - "self_type" : "_ZTIRN11namespace_a1AE", - "size" : 8, - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "pointer_types" : - [ - { - "alignment" : 8, - "linker_set_key" : "_ZTIP12InvalidClass", - "name" : "InvalidClass *", - "referenced_type" : "_ZTI12InvalidClass", - "self_type" : "_ZTIP12InvalidClass", - "size" : 8, - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - }, - { - "alignment" : 8, - "linker_set_key" : "_ZTIP15TemplateInMacroIJ1FEE", - "name" : "TemplateInMacro *", - "referenced_type" : "_ZTI15TemplateInMacroIJ1FEE", - "self_type" : "_ZTIP15TemplateInMacroIJ1FEE", - "size" : 8, - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "qualified_types" : - [ - { - "is_const" : true, - "linker_set_key" : "_ZTIKN11namespace_b10template_bIJPKNS_1BEEEE", - "name" : "const namespace_b::template_b", - "referenced_type" : "_ZTIN11namespace_b10template_bIJPKNS_1BEEEE", - "self_type" : "_ZTIKN11namespace_b10template_bIJPKNS_1BEEEE", - "source_file" : "development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h" - } - ], - "record_types" : [], - "rvalue_reference_types" : [] -} diff --git a/vndk/tools/header-checker/tests/test.py b/vndk/tools/header-checker/tests/test.py index f4718843b..238e801df 100755 --- a/vndk/tools/header-checker/tests/test.py +++ b/vndk/tools/header-checker/tests/test.py @@ -133,14 +133,6 @@ class HeaderCheckerTest(unittest.TestCase): def test_example3_h(self): self.run_and_compare_name_cpp('example3.h') - def test_undeclared_types_h(self): - self.prepare_and_absolute_diff_all_archs( - 'undeclared_types.h', 'undeclared_types.h') - - def test_known_issues_h(self): - self.prepare_and_absolute_diff_all_archs( - 'known_issues.h', 'known_issues.h') - def test_libc_and_cpp(self): self.prepare_and_run_abi_diff_all_archs( "libc_and_cpp", "libc_and_cpp", 0)