From patchwork Mon May 4 16:24:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Procida X-Patchwork-Id: 39212 From: gprocida@google.com (Giuliano Procida) Date: Mon, 4 May 2020 17:24:37 +0100 Subject: [PATCH 1/3] abidiff.cc: tidy using directives and declarations In-Reply-To: <20200504162439.74028-1-gprocida@google.com> References: <20200504162439.74028-1-gprocida@google.com> Message-ID: <20200504162439.74028-2-gprocida@google.com> This patch replaces a using directive with a couple of specific using declarations, moves a couple of globally-scoped using declarations to the top of the file and alphabetically sorts all the using declarations. * tools/abidiff.cc: Eliminate using directive. Move stray using declarations to top of file and sort all using declarations. Signed-off-by: Giuliano Procida --- tools/abidiff.cc | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/tools/abidiff.cc b/tools/abidiff.cc index 162d5ebc..cffe5ab5 100644 --- a/tools/abidiff.cc +++ b/tools/abidiff.cc @@ -33,36 +33,39 @@ #include "abg-reader.h" #include "abg-dwarf-reader.h" -using std::vector; -using std::string; -using std::ostream; -using std::cout; -using std::cerr; using abg_compat::shared_ptr; -using abigail::ir::environment; -using abigail::ir::environment_sptr; -using abigail::translation_unit; -using abigail::translation_unit_sptr; -using abigail::corpus_sptr; -using abigail::corpus_group_sptr; -using abigail::comparison::translation_unit_diff_sptr; +using abigail::comparison::compute_diff; using abigail::comparison::corpus_diff; using abigail::comparison::corpus_diff_sptr; -using abigail::comparison::compute_diff; -using abigail::comparison::get_default_harmless_categories_bitmap; +using abigail::comparison::diff_context; +using abigail::comparison::diff_context_sptr; using abigail::comparison::get_default_harmful_categories_bitmap; +using abigail::comparison::get_default_harmless_categories_bitmap; +using abigail::comparison::translation_unit_diff_sptr; +using abigail::corpus_group_sptr; +using abigail::corpus_sptr; +using abigail::dwarf_reader::STATUS_ALT_DEBUG_INFO_NOT_FOUND; +using abigail::dwarf_reader::STATUS_DEBUG_INFO_NOT_FOUND; +using abigail::ir::environment; +using abigail::ir::environment_sptr; +using abigail::suppr::read_suppressions; using abigail::suppr::suppression_sptr; using abigail::suppr::suppressions_type; -using abigail::suppr::read_suppressions; -using namespace abigail::dwarf_reader; -using abigail::tools_utils::emit_prefix; +using abigail::tools_utils::abidiff_status; using abigail::tools_utils::check_file; -using abigail::tools_utils::guess_file_type; +using abigail::tools_utils::emit_prefix; using abigail::tools_utils::gen_suppr_spec_from_headers; using abigail::tools_utils::gen_suppr_spec_from_kernel_abi_whitelists; +using abigail::tools_utils::guess_file_type; using abigail::tools_utils::load_default_system_suppressions; using abigail::tools_utils::load_default_user_suppressions; -using abigail::tools_utils::abidiff_status; +using abigail::translation_unit; +using abigail::translation_unit_sptr; +using std::cerr; +using std::cout; +using std::ostream; +using std::string; +using std::vector; struct options { @@ -625,9 +628,6 @@ display_symtabs(const corpus_sptr c1, const corpus_sptr c2, ostream& o) o << (*i)->get_pretty_representation() << std::endl; } -using abigail::comparison::diff_context_sptr; -using abigail::comparison::diff_context; - /// Check that the suppression specification files supplied are /// present. If not, emit an error on stderr. /// From patchwork Mon May 4 16:24:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Procida X-Patchwork-Id: 39213 From: gprocida@google.com (Giuliano Procida) Date: Mon, 4 May 2020 17:24:38 +0100 Subject: [PATCH 2/3] Allow offset changes to be considered harmless. In-Reply-To: <20200504162439.74028-1-gprocida@google.com> References: <20200504162439.74028-1-gprocida@google.com> Message-ID: <20200504162439.74028-3-gprocida@google.com> This changes lets the user flip offset changes from harmful to harmless. This is a simple way of shrinking very verbose diffs where most changes within structs are offset changes caused by much rarer member addition, removal and size changes. * include/abg-comparison.h (diff_category): Mechanically split SIZE_OR_OFFSET_CHANGE_CATEGORY into SIZE_CHANGE_CATEGORY and OFFSET_CHANGE_CATEGORY. * src/abg-comp-filter.cc (categorize_harmful_diff_node): Ditto. * src/abg-comparison.cc (get_default_harmless_categories_bitmap): Ditto. (operator<<): In the diff_category overload, ditto. * src/abg-reporter-priv.cc (represent): Split show_size_offset_changes into show_size_changes and show_offset_changes and split conditional to match. (report_size_and_alignment_changes): Test SIZE_CHANGE_CATEGORY instead of old SIZE_OR_OFFSET_CHANGE_CATEGORY. Add a TODO to check an unexpected test. * tools/abidiff.cc: (options): Add offset_changes_are_harmless and plumb this through. Signed-off-by: Giuliano Procida --- include/abg-comparison.h | 35 +++++++++++++++++++++-------------- src/abg-comp-filter.cc | 14 +++++++++----- src/abg-comparison.cc | 15 ++++++++++++--- src/abg-reporter-priv.cc | 17 +++++++++++------ tools/abidiff.cc | 20 +++++++++++++++++--- 5 files changed, 70 insertions(+), 31 deletions(-) diff --git a/include/abg-comparison.h b/include/abg-comparison.h index 4f60ff99..8df84404 100644 --- a/include/abg-comparison.h +++ b/include/abg-comparison.h @@ -388,48 +388,54 @@ enum diff_category PRIVATE_TYPE_CATEGORY = 1 << 9, /// This means the diff node (or at least one of its descendant - /// nodes) carries a change that modifies the size of a type or an - /// offset of a type member. Removal or changes of enumerators in a - /// enum fall in this category too. - SIZE_OR_OFFSET_CHANGE_CATEGORY = 1 << 10, + /// nodes) carries a change that modifies the size of a type. + /// Removal or changes of enumerators in a enum fall in this + /// category too. + SIZE_CHANGE_CATEGORY = 1 << 10, + + /// This means the diff node (or at least one of its descendant + /// nodes) carries a change that modifies the offset of a type + /// member. + OFFSET_CHANGE_CATEGORY = 1 << 11, /// This means that a diff node in the sub-tree carries an /// incompatible change to a vtable. - VIRTUAL_MEMBER_CHANGE_CATEGORY = 1 << 11, + VIRTUAL_MEMBER_CHANGE_CATEGORY = 1 << 12, /// A diff node in this category is redundant. That means it's /// present as a child of a other nodes in the diff tree. - REDUNDANT_CATEGORY = 1 << 12, + REDUNDANT_CATEGORY = 1 << 13, /// This means that a diff node in the sub-tree carries a class type /// that was declaration-only and that is now defined, or vice /// versa. - CLASS_DECL_ONLY_DEF_CHANGE_CATEGORY = 1 << 13, + CLASS_DECL_ONLY_DEF_CHANGE_CATEGORY = 1 << 14, /// A diff node in this category is a function parameter type which /// top cv-qualifiers change. - FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY = 1 << 14, + FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY = 1 << 15, /// A diff node in this category has a function parameter type with a /// cv-qualifiers change. - FN_PARM_TYPE_CV_CHANGE_CATEGORY = 1 << 15, + FN_PARM_TYPE_CV_CHANGE_CATEGORY = 1 << 16, /// A diff node in this category is a function return type with a /// cv-qualifier change. - FN_RETURN_TYPE_CV_CHANGE_CATEGORY = 1 << 16, + FN_RETURN_TYPE_CV_CHANGE_CATEGORY = 1 << 17, /// A diff node in this category is for a variable which type holds /// a cv-qualifier change. - VAR_TYPE_CV_CHANGE_CATEGORY = 1 << 17, + VAR_TYPE_CV_CHANGE_CATEGORY = 1 << 18, /// A diff node in this category carries a change from void pointer /// to non-void pointer. - VOID_PTR_TO_PTR_CHANGE_CATEGORY = 1 << 18, + VOID_PTR_TO_PTR_CHANGE_CATEGORY = 1 << 19, /// A diff node in this category carries a change in the size of the /// array type of a global variable, but the ELF size of the /// variable didn't change. - BENIGN_INFINITE_ARRAY_CHANGE_CATEGORY = 1 << 19, + BENIGN_INFINITE_ARRAY_CHANGE_CATEGORY = 1 << 20, + /// A special enumerator that is the logical 'or' all the /// enumerators above. /// @@ -446,7 +452,8 @@ enum diff_category | HARMLESS_UNION_CHANGE_CATEGORY | SUPPRESSED_CATEGORY | PRIVATE_TYPE_CATEGORY - | SIZE_OR_OFFSET_CHANGE_CATEGORY + | SIZE_CHANGE_CATEGORY + | OFFSET_CHANGE_CATEGORY | VIRTUAL_MEMBER_CHANGE_CATEGORY | REDUNDANT_CATEGORY | CLASS_DECL_ONLY_DEF_CHANGE_CATEGORY diff --git a/src/abg-comp-filter.cc b/src/abg-comp-filter.cc index 75df901c..4e66e8b3 100644 --- a/src/abg-comp-filter.cc +++ b/src/abg-comp-filter.cc @@ -1585,14 +1585,18 @@ categorize_harmful_diff_node(diff *d, bool pre) // or removal. // // TODO: be more specific -- not all size changes are harmful. - if (!has_class_decl_only_def_change(d) - && (type_size_changed(f, s) - || data_member_offset_changed(f, s) + if (!has_class_decl_only_def_change(d)) + { + if (type_size_changed(f, s) || non_static_data_member_type_size_changed(f, s) || non_static_data_member_added_or_removed(d) || base_classes_added_or_removed(d) - || has_harmful_enum_change(d))) - category |= SIZE_OR_OFFSET_CHANGE_CATEGORY; + || has_harmful_enum_change(d)) + category |= SIZE_CHANGE_CATEGORY; + + if (data_member_offset_changed(f, s)) + category |= OFFSET_CHANGE_CATEGORY; + } if (has_virtual_mem_fn_change(d)) category |= VIRTUAL_MEMBER_CHANGE_CATEGORY; diff --git a/src/abg-comparison.cc b/src/abg-comparison.cc index 46bf9e30..32a2cf1b 100644 --- a/src/abg-comparison.cc +++ b/src/abg-comparison.cc @@ -2963,7 +2963,8 @@ get_default_harmless_categories_bitmap() diff_category get_default_harmful_categories_bitmap() { - return (abigail::comparison::SIZE_OR_OFFSET_CHANGE_CATEGORY + return (abigail::comparison::SIZE_CHANGE_CATEGORY + | abigail::comparison::OFFSET_CHANGE_CATEGORY | abigail::comparison::VIRTUAL_MEMBER_CHANGE_CATEGORY); } @@ -3065,11 +3066,19 @@ operator<<(ostream& o, diff_category c) emitted_a_category |= true; } - if (c & SIZE_OR_OFFSET_CHANGE_CATEGORY) + if (c & SIZE_CHANGE_CATEGORY) { if (emitted_a_category) o << "|"; - o << "SIZE_OR_OFFSET_CHANGE_CATEGORY"; + o << "SIZE_CHANGE_CATEGORY"; + emitted_a_category |= true; + } + + if (c & OFFSET_CHANGE_CATEGORY) + { + if (emitted_a_category) + o << "|"; + o << "OFFSET_CHANGE_CATEGORY"; emitted_a_category |= true; } diff --git a/src/abg-reporter-priv.cc b/src/abg-reporter-priv.cc index 4ea591aa..1897b448 100644 --- a/src/abg-reporter-priv.cc +++ b/src/abg-reporter-priv.cc @@ -422,8 +422,10 @@ represent(const var_diff_sptr &diff, const uint64_t n_offset = get_data_member_offset(n); const string o_pretty_representation = o->get_pretty_representation(); // no n_pretty_representation here as it's only needed in a couple of places - const bool show_size_offset_changes = ctxt->get_allowed_category() - & SIZE_OR_OFFSET_CHANGE_CATEGORY; + const bool show_size_changes = ctxt->get_allowed_category() + & SIZE_CHANGE_CATEGORY; + const bool show_offset_changes = ctxt->get_allowed_category() + & OFFSET_CHANGE_CATEGORY; // Has the main diff text been output? bool emitted = false; @@ -554,7 +556,7 @@ represent(const var_diff_sptr &diff, out << "now becomes laid out"; emitted = true; } - if (show_size_offset_changes) + if (show_offset_changes) { if (o_offset != n_offset) { @@ -577,7 +579,9 @@ represent(const var_diff_sptr &diff, maybe_show_relative_offset_change(diff, *ctxt, out); emitted = true; } - + } + if (show_size_changes) + { if (!size_reported && o_size != n_size) { if (begin_with_and) @@ -728,7 +732,7 @@ report_size_and_alignment_changes(type_or_decl_base_sptr first, unsigned fdc = first_array ? first_array->get_dimension_count(): 0, sdc = second_array ? second_array->get_dimension_count(): 0; - if (ctxt->get_allowed_category() & SIZE_OR_OFFSET_CHANGE_CATEGORY) + if (ctxt->get_allowed_category() & SIZE_CHANGE_CATEGORY) { if (fs != ss || fdc != sdc) { @@ -794,12 +798,13 @@ report_size_and_alignment_changes(type_or_decl_base_sptr first, } } // end if (fs != ss || fdc != sdc) else + // TODO: Is this the right check? if (ctxt->show_relative_offset_changes()) { out << indent << "type size hasn't changed\n"; } } - if ((ctxt->get_allowed_category() & SIZE_OR_OFFSET_CHANGE_CATEGORY) + if ((ctxt->get_allowed_category() & SIZE_CHANGE_CATEGORY) && (fa != sa)) { out << indent; diff --git a/tools/abidiff.cc b/tools/abidiff.cc index cffe5ab5..0dbd05f3 100644 --- a/tools/abidiff.cc +++ b/tools/abidiff.cc @@ -34,9 +34,12 @@ #include "abg-dwarf-reader.h" using abg_compat::shared_ptr; +using abigail::comparison::NO_CHANGE_CATEGORY; +using abigail::comparison::OFFSET_CHANGE_CATEGORY; using abigail::comparison::compute_diff; using abigail::comparison::corpus_diff; using abigail::comparison::corpus_diff_sptr; +using abigail::comparison::diff_category; using abigail::comparison::diff_context; using abigail::comparison::diff_context_sptr; using abigail::comparison::get_default_harmful_categories_bitmap; @@ -95,6 +98,7 @@ struct options bool show_hexadecimal_values; bool show_offsets_sizes_in_bits; bool show_relative_offset_changes; + bool offset_changes_are_harmless; bool show_stats_only; bool show_symtabs; bool show_deleted_fns; @@ -136,6 +140,7 @@ struct options show_hexadecimal_values(), show_offsets_sizes_in_bits(true), show_relative_offset_changes(true), + offset_changes_are_harmless(false), show_stats_only(), show_symtabs(), show_deleted_fns(), @@ -224,6 +229,7 @@ display_usage(const string& prog_name, ostream& out) << " --show-bits show size and offsets in bits\n" << " --show-hex show size and offset in hexadecimal\n" << " --show-dec show size and offset in decimal\n" + << " --offset-changes-are-harmless" << " --no-show-relative-offset-changes do not show relative" " offset changes\n" << " --suppressions|--suppr specify a suppression file\n" @@ -480,6 +486,8 @@ parse_command_line(int argc, char* argv[], options& opts) opts.show_hexadecimal_values = false; else if (!strcmp(argv[i], "--no-show-relative-offset-changes")) opts.show_relative_offset_changes = false; + else if (!strcmp(argv[i], "--offset-changes-are-harmless")) + opts.offset_changes_are_harmless = true; else if (!strcmp(argv[i], "--suppressions") || !strcmp(argv[i], "--suppr")) { @@ -690,7 +698,7 @@ set_diff_context_from_opts(diff_context_sptr ctxt, // redundancy analysis pass altogether. That could help save a // couple of CPU cycle here and there! ctxt->show_redundant_changes(opts.show_redundant_changes - || opts.leaf_changes_only); + || opts.leaf_changes_only); ctxt->show_symbols_unreferenced_by_debug_info (opts.show_symbols_not_referenced_by_debug_info); ctxt->show_added_symbols_unreferenced_by_debug_info @@ -698,11 +706,17 @@ set_diff_context_from_opts(diff_context_sptr ctxt, ctxt->show_unreachable_types(opts.show_all_types); ctxt->show_impacted_interfaces(opts.show_impacted_interfaces); + diff_category extra_harmless = opts.offset_changes_are_harmless + ? OFFSET_CHANGE_CATEGORY + : NO_CHANGE_CATEGORY; + if (!opts.show_harmless_changes) - ctxt->switch_categories_off(get_default_harmless_categories_bitmap()); + ctxt->switch_categories_off(get_default_harmless_categories_bitmap() + | extra_harmless); if (!opts.show_harmful_changes) - ctxt->switch_categories_off(get_default_harmful_categories_bitmap()); + ctxt->switch_categories_off(get_default_harmful_categories_bitmap() + &~ extra_harmless); suppressions_type supprs; for (vector::const_iterator i = opts.suppression_paths.begin(); From patchwork Mon May 4 16:24:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Procida X-Patchwork-Id: 39215 From: gprocida@google.com (Giuliano Procida) Date: Mon, 4 May 2020 17:24:39 +0100 Subject: [PATCH 3/3] Add abidiff --offset-changes-are-harmless tests. In-Reply-To: <20200504162439.74028-1-gprocida@google.com> References: <20200504162439.74028-1-gprocida@google.com> Message-ID: <20200504162439.74028-4-gprocida@google.com> The new --offset-changes-are-harmless option changes the default interpretation of what constitutes a harmless change and impacts the --harmless and --no-harmful options. This commit adds tests covering the various possibilities. The object files have the following changes. - S::z changes from void* to int* (harmless) - S::a changes size (harmful) - S::b changes offset (normally harmful, harmless with new flag) * tests/data/Makefile.am: Add new test case files. * tests/data/test-abidiff-exit/test-offset-harm-report0.txt: New test case. * tests/data/test-abidiff-exit/test-offset-harm-report1.txt: Ditto. * tests/data/test-abidiff-exit/test-offset-harm-report2.txt: Ditto. * tests/data/test-abidiff-exit/test-offset-harm-report3.txt: Ditto. * tests/data/test-abidiff-exit/test-offset-harm-v0.c: Ditto. * tests/data/test-abidiff-exit/test-offset-harm-v0.o: Ditto. * tests/data/test-abidiff-exit/test-offset-harm-v1.c: Ditto. * tests/data/test-abidiff-exit/test-offset-harm-v1.o: Ditto. * tests/test-abidiff-exit.cc: Run new test cases. Signed-off-by: Giuliano Procida --- tests/data/Makefile.am | 8 ++++ .../test-offset-harm-report0.txt | 15 ++++++++ .../test-offset-harm-report1.txt | 20 ++++++++++ .../test-offset-harm-report2.txt | 3 ++ .../test-offset-harm-report3.txt | 14 +++++++ .../test-abidiff-exit/test-offset-harm-v0.c | 7 ++++ .../test-abidiff-exit/test-offset-harm-v0.o | Bin 0 -> 2872 bytes .../test-abidiff-exit/test-offset-harm-v1.c | 7 ++++ .../test-abidiff-exit/test-offset-harm-v1.o | Bin 0 -> 2864 bytes tests/test-abidiff-exit.cc | 36 ++++++++++++++++++ 10 files changed, 110 insertions(+) create mode 100644 tests/data/test-abidiff-exit/test-offset-harm-report0.txt create mode 100644 tests/data/test-abidiff-exit/test-offset-harm-report1.txt create mode 100644 tests/data/test-abidiff-exit/test-offset-harm-report2.txt create mode 100644 tests/data/test-abidiff-exit/test-offset-harm-report3.txt create mode 100644 tests/data/test-abidiff-exit/test-offset-harm-v0.c create mode 100644 tests/data/test-abidiff-exit/test-offset-harm-v0.o create mode 100644 tests/data/test-abidiff-exit/test-offset-harm-v1.c create mode 100644 tests/data/test-abidiff-exit/test-offset-harm-v1.o diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index a1b9bf64..6b116c55 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -151,6 +151,14 @@ test-abidiff-exit/test-decl-struct-v0.o \ test-abidiff-exit/test-decl-struct-v1.c \ test-abidiff-exit/test-decl-struct-v1.o \ test-abidiff-exit/test-decl-struct-report.txt \ +test-abidiff-exit/test-offset-harm-v0.c \ +test-abidiff-exit/test-offset-harm-v0.o \ +test-abidiff-exit/test-offset-harm-v1.c \ +test-abidiff-exit/test-offset-harm-v1.o \ +test-abidiff-exit/test-offset-harm-report0.txt \ +test-abidiff-exit/test-offset-harm-report1.txt \ +test-abidiff-exit/test-offset-harm-report2.txt \ +test-abidiff-exit/test-offset-harm-report3.txt \ \ test-diff-dwarf/test0-v0.cc \ test-diff-dwarf/test0-v0.o \ diff --git a/tests/data/test-abidiff-exit/test-offset-harm-report0.txt b/tests/data/test-abidiff-exit/test-offset-harm-report0.txt new file mode 100644 index 00000000..6ac7022d --- /dev/null +++ b/tests/data/test-abidiff-exit/test-offset-harm-report0.txt @@ -0,0 +1,15 @@ +Functions changes summary: 0 Removed, 1 Changed, 0 Added function +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable + +1 function with some indirect sub-type change: + + [C] 'function void reg(S*)' at test-offset-harm-v1.c:7:1 has some indirect sub-type changes: + parameter 1 of type 'S*' has sub-type changes: + in pointed to type 'struct S' at test-offset-harm-v1.c:1:1: + type size changed from 256 to 384 (in bits) + 1 data member changes (2 filtered): + type of 'int S::a[4]' changed: + type name changed from 'int[4]' to 'int[8]' + array type size changed from 128 to 256 + array type subrange 1 changed length from 4 to 8 + diff --git a/tests/data/test-abidiff-exit/test-offset-harm-report1.txt b/tests/data/test-abidiff-exit/test-offset-harm-report1.txt new file mode 100644 index 00000000..85a64b07 --- /dev/null +++ b/tests/data/test-abidiff-exit/test-offset-harm-report1.txt @@ -0,0 +1,20 @@ +Functions changes summary: 0 Removed, 1 Changed, 0 Added function +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable + +1 function with some indirect sub-type change: + + [C] 'function void reg(S*)' at test-offset-harm-v1.c:7:1 has some indirect sub-type changes: + parameter 1 of type 'S*' has sub-type changes: + in pointed to type 'struct S' at test-offset-harm-v1.c:1:1: + type size changed from 256 to 384 (in bits) + 3 data member changes: + type of 'void* S::z' changed: + in pointed to type 'void': + type name changed from 'void' to 'int' + type size changed from 0 to 32 (in bits) + type of 'int S::a[4]' changed: + type name changed from 'int[4]' to 'int[8]' + array type size changed from 128 to 256 + array type subrange 1 changed length from 4 to 8 + 'int S::b' offset changed from 192 to 320 (in bits) (by +128 bits) + diff --git a/tests/data/test-abidiff-exit/test-offset-harm-report2.txt b/tests/data/test-abidiff-exit/test-offset-harm-report2.txt new file mode 100644 index 00000000..9666a8fd --- /dev/null +++ b/tests/data/test-abidiff-exit/test-offset-harm-report2.txt @@ -0,0 +1,3 @@ +Functions changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Added function +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable + diff --git a/tests/data/test-abidiff-exit/test-offset-harm-report3.txt b/tests/data/test-abidiff-exit/test-offset-harm-report3.txt new file mode 100644 index 00000000..c4eb748f --- /dev/null +++ b/tests/data/test-abidiff-exit/test-offset-harm-report3.txt @@ -0,0 +1,14 @@ +Functions changes summary: 0 Removed, 1 Changed, 0 Added function +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable + +1 function with some indirect sub-type change: + + [C] 'function void reg(S*)' at test-offset-harm-v1.c:7:1 has some indirect sub-type changes: + parameter 1 of type 'S*' has sub-type changes: + in pointed to type 'struct S' at test-offset-harm-v1.c:1:1: + 2 data member changes (1 filtered): + type of 'void* S::z' changed: + in pointed to type 'void': + type name changed from 'void' to 'int' + 'int S::b' offset changed from 192 to 320 (in bits) (by +128 bits) + diff --git a/tests/data/test-abidiff-exit/test-offset-harm-v0.c b/tests/data/test-abidiff-exit/test-offset-harm-v0.c new file mode 100644 index 00000000..c05e9742 --- /dev/null +++ b/tests/data/test-abidiff-exit/test-offset-harm-v0.c @@ -0,0 +1,7 @@ +struct S { + void* z; + int a[4]; + int b; +}; + +void reg(struct S* s) { (void)s; } diff --git a/tests/data/test-abidiff-exit/test-offset-harm-v0.o b/tests/data/test-abidiff-exit/test-offset-harm-v0.o new file mode 100644 index 0000000000000000000000000000000000000000..b6222d63e7f27c8ea10d8173bbd98419650e657c GIT binary patch literal 2872 zcmbtV&ubiY6o22H-Rx|p*(TXa6XIbCN-a1uNtBwlq^?HW1d9}<7g56O?ssPgXJ^99 zY~5BxC?fP0Q4rCCAP61=j~<0yJ$U!*AK0j?!5Ot@8|dTC$HbS zQDY1wF}MyVnnVGn3ny~75WCQURk*YN@X!5+A3r{R@6nG4*9((bWH?jE%EwaV+S_0= zX1;@vaUWQ%MG_c3Fr)b{N~X~RR&Qn~u0h>wkPzX2fj$N_%_ed%>y0qZp_TFgSaa5* zEX2P30i6~zw4EcV_W1}b)1gSV!k%q+ETg^AUSX@v<@0FmFvGO0tJXE^ip4ruW(f?l zR1Z2kn6!QtEMyJF4m#wpZ~+cF9wNxK4GtYhS&(PN9np zC3kHNz@pp-Xo2UcQ|b{gheC2x3RH;u_%(_s#{OTK21Z6n9N3dM3xk*sY?|AfZ{D%@wqCNYxZCcQy}h};iN6=1{a(bgQ@Zjd zS?Wbe-;cZ?NrH%bqh!pz;3!S{;lTI&c#tOHz>C73-wOjjj651%<_-MZFGL6NK{y;b zd>ZBeH~03g+Rweld!Zkf{X5$`m$Z=-lL2r}aCZMKVAEx`ai(b=;}kxPIQ@x=1$d>s z{8?>pY2gMslyK#jR-g`l{ZnPciLQci5oZfBXE)GNMTR(Ty3K&uNtiR?v6<7QVn9oZ zbKEFLJcp5Dz|s>~iR1pSAOoJb3INX=-X16OFx%YKJC+W3L2_h^s7aX&vI5~WnpFak zR!RmE9}4{`4gW~!>w;5f>S|n4{MB_&6kMIf2dCtbJySmo;X`a$$a>vtr{K20sYkU> zaI<@3JZ8xAwB#cx<$RihOQ!|gUY3EI^2m1wyf+CB!+4mWt&sg*FXeaV%zo;}0iIkn zBno3LL$Cz6{bW4mcxAY8l5-a?4kyd~{`(?`j}C{aKjxzG|H(Emp5{u>ITv{lvrPSlt4MD^)h>-CQiqnxr&6bm{l4&!eU5M0)m{6oa6 z;{Ooww7*o6agu+EMk%X)_=;DO?)$ZfpSwE{Ge!K4mPL+V!e63LHGjWU%pbi9GG5Lr w^`qCO++9)swrH5{Z+dO?cv_RHp&nCHNOV7_q>rESR>l7=`u|=HMp=*l7e>q3{{R30 literal 0 HcmV?d00001 diff --git a/tests/data/test-abidiff-exit/test-offset-harm-v1.c b/tests/data/test-abidiff-exit/test-offset-harm-v1.c new file mode 100644 index 00000000..025e8462 --- /dev/null +++ b/tests/data/test-abidiff-exit/test-offset-harm-v1.c @@ -0,0 +1,7 @@ +struct S { + int* z; + int a[8]; + int b; +}; + +void reg(struct S* s) { (void)s; } diff --git a/tests/data/test-abidiff-exit/test-offset-harm-v1.o b/tests/data/test-abidiff-exit/test-offset-harm-v1.o new file mode 100644 index 0000000000000000000000000000000000000000..0b2ee10ccb2c4512f1671b5455057fb33de2b914 GIT binary patch literal 2864 zcmbtVUuzsy6hC)oH#^BBYm%)rAwEn&X$zg1Bud@3q^?HW1d9}Mo*?aWo-lI?ceth@WpAfEQDl?0)n8}5~D#(@h zV3RTPeT0l-V3kY)g99__K7yvv0amSlfZ_$Hn#60>S`el%NAi9A*RugkvyKy(kA)Ac zJ}FZrW8eLV+JyvlXGp4iIly=hxv&-XQln`Zjg7_%TdgmjMQxKAre$5Vu31+s*2LnL zz%cXaezS!^tIvUD?W3mlA_~_n!vvUPY`;m?^>eV_^w7$b$_5tZve(vCjPvW1slE2~ z8|!4hP%A{QtYJ-;s6;9bFm8d=atcr;?%`-;UX1 zY&)ZL9Eu%Zgdz^QIOTD7uyfS9>|B1uc6{6E^W;I;9mG)>jT2`a-Vef_lk(0`B&Ss6 zjg#0LMqNJi{3!B=!W%>*;rWMg)D3#v<6$q3f}S@FI=mD3JQ#Ykyu|DAlxL!YcrWPp z9dQ(-05^Acui6*h6rF&FdHv3I>!P+2fHPS?uv^FP0y|n}8;f=GF?R0-#OY6z_5St7 z^25sR(%cO+$l=nFnqP&#o|P%F$7L{nzsa|l(Hp2KBSRiDU1z{#_s^&d$WF)%MiT?( zPhdG-zS|5~I>jEhc?lVC;tBvfV|Z&!`!LB=zFFx|XQWoPfHNhNLS-PFRu}*N4 z2O~UT$kRCI10|*6Csl0XG&y?)F4y>>mVSKSEt5^G+ug_h!^Q=An;=w&*ep zLZMtR1-RX4G!l4QxM7qE7w-%wNqP4}=_CdR{g{u0Ec}164fLm8seY<(Z7EFllbla? zS`M5;MwouG-j?<{)BVq*0qukT>c54)dQ8fx^8Z4U0_nE&KF}lEF4&OxL;mu@6N%Hl zB1r97dRvHg@UO=t{3#7cU*&8v>bAF0qhn-DcP7zh&L*R7OY1DFe;^Nq@~8Ug*3#?m zA*RPf2%bpr7EKDI+a92g^r*p06KSYdTsyb23Xi*-<-xVOa%CGoGh?n{Q zA^mB86-oIi{y8d@T(o;Oa~VuEy6v~p|Ae{R(5