diff --git a/vndk/tools/header-checker/tests/expected/example1.h b/vndk/tools/header-checker/tests/expected/example1.h index 810159cbe..13ae403b8 100644 --- a/vndk/tools/header-checker/tests/expected/example1.h +++ b/vndk/tools/header-checker/tests/expected/example1.h @@ -201,10 +201,10 @@ record_types { name: "Hello::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:19:3)::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:22:5) at /development/vndk/tools/header-checker/tests/input/example1.h:22:5" size: 4 alignment: 4 - referenced_type: "type-22" + referenced_type: "type-24" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "Hello::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:19:3)::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:22:5) at /development/vndk/tools/header-checker/tests/input/example1.h:22:5" - self_type: "type-22" + self_type: "type-24" } fields { referenced_type: "type-2" @@ -224,10 +224,10 @@ record_types { name: "Hello::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:19:3) at /development/vndk/tools/header-checker/tests/input/example1.h:19:3" size: 12 alignment: 4 - referenced_type: "type-21" + referenced_type: "type-23" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "Hello::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:19:3) at /development/vndk/tools/header-checker/tests/input/example1.h:19:3" - self_type: "type-21" + self_type: "type-23" } fields { referenced_type: "type-2" @@ -242,7 +242,7 @@ record_types { access: public_access } fields { - referenced_type: "type-22" + referenced_type: "type-24" field_offset: 64 field_name: "" access: public_access @@ -259,10 +259,10 @@ record_types { name: "Hello" size: 32 alignment: 4 - referenced_type: "type-19" + referenced_type: "type-21" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "Hello" - self_type: "type-19" + self_type: "type-21" } fields { referenced_type: "type-2" @@ -277,7 +277,7 @@ record_types { access: public_access } fields { - referenced_type: "type-20" + referenced_type: "type-22" field_offset: 64 field_name: "d" access: public_access @@ -295,7 +295,7 @@ record_types { access: public_access } fields { - referenced_type: "type-21" + referenced_type: "type-23" field_offset: 160 field_name: "" access: public_access @@ -311,19 +311,19 @@ record_types { name: "CPPHello" size: 56 alignment: 8 - referenced_type: "type-23" + referenced_type: "type-25" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "CPPHello" - self_type: "type-23" + self_type: "type-25" } fields { - referenced_type: "type-24" + referenced_type: "type-26" field_offset: 352 field_name: "cpp_foo" access: public_access } fields { - referenced_type: "type-25" + referenced_type: "type-27" field_offset: 384 field_name: "cpp_bar" access: public_access @@ -381,13 +381,13 @@ record_types { name: "List" size: 8 alignment: 8 - referenced_type: "type-31" + referenced_type: "type-34" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "List" - self_type: "type-31" + self_type: "type-34" } fields { - referenced_type: "type-33" + referenced_type: "type-36" field_offset: 0 field_name: "middle" access: public_access @@ -408,10 +408,10 @@ record_types { name: "List::_Node" size: 24 alignment: 8 - referenced_type: "type-32" + referenced_type: "type-35" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "List::_Node" - self_type: "type-32" + self_type: "type-35" } fields { referenced_type: "type-3" @@ -420,13 +420,13 @@ record_types { access: private_access } fields { - referenced_type: "type-33" + referenced_type: "type-36" field_offset: 64 field_name: "mpPrev" access: private_access } fields { - referenced_type: "type-33" + referenced_type: "type-36" field_offset: 128 field_name: "mpNext" access: private_access @@ -442,13 +442,13 @@ record_types { name: "List" size: 8 alignment: 8 - referenced_type: "type-35" + referenced_type: "type-41" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "List" - self_type: "type-35" + self_type: "type-41" } fields { - referenced_type: "type-37" + referenced_type: "type-43" field_offset: 0 field_name: "middle" access: public_access @@ -517,10 +517,10 @@ enum_types { name: "CPPHello::Bla" size: 4 alignment: 4 - referenced_type: "type-27" + referenced_type: "type-29" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "CPPHello::Bla" - self_type: "type-27" + self_type: "type-29" } underlying_type: "type-9" enum_fields { @@ -543,15 +543,26 @@ pointer_types { self_type: "type-7" } } +pointer_types { + type_info { + name: "ForwardDeclaration *" + size: 8 + alignment: 8 + referenced_type: "type-19" + source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" + linker_set_key: "ForwardDeclaration *" + self_type: "type-20" + } +} pointer_types { type_info { name: "CPPHello *" size: 8 alignment: 8 - referenced_type: "type-23" + referenced_type: "type-25" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "CPPHello *" - self_type: "type-26" + self_type: "type-28" } } pointer_types { @@ -562,7 +573,7 @@ pointer_types { referenced_type: "type-2" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "int *" - self_type: "type-29" + self_type: "type-31" } } pointer_types { @@ -573,7 +584,7 @@ pointer_types { referenced_type: "type-3" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "float *" - self_type: "type-30" + self_type: "type-33" } } pointer_types { @@ -581,10 +592,21 @@ pointer_types { name: "List::_Node *" size: 8 alignment: 8 - referenced_type: "type-32" + referenced_type: "type-35" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "List::_Node *" - self_type: "type-33" + self_type: "type-36" + } +} +pointer_types { + type_info { + name: "const List::_Node *" + size: 8 + alignment: 8 + referenced_type: "type-39" + source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" + linker_set_key: "const List::_Node *" + self_type: "type-40" } } pointer_types { @@ -592,10 +614,32 @@ pointer_types { name: "List::_Node *" size: 8 alignment: 8 - referenced_type: "type-36" + referenced_type: "type-42" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "List::_Node *" - self_type: "type-37" + self_type: "type-43" + } +} +pointer_types { + type_info { + name: "List *" + size: 8 + alignment: 8 + referenced_type: "type-41" + source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" + linker_set_key: "List *" + self_type: "type-44" + } +} +pointer_types { + type_info { + name: "StackNode *" + size: 8 + alignment: 8 + referenced_type: "type-45" + source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" + linker_set_key: "StackNode *" + self_type: "type-46" } } pointer_types { @@ -603,10 +647,21 @@ pointer_types { name: "const char *" size: 8 alignment: 8 - referenced_type: "type-38" + referenced_type: "type-47" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "const char *" - self_type: "type-39" + self_type: "type-48" + } +} +lvalue_reference_types { + type_info { + name: "int &" + size: 8 + alignment: 8 + referenced_type: "type-2" + source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" + linker_set_key: "int &" + self_type: "type-30" } } lvalue_reference_types { @@ -614,10 +669,21 @@ lvalue_reference_types { name: "const float &" size: 8 alignment: 8 - referenced_type: "type-25" + referenced_type: "type-27" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "const float &" - self_type: "type-34" + self_type: "type-37" + } +} +lvalue_reference_types { + type_info { + name: "float &" + size: 8 + alignment: 8 + referenced_type: "type-3" + source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" + linker_set_key: "float &" + self_type: "type-38" } } builtin_types { @@ -703,10 +769,10 @@ builtin_types { name: "wchar_t" size: 4 alignment: 4 - referenced_type: "type-20" + referenced_type: "type-22" source_file: "" linker_set_key: "wchar_t" - self_type: "type-20" + self_type: "type-22" } is_unsigned: false is_integral: true @@ -716,10 +782,10 @@ builtin_types { name: "char" size: 1 alignment: 1 - referenced_type: "type-40" + referenced_type: "type-49" source_file: "" linker_set_key: "char" - self_type: "type-40" + self_type: "type-49" } is_unsigned: false is_integral: true @@ -746,7 +812,7 @@ qualified_types { referenced_type: "type-2" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "const int" - self_type: "type-24" + self_type: "type-26" } is_const: true is_volatile: false @@ -760,7 +826,7 @@ qualified_types { referenced_type: "type-3" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "const float" - self_type: "type-25" + self_type: "type-27" } is_const: true is_volatile: false @@ -771,10 +837,24 @@ qualified_types { name: "const CPPHello" size: 56 alignment: 8 - referenced_type: "type-23" + referenced_type: "type-25" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "const CPPHello" - self_type: "type-28" + self_type: "type-32" + } + is_const: true + is_volatile: false + is_restricted: false +} +qualified_types { + type_info { + name: "const List::_Node" + size: 24 + alignment: 8 + referenced_type: "type-35" + source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" + linker_set_key: "const List::_Node" + self_type: "type-39" } is_const: true is_volatile: false @@ -785,10 +865,10 @@ qualified_types { name: "const char" size: 1 alignment: 1 - referenced_type: "type-40" + referenced_type: "type-49" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "const char" - self_type: "type-38" + self_type: "type-47" } is_const: true is_volatile: false @@ -853,12 +933,24 @@ functions { linker_set_key: "_ZN5test33EndEf" access: public_access } +functions { + return_type: "type-2" + function_name: "uses_forward_decl" + source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" + parameters { + referenced_type: "type-20" + default_arg: false + is_this_ptr: false + } + linker_set_key: "uses_forward_decl" + access: public_access +} functions { return_type: "type-2" function_name: "CPPHello::again" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" parameters { - referenced_type: "type-26" + referenced_type: "type-28" default_arg: false is_this_ptr: true } @@ -870,7 +962,7 @@ functions { function_name: "CPPHello::CPPHello" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" parameters { - referenced_type: "type-26" + referenced_type: "type-28" default_arg: false is_this_ptr: true } @@ -882,7 +974,7 @@ functions { function_name: "CPPHello::CPPHello" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" parameters { - referenced_type: "type-26" + referenced_type: "type-28" default_arg: false is_this_ptr: true } @@ -894,29 +986,46 @@ functions { function_name: "CPPHello::test_enum" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" parameters { - referenced_type: "type-26" + referenced_type: "type-28" default_arg: false is_this_ptr: true } linker_set_key: "_ZN8CPPHello9test_enumEv" access: public_access } +functions { + return_type: "type-6" + function_name: "fooVariadic" + source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" + parameters { + referenced_type: "type-30" + default_arg: false + is_this_ptr: false + } + parameters { + referenced_type: "type-31" + default_arg: false + is_this_ptr: false + } + linker_set_key: "_Z11fooVariadicRiPiz" + access: public_access +} functions { return_type: "type-2" function_name: "boo" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" parameters { - referenced_type: "type-28" + referenced_type: "type-32" default_arg: false is_this_ptr: false } parameters { - referenced_type: "type-29" + referenced_type: "type-31" default_arg: false is_this_ptr: false } parameters { - referenced_type: "type-30" + referenced_type: "type-33" default_arg: false is_this_ptr: false } @@ -928,12 +1037,12 @@ functions { function_name: "List::_Node::_Node" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" parameters { - referenced_type: "type-33" + referenced_type: "type-36" default_arg: false is_this_ptr: true } parameters { - referenced_type: "type-34" + referenced_type: "type-37" default_arg: false is_this_ptr: false } @@ -945,12 +1054,12 @@ functions { function_name: "List::_Node::_Node" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" parameters { - referenced_type: "type-33" + referenced_type: "type-36" default_arg: false is_this_ptr: true } parameters { - referenced_type: "type-34" + referenced_type: "type-37" default_arg: false is_this_ptr: false } @@ -962,7 +1071,7 @@ functions { function_name: "List::_Node::~_Node" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" parameters { - referenced_type: "type-33" + referenced_type: "type-36" default_arg: false is_this_ptr: true } @@ -974,7 +1083,7 @@ functions { function_name: "List::_Node::~_Node" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" parameters { - referenced_type: "type-33" + referenced_type: "type-36" default_arg: false is_this_ptr: true } @@ -982,16 +1091,69 @@ functions { access: public_access } functions { - return_type: "type-31" - function_name: "castInterface" + return_type: "type-38" + function_name: "List::_Node::getRef" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" parameters { - referenced_type: "type-31" + referenced_type: "type-36" + default_arg: false + is_this_ptr: true + } + linker_set_key: "_ZN4ListIfE5_Node6getRefEv" + access: public_access +} +functions { + return_type: "type-37" + function_name: "List::_Node::getRef" + source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" + parameters { + referenced_type: "type-40" + default_arg: false + is_this_ptr: true + } + linker_set_key: "_ZNK4ListIfE5_Node6getRefEv" + access: public_access +} +functions { + return_type: "type-6" + function_name: "List::_Node::PrivateNode" + source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" + parameters { + referenced_type: "type-36" + default_arg: false + is_this_ptr: true + } + linker_set_key: "_ZN4ListIfE5_Node11PrivateNodeEv" + access: private_access +} +functions { + return_type: "type-2" + function_name: "ListMangle" + source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" + parameters { + referenced_type: "type-44" default_arg: false is_this_ptr: false } parameters { - referenced_type: "type-39" + referenced_type: "type-46" + default_arg: false + is_this_ptr: false + } + linker_set_key: "_Z10ListMangleP4ListIiEP9StackNodeIiE" + access: public_access +} +functions { + return_type: "type-34" + function_name: "castInterface" + source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" + parameters { + referenced_type: "type-34" + default_arg: false + is_this_ptr: false + } + parameters { + referenced_type: "type-48" default_arg: false is_this_ptr: false } @@ -1056,20 +1218,20 @@ global_vars { name: "float_list_test" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "float_list_test" - referenced_type: "type-31" + referenced_type: "type-34" access: public_access } global_vars { name: "int_list_test" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "int_list_test" - referenced_type: "type-35" + referenced_type: "type-41" access: public_access } global_vars { name: "node" source_file: "/development/vndk/tools/header-checker/tests/input/example1.h" linker_set_key: "node" - referenced_type: "type-32" + referenced_type: "type-35" access: public_access } diff --git a/vndk/tools/header-checker/tests/expected/example2.h b/vndk/tools/header-checker/tests/expected/example2.h index 3a46a95fe..316441c18 100644 --- a/vndk/tools/header-checker/tests/expected/example2.h +++ b/vndk/tools/header-checker/tests/expected/example2.h @@ -124,10 +124,10 @@ record_types { name: "test3::ByeAgain" size: 8 alignment: 4 - referenced_type: "type-15" + referenced_type: "type-16" source_file: "/development/vndk/tools/header-checker/tests/input/example2.h" linker_set_key: "test3::ByeAgain" - self_type: "type-15" + self_type: "type-16" } fields { referenced_type: "type-3" @@ -157,10 +157,10 @@ record_types { name: "test3::Outer" size: 4 alignment: 4 - referenced_type: "type-17" + referenced_type: "type-19" source_file: "/development/vndk/tools/header-checker/tests/input/example2.h" linker_set_key: "test3::Outer" - self_type: "type-17" + self_type: "type-19" } fields { referenced_type: "type-2" @@ -179,10 +179,10 @@ record_types { name: "test3::Outer::Inner" size: 4 alignment: 4 - referenced_type: "type-18" + referenced_type: "type-20" source_file: "/development/vndk/tools/header-checker/tests/input/example2.h" linker_set_key: "test3::Outer::Inner" - self_type: "type-18" + self_type: "type-20" } fields { referenced_type: "type-2" @@ -225,10 +225,10 @@ enum_types { name: "test3::Kind" size: 4 alignment: 4 - referenced_type: "type-16" + referenced_type: "type-18" source_file: "/development/vndk/tools/header-checker/tests/input/example2.h" linker_set_key: "test3::Kind" - self_type: "type-16" + self_type: "type-18" } underlying_type: "type-9" enum_fields { @@ -252,7 +252,29 @@ pointer_types { referenced_type: "type-4" source_file: "/development/vndk/tools/header-checker/tests/input/example2.h" linker_set_key: "test2::HelloAgain *" - self_type: "type-7" + self_type: "type-6" + } +} +pointer_types { + type_info { + name: "test3::ByeAgain *" + size: 8 + alignment: 8 + referenced_type: "type-13" + source_file: "/development/vndk/tools/header-checker/tests/input/example2.h" + linker_set_key: "test3::ByeAgain *" + self_type: "type-15" + } +} +pointer_types { + type_info { + name: "test3::ByeAgain *" + size: 8 + alignment: 8 + referenced_type: "type-16" + source_file: "/development/vndk/tools/header-checker/tests/input/example2.h" + linker_set_key: "test3::ByeAgain *" + self_type: "type-17" } } builtin_types { @@ -286,10 +308,10 @@ builtin_types { name: "void" size: 0 alignment: 0 - referenced_type: "type-6" + referenced_type: "type-7" source_file: "" linker_set_key: "void" - self_type: "type-6" + self_type: "type-7" } is_unsigned: false is_integral: false @@ -359,11 +381,23 @@ array_types { } } functions { - return_type: "type-6" + return_type: "type-2" + function_name: "test2::HelloAgain::again" + source_file: "/development/vndk/tools/header-checker/tests/input/example2.h" + parameters { + referenced_type: "type-6" + default_arg: false + is_this_ptr: true + } + linker_set_key: "_ZN5test210HelloAgain5againEv" + access: public_access +} +functions { + return_type: "type-7" function_name: "test2::HelloAgain::~HelloAgain" source_file: "/development/vndk/tools/header-checker/tests/input/example2.h" parameters { - referenced_type: "type-7" + referenced_type: "type-6" default_arg: false is_this_ptr: true } @@ -371,11 +405,11 @@ functions { access: public_access } functions { - return_type: "type-6" + return_type: "type-7" function_name: "test2::HelloAgain::~HelloAgain" source_file: "/development/vndk/tools/header-checker/tests/input/example2.h" parameters { - referenced_type: "type-7" + referenced_type: "type-6" default_arg: false is_this_ptr: true } @@ -383,17 +417,81 @@ functions { access: public_access } functions { - return_type: "type-6" + return_type: "type-7" function_name: "test2::HelloAgain::~HelloAgain" source_file: "/development/vndk/tools/header-checker/tests/input/example2.h" parameters { - referenced_type: "type-7" + referenced_type: "type-6" default_arg: false is_this_ptr: true } linker_set_key: "_ZN5test210HelloAgainD0Ev" access: public_access } +functions { + return_type: "type-14" + function_name: "test3::ByeAgain::method_foo" + source_file: "/development/vndk/tools/header-checker/tests/input/example2.h" + parameters { + referenced_type: "type-15" + default_arg: false + is_this_ptr: true + } + parameters { + referenced_type: "type-14" + default_arg: false + is_this_ptr: false + } + linker_set_key: "_ZN5test38ByeAgainIdE10method_fooEd" + access: public_access +} +functions { + return_type: "type-3" + function_name: "test3::ByeAgain::method_foo" + source_file: "/development/vndk/tools/header-checker/tests/input/example2.h" + parameters { + referenced_type: "type-17" + default_arg: false + is_this_ptr: true + } + parameters { + referenced_type: "type-2" + default_arg: false + is_this_ptr: false + } + linker_set_key: "_ZN5test38ByeAgainIfE10method_fooEi" + access: public_access +} +functions { + return_type: "type-12" + function_name: "test3::Begin" + source_file: "/development/vndk/tools/header-checker/tests/input/example2.h" + parameters { + referenced_type: "type-3" + default_arg: false + is_this_ptr: false + } + parameters { + referenced_type: "type-2" + default_arg: false + is_this_ptr: false + } + parameters { + referenced_type: "type-2" + default_arg: false + is_this_ptr: false + } + template_info { + elements { + referenced_type: "type-3" + } + elements { + referenced_type: "type-2" + } + } + linker_set_key: "_ZN5test35BeginIfiEEbT_T0_i" + access: public_access +} functions { return_type: "type-12" function_name: "test3::End" @@ -406,6 +504,18 @@ functions { linker_set_key: "_ZN5test33EndEf" access: public_access } +functions { + return_type: "type-21" + function_name: "test3::Dummy" + source_file: "/development/vndk/tools/header-checker/tests/input/example2.h" + parameters { + referenced_type: "type-2" + default_arg: false + is_this_ptr: false + } + linker_set_key: "_ZN5test35DummyEi" + access: public_access +} global_vars { name: "test2::HelloAgain::hello_forever" source_file: "/development/vndk/tools/header-checker/tests/input/example2.h" diff --git a/vndk/tools/header-checker/tests/expected/example4.h b/vndk/tools/header-checker/tests/expected/example4.h deleted file mode 100644 index 2d0a93533..000000000 --- a/vndk/tools/header-checker/tests/expected/example4.h +++ /dev/null @@ -1,96 +0,0 @@ -record_types { - type_info { - name: "Test" - size: 16 - alignment: 8 - referenced_type: "type-1" - source_file: "/development/vndk/tools/header-checker/tests/input/example4.h" - linker_set_key: "Test" - self_type: "type-1" - } - fields { - referenced_type: "type-2" - field_offset: 64 - field_name: "c" - access: private_access - } - vtable_layout { - vtable_components { - kind: OffsetToTop - mangled_component_name: "" - component_value: 0 - } - vtable_components { - kind: RTTI - mangled_component_name: "_ZTI4Test" - component_value: 0 - } - vtable_components { - kind: FunctionPointer - mangled_component_name: "_ZN4Test3fooEv" - component_value: 0 - } - } - access: public_access - record_kind: class_kind - tag_info { - unique_id: "_ZTS4Test" - } -} -record_types { - type_info { - name: "TestChild" - size: 16 - alignment: 8 - referenced_type: "type-3" - source_file: "/development/vndk/tools/header-checker/tests/input/example4.h" - linker_set_key: "TestChild" - self_type: "type-3" - } - fields { - referenced_type: "type-2" - field_offset: 96 - field_name: "d" - access: private_access - } - base_specifiers { - referenced_type: "type-1" - is_virtual: false - access: public_access - } - vtable_layout { - vtable_components { - kind: OffsetToTop - mangled_component_name: "" - component_value: 0 - } - vtable_components { - kind: RTTI - mangled_component_name: "_ZTI9TestChild" - component_value: 0 - } - vtable_components { - kind: FunctionPointer - mangled_component_name: "_ZN9TestChild3fooEv" - component_value: 0 - } - } - access: public_access - record_kind: class_kind - tag_info { - unique_id: "_ZTS9TestChild" - } -} -builtin_types { - type_info { - name: "int" - size: 4 - alignment: 4 - referenced_type: "type-2" - source_file: "" - linker_set_key: "int" - self_type: "type-2" - } - is_unsigned: false - is_integral: true -} diff --git a/vndk/tools/header-checker/tests/expected/func_decl_no_args.h b/vndk/tools/header-checker/tests/expected/func_decl_no_args.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/vndk/tools/header-checker/tests/expected/func_decl_one_arg.h b/vndk/tools/header-checker/tests/expected/func_decl_one_arg.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/vndk/tools/header-checker/tests/expected/func_decl_one_arg_ret.h b/vndk/tools/header-checker/tests/expected/func_decl_one_arg_ret.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/vndk/tools/header-checker/tests/expected/func_decl_two_args.h b/vndk/tools/header-checker/tests/expected/func_decl_two_args.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/vndk/tools/header-checker/tests/gen_expected_output.py b/vndk/tools/header-checker/tests/gen_expected_output.py deleted file mode 100755 index f28518365..000000000 --- a/vndk/tools/header-checker/tests/gen_expected_output.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python3 - -import sys -from utils import run_header_abi_dumper - -def main(): - sys.stdout.write(run_header_abi_dumper(sys.argv[1], True, sys.argv[2:])) - return 0 - -if __name__ == '__main__': - sys.exit(main()) diff --git a/vndk/tools/header-checker/tests/input/example1.h b/vndk/tools/header-checker/tests/input/example1.h index b93eccc70..a278d324e 100644 --- a/vndk/tools/header-checker/tests/input/example1.h +++ b/vndk/tools/header-checker/tests/input/example1.h @@ -37,6 +37,7 @@ struct CPPHello : private HelloAgain, public ByeAgain { cfloat_type cpp_bar; virtual int again() { return 0; } CPPHello() : cpp_foo(20), cpp_bar(1.234) {} + CPPHello(CPPHello &) = delete; enum Bla{BLA = 1}; int test_enum() {return CPPHello::BLA;} }; diff --git a/vndk/tools/header-checker/tests/input/func_decl_no_args.h b/vndk/tools/header-checker/tests/input/func_decl_no_args.h deleted file mode 100644 index b4bc10ff6..000000000 --- a/vndk/tools/header-checker/tests/input/func_decl_no_args.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef FUNC_DECL_NO_ARGS_H_ -#define FUNC_DECL_NO_ARGS_H_ - -#if defined(__cplusplus) -extern "C" { -#endif - -extern void test_void(); - -extern char test_char(); - -extern short test_short(); - -extern int test_int(); - -extern long test_long(); - -extern long long test_long_long(); - -extern unsigned char test_unsigned_char(); - -extern unsigned short test_unsigned_short(); - -extern unsigned int test_unsigned_int(); - -extern unsigned long test_unsigned_long(); - -extern unsigned long long test_unsigned_long_long(); - -extern float test_float(); - -extern double test_double(); - -extern long double test_long_double(); - -#if defined(__cplusplus) -} // extern "C" -#endif - -#endif // FUNC_DECL_NO_ARGS_H_ diff --git a/vndk/tools/header-checker/tests/input/func_decl_one_arg.h b/vndk/tools/header-checker/tests/input/func_decl_one_arg.h deleted file mode 100644 index e1c979632..000000000 --- a/vndk/tools/header-checker/tests/input/func_decl_one_arg.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef FUNC_DECL_ONE_ARG_H_ -#define FUNC_DECL_ONE_ARG_H_ - -#if defined(__cplusplus) -extern "C" { -#endif - -extern void test_char(char); - -extern void test_short(short); - -extern void test_int(int); - -extern void test_long(long); - -extern void test_long_long(long long); - -extern void test_unsigned_char(unsigned char); - -extern void test_unsigned_short(unsigned short); - -extern void test_unsigned_int(unsigned int); - -extern void test_unsigned_long(unsigned long); - -extern void test_unsigned_long_long(unsigned long long); - -extern void test_float(float); - -extern void test_double(double); - -extern void test_long_double(long double); - -#if defined(__cplusplus) -} // extern "C" -#endif - -#endif // FUNC_DECL_ONE_ARG_H_ diff --git a/vndk/tools/header-checker/tests/input/func_decl_one_arg_ret.h b/vndk/tools/header-checker/tests/input/func_decl_one_arg_ret.h deleted file mode 100644 index 84d2c6386..000000000 --- a/vndk/tools/header-checker/tests/input/func_decl_one_arg_ret.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef FUNC_DECL_ONE_ARG_RET_H_ -#define FUNC_DECL_ONE_ARG_RET_H_ - -#if defined(__cplusplus) -extern "C" { -#endif - -extern char test_char(char); - -extern short test_short(short); - -extern int test_int(int); - -extern long test_long(long); - -extern long long test_long_long(long long); - -extern unsigned char test_unsigned_char(unsigned char); - -extern unsigned short test_unsigned_short(unsigned short); - -extern unsigned int test_unsigned_int(unsigned int); - -extern unsigned long test_unsigned_long(unsigned long); - -extern unsigned long long test_unsigned_long_long(unsigned long long); - -extern float test_float(float); - -extern double test_double(double); - -extern long double test_long_double(long double); - -#if defined(__cplusplus) -} // extern "C" -#endif - -#endif // FUNC_DECL_ONE_ARG_RET_H_ diff --git a/vndk/tools/header-checker/tests/input/func_decl_two_args.h b/vndk/tools/header-checker/tests/input/func_decl_two_args.h deleted file mode 100644 index 5b4c8a329..000000000 --- a/vndk/tools/header-checker/tests/input/func_decl_two_args.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef FUNC_DECL_TWO_ARGS_H_ -#define FUNC_DECL_TWO_ARGS_H_ - -#if defined(__cplusplus) -extern "C" { -#endif - -extern void test_char(int, char); - -extern void test_short(int, short); - -extern void test_int(int, int); - -extern void test_long(int, long); - -extern void test_long_long(int, long long); - -extern void test_unsigned_char(int, unsigned char); - -extern void test_unsigned_short(int, unsigned short); - -extern void test_unsigned_int(int, unsigned int); - -extern void test_unsigned_long(int, unsigned long); - -extern void test_unsigned_long_long(int, unsigned long long); - -extern void test_unsigned_float(int, float); - -extern void test_unsigned_double(int, double); - -extern void test_unsigned_long_double(int, long double); - -#if defined(__cplusplus) -} // extern "C" -#endif - -#endif // FUNC_DECL_TWO_ARGS_H_ diff --git a/vndk/tools/header-checker/tests/test.py b/vndk/tools/header-checker/tests/test.py index da0fc6cb6..ad2db8452 100755 --- a/vndk/tools/header-checker/tests/test.py +++ b/vndk/tools/header-checker/tests/test.py @@ -97,22 +97,18 @@ class MyTest(unittest.TestCase): read_output_content(old_ref_dump_path, AOSP_DIR), read_output_content(new_ref_dump_path, AOSP_DIR)) - def test_func_decl_no_args(self): - self.run_and_compare_name_c_cpp('func_decl_no_args.h') + def test_example1_cpp(self): + self.run_and_compare_name_cpp('example1.cpp') - def test_func_decl_one_arg(self): - self.run_and_compare_name_c_cpp('func_decl_one_arg.h') - - def test_func_decl_two_args(self): - self.run_and_compare_name_c_cpp('func_decl_two_args.h') - - def test_func_decl_one_arg_ret(self): - self.run_and_compare_name_c_cpp('func_decl_one_arg_ret.h') - - def test_example1(self): + def test_example1_h(self): self.run_and_compare_name_cpp('example1.h') + + def test_example2_h(self): self.run_and_compare_name_cpp('example2.h') + def test_example3_h(self): + self.run_and_compare_name_cpp('example3.h') + def test_libc_and_cpp(self): self.prepare_and_run_abi_diff_all_archs( "libc_and_cpp", "libc_and_cpp", 0) diff --git a/vndk/tools/header-checker/utils/utils.py b/vndk/tools/header-checker/utils/utils.py index 237b567d8..fbccbebc8 100644 --- a/vndk/tools/header-checker/utils/utils.py +++ b/vndk/tools/header-checker/utils/utils.py @@ -35,6 +35,7 @@ VENDOR_SUFFIX = '.vendor' DEFAULT_CPPFLAGS = ['-x', 'c++', '-std=c++11'] DEFAULT_CFLAGS = ['-std=gnu99'] +DEFAULT_HEADER_FLAGS = ["-dump-function-declarations"] DEFAULT_FORMAT = 'ProtobufTextFormat' TARGET_ARCHS = ['arm', 'arm64', 'x86', 'x86_64', 'mips', 'mips64'] @@ -120,6 +121,8 @@ def run_header_abi_dumper_on_file(input_path, output_path, cmd += flags if '-output-format' not in flags: cmd += ['-output-format', DEFAULT_FORMAT] + if input_ext == ".h": + cmd += DEFAULT_HEADER_FLAGS cmd += ['--'] cmd += cflags if input_ext in ('.cpp', '.cc', '.h'):