@@ -82,7 +82,10 @@ int get_xml_node_depth(xmlNodePtr);
reinterpret_cast<char*>(xml_char_str.get())
xmlNodePtr
-advance_to_next_sibling_element(xmlNodePtr node);
+first_child(xmlNodePtr node);
+
+xmlNodePtr
+next_child(xmlNodePtr node);
void
escape_xml_string(const std::string& str,
@@ -413,40 +413,39 @@ unescape_xml_comment(const std::string& str)
return result;
}
-/// Maybe get the next sibling element node of an XML node, or stay to the sam
+/// Skip until we reach an XML element node or run out of (child) nodes.
///
-/// If there is no next sibling xml element node, the function returns
-/// the initial node.
+/// @param a pointer to a node.
///
-/// @param node the initial node to consider.
-///
-/// @return the next sibling node or the initial node @p node.
-static xmlNodePtr
-go_to_next_sibling_element_or_stay(xmlNodePtr node)
+/// @return a pointer to an XML element node or nil.
+xmlNodePtr
+skip_non_elements(xmlNodePtr node)
{
- xmlNodePtr n;
- for (n = node; n; n = n->next)
- {
- if (n->type == XML_ELEMENT_NODE)
- break;
- }
- return n ? n : node;
+ while (node && node->type != XML_ELEMENT_NODE)
+ node = node->next;
+ return node;
}
-/// Get the next sibling element node of an XML node.
+/// Get the first child element of an XML node.
///
-/// If there is no next sibling xml element node, the function returns nil.
+/// @param a pointer to the node whose children are to be perused.
///
-/// @param node the XML node to consider.
+/// @return a pointer to the first XML element child of @p node or nil.
+xmlNodePtr
+first_child(xmlNodePtr node)
+{
+ return skip_non_elements(node->children);
+}
+
+/// Get the next sibling element of an XML node.
///
-/// @return the next sibling element node or nil.
+/// @param a pointer to the XML node whose following siblings are to be perused.
+///
+/// @return a pointer to the next sibling element of @p node or nil.
xmlNodePtr
-advance_to_next_sibling_element(xmlNodePtr node)
+next_child(xmlNodePtr node)
{
- xmlNodePtr n = go_to_next_sibling_element_or_stay(node->next);
- if (n == 0 || n->type != XML_ELEMENT_NODE)
- return 0;
- return n;
+ return skip_non_elements(node->next);
}
}//end namespace xml
@@ -1333,18 +1333,13 @@ static void
walk_xml_node_to_map_type_ids(read_context& ctxt,
xmlNodePtr node)
{
- xmlNodePtr n = node;
-
- if (!n || n->type != XML_ELEMENT_NODE)
- return;
-
- if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(n, "id"))
+ if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "id"))
{
string id = CHAR_STR(s);
- ctxt.map_id_and_node(id, n);
+ ctxt.map_id_and_node(id, node);
}
- for (n = n->children; n; n = n->next)
+ for (xmlNodePtr n = xml::first_child(node); n; n = xml::next_child(n))
walk_xml_node_to_map_type_ids(ctxt, n);
}
@@ -1386,12 +1381,8 @@ read_translation_unit(read_context& ctxt, translation_unit& tu, xmlNodePtr node)
|| !ctxt.get_corpus())
walk_xml_node_to_map_type_ids(ctxt, node);
- for (xmlNodePtr n = node->children; n; n = n->next)
- {
- if (n->type != XML_ELEMENT_NODE)
- continue;
- handle_element_node(ctxt, n, /*add_decl_to_scope=*/true);
- }
+ for (xmlNodePtr n = xml::first_child(node); n; n = xml::next_child(n))
+ handle_element_node(ctxt, n, /*add_decl_to_scope=*/true);
ctxt.pop_scope_or_abort(tu.get_global_scope());
@@ -1485,16 +1476,9 @@ read_translation_unit_from_input(read_context& ctxt)
else
{
node = 0;
- for (xmlNodePtr n = ctxt.get_corpus_node()->next; n; n = n->next)
- {
- if (!n
- || n->type != XML_ELEMENT_NODE)
- continue;
- if (!xmlStrEqual(n->name, BAD_CAST("abi-instr")))
- return nil;
- node = n;
- break;
- }
+ xmlNodePtr n = ctxt.get_corpus_node();
+ if (n && xmlStrEqual(n->name, BAD_CAST("abi-instr")))
+ node = n;
}
if (node == 0)
@@ -1507,9 +1491,9 @@ read_translation_unit_from_input(read_context& ctxt)
// case, after that unexpected call to read_translation_unit(), the
// current corpus node of the context is going to point to that
// translation unit that has been read under the hood. Let's set
- // the corpus node to the one we initially called
+ // the corpus node to just after the one we initially called
// read_translation_unit() on here.
- ctxt.set_corpus_node(node);
+ ctxt.set_corpus_node(xml::next_child(node));
return tu;
}
@@ -1583,32 +1567,32 @@ read_symbol_db_from_input(read_context& ctxt,
xmlTextReaderNext(reader.get());
}
else
- for (xmlNodePtr n = ctxt.get_corpus_node()->next; n; n = n->next)
- {
- if (!n || n->type != XML_ELEMENT_NODE)
- continue;
-
- bool has_fn_syms = false, has_var_syms = false;
- if (xmlStrEqual(n->name, BAD_CAST("elf-function-symbols")))
- has_fn_syms = true;
- else if (xmlStrEqual(n->name, BAD_CAST("elf-variable-symbols")))
- has_var_syms = true;
- else
- break;
- ctxt.set_corpus_node(n);
- if (has_fn_syms)
- {
- fn_symdb = build_elf_symbol_db(ctxt, n, true);
- found = true;
- }
- else if (has_var_syms)
- {
- var_symdb = build_elf_symbol_db(ctxt, n, false);
- found = true;
- }
- else
- break;
- }
+ {
+ xmlNodePtr n = ctxt.get_corpus_node();
+ for (; n; n = xml::next_child(n))
+ {
+ bool has_fn_syms = false, has_var_syms = false;
+ if (xmlStrEqual(n->name, BAD_CAST("elf-function-symbols")))
+ has_fn_syms = true;
+ else if (xmlStrEqual(n->name, BAD_CAST("elf-variable-symbols")))
+ has_var_syms = true;
+ else
+ break;
+ if (has_fn_syms)
+ {
+ fn_symdb = build_elf_symbol_db(ctxt, n, true);
+ found = true;
+ }
+ else if (has_var_syms)
+ {
+ var_symdb = build_elf_symbol_db(ctxt, n, false);
+ found = true;
+ }
+ else
+ break;
+ }
+ ctxt.set_corpus_node(n);
+ }
return found;
}
@@ -1626,16 +1610,12 @@ read_symbol_db_from_input(read_context& ctxt,
static bool
build_needed(xmlNode* node, vector<string>& needed)
{
- if (!node)
- return false;
-
- if (!node || !xmlStrEqual(node->name,BAD_CAST("elf-needed")))
+ if (!xmlStrEqual(node->name,BAD_CAST("elf-needed")))
return false;
- for (xmlNodePtr n = node->children; n; n = n->next)
+ for (xmlNodePtr n = xml::first_child(node); n; n = xml::next_child(n))
{
- if (n->type != XML_ELEMENT_NODE
- || !xmlStrEqual(n->name, BAD_CAST("dependency")))
+ if (!xmlStrEqual(n->name, BAD_CAST("dependency")))
continue;
string name;
@@ -1683,27 +1663,19 @@ read_elf_needed_from_input(read_context& ctxt,
return false;
node = xmlTextReaderExpand(reader.get());
- if (!node)
- return false;
}
else
{
- for (xmlNodePtr n = ctxt.get_corpus_node()->next; n; n = n->next)
- {
- if (!n || n->type != XML_ELEMENT_NODE)
- continue;
- if (!xmlStrEqual(n->name, BAD_CAST("elf-needed")))
- return false;
- node = n;
- break;
- }
+ xmlNodePtr n = ctxt.get_corpus_node();
+ if (n && xmlStrEqual(n->name, BAD_CAST("elf-needed")))
+ node = n;
}
bool result = false;
if (node)
{
result = build_needed(node, needed);
- ctxt.set_corpus_node(node);
+ ctxt.set_corpus_node(xml::next_child(node));
}
return result;
@@ -1907,10 +1879,7 @@ read_corpus_from_input(read_context& ctxt)
corp.set_soname(reinterpret_cast<char*>(soname_str.get()));
}
- if (!node->children)
- return nil;
-
- ctxt.set_corpus_node(node->children);
+ ctxt.set_corpus_node(xml::first_child(node));
corpus& corp = *ctxt.get_corpus();
@@ -1976,17 +1945,6 @@ read_corpus_from_input(read_context& ctxt)
// call at the beginning of the function.
xmlTextReaderNext(reader.get());
}
- else
- {
- node = ctxt.get_corpus_node();
- node = xml::advance_to_next_sibling_element(node);
- if (!node)
- {
- node = ctxt.get_corpus_node();
- node = xml::advance_to_next_sibling_element(node->parent);
- }
- ctxt.set_corpus_node(node);
- }
return ctxt.get_corpus();
}
@@ -2036,13 +1994,13 @@ read_corpus_group_from_input(read_context& ctxt)
if (!node)
return nil;
- //node = xml::get_first_element_sibling_if_text(node->children);
- node = xml::advance_to_next_sibling_element(node->children);
- ctxt.set_corpus_node(node);
-
- corpus_sptr corp;
- while ((corp = read_corpus_from_input(ctxt)))
- ctxt.get_corpus_group()->add_corpus(corp);
+ for (xmlNodePtr n = xml::first_child(node); n; n = xml::next_child(n))
+ {
+ ctxt.set_corpus_node(n);
+ corpus_sptr corp = read_corpus_from_input(ctxt);
+ if (corp)
+ ctxt.get_corpus_group()->add_corpus(corp);
+ }
xmlTextReaderNext(reader.get());
@@ -2728,12 +2686,8 @@ build_namespace_decl(read_context& ctxt,
ctxt.push_decl_to_current_scope(decl, add_to_current_scope);
ctxt.map_xml_node_to_decl(node, decl);
- for (xmlNodePtr n = node->children; n; n = n->next)
- {
- if (n->type != XML_ELEMENT_NODE)
- continue;
- handle_element_node(ctxt, n, /*add_to_current_scope=*/true);
- }
+ for (xmlNodePtr n = xml::first_child(node); n; n = xml::next_child(n))
+ handle_element_node(ctxt, n, /*add_to_current_scope=*/true);
ctxt.pop_scope_or_abort(decl);
@@ -2757,9 +2711,7 @@ build_elf_symbol(read_context& ctxt, const xmlNodePtr node,
{
elf_symbol_sptr nil;
- if (!node
- || node->type != XML_ELEMENT_NODE
- || !xmlStrEqual(node->name, BAD_CAST("elf-symbol")))
+ if (!xmlStrEqual(node->name, BAD_CAST("elf-symbol")))
return nil;
string name;
@@ -2918,7 +2870,7 @@ build_elf_symbol_db(read_context& ctxt,
xml_node_ptr_elf_symbol_sptr_map_type xml_node_ptr_elf_symbol_map;
elf_symbol_sptr sym;
- for (xmlNodePtr n = node->children; n; n = n->next)
+ for (xmlNodePtr n = xml::first_child(node); n; n = xml::next_child(n))
{
if ((sym = build_elf_symbol(ctxt, n, /*drop_if_suppress=*/true)))
{
@@ -3084,12 +3036,9 @@ build_function_decl(read_context& ctxt,
std::vector<function_decl::parameter_sptr> parms;
type_base_sptr return_type = env->get_void_type();
- for (xmlNodePtr n = node->children; n ; n = n->next)
+ for (xmlNodePtr n = xml::first_child(node); n; n = xml::next_child(n))
{
- if (n->type != XML_ELEMENT_NODE)
- continue;
-
- else if (xmlStrEqual(n->name, BAD_CAST("parameter")))
+ if (xmlStrEqual(n->name, BAD_CAST("parameter")))
{
if (function_decl::parameter_sptr p =
build_function_parameter(ctxt, n))
@@ -3779,12 +3728,9 @@ build_function_type(read_context& ctxt,
ctxt.get_translation_unit()->bind_function_type_life_time(fn_type);
ctxt.key_type_decl(fn_type, id);
- for (xmlNodePtr n = node->children; n ; n = n->next)
+ for (xmlNodePtr n = xml::first_child(node); n; n = xml::next_child(n))
{
- if (n->type != XML_ELEMENT_NODE)
- continue;
-
- else if (xmlStrEqual(n->name, BAD_CAST("parameter")))
+ if (xmlStrEqual(n->name, BAD_CAST("parameter")))
{
if (function_decl::parameter_sptr p =
build_function_parameter(ctxt, n))
@@ -4015,12 +3961,9 @@ build_array_type_def(read_context& ctxt,
read_location(ctxt, node, loc);
array_type_def::subranges_type subranges;
- for (xmlNodePtr n = node->children; n ; n = n->next)
+ for (xmlNodePtr n = xml::first_child(node); n; n = xml::next_child(n))
{
- if (n->type != XML_ELEMENT_NODE)
- continue;
-
- else if (xmlStrEqual(n->name, BAD_CAST("subrange")))
+ if (xmlStrEqual(n->name, BAD_CAST("subrange")))
{
if (array_type_def::subrange_sptr s =
build_subrange_type(ctxt, n))
@@ -4173,11 +4116,8 @@ build_enum_type_decl(read_context& ctxt,
string base_type_id;
enum_type_decl::enumerators enums;
- for (xmlNodePtr n = node->children; n; n = n->next)
+ for (xmlNodePtr n = xml::first_child(node); n; n = xml::next_child(n))
{
- if (n->type != XML_ELEMENT_NODE)
- continue;
-
if (xmlStrEqual(n->name, BAD_CAST("underlying-type")))
{
xml_char_sptr a = xml::build_sptr(xmlGetProp(n, BAD_CAST("type-id")));
@@ -4544,11 +4484,11 @@ build_class_decl(read_context& ctxt,
decl->set_naming_typedef(naming_typedef);
}
- for (xmlNodePtr n = node->children; !is_decl_only && n; n = n->next)
+ for (xmlNodePtr n = xml::first_child(node); n; n = xml::next_child(n))
{
- if (n->type != XML_ELEMENT_NODE)
- continue;
-
+ // See https://sourceware.org/bugzilla/show_bug.cgi?id=26591#c7.
+ if (is_decl_only)
+ continue;
if (xmlStrEqual(n->name, BAD_CAST("base-class")))
{
access_specifier access =
@@ -4595,11 +4535,8 @@ build_class_decl(read_context& ctxt,
ctxt.map_xml_node_to_decl(n, decl);
- for (xmlNodePtr p = n->children; p; p = p->next)
+ for (xmlNodePtr p = xml::first_child(n); p; p = xml::next_child(p))
{
- if (p->type != XML_ELEMENT_NODE)
- continue;
-
if (type_base_sptr t =
build_type(ctxt, p, /*add_to_current_scope=*/true))
{
@@ -4633,11 +4570,8 @@ build_class_decl(read_context& ctxt,
bool is_static = false;
read_static(n, is_static);
- for (xmlNodePtr p = n->children; p; p = p->next)
+ for (xmlNodePtr p = xml::first_child(n); p; p = xml::next_child(p))
{
- if (p->type != XML_ELEMENT_NODE)
- continue;
-
if (var_decl_sptr v =
build_var_decl(ctxt, p, /*add_to_cur_scope=*/false))
{
@@ -4691,11 +4625,8 @@ build_class_decl(read_context& ctxt,
bool is_ctor = false, is_dtor = false, is_const = false;
read_cdtor_const(n, is_ctor, is_dtor, is_const);
- for (xmlNodePtr p = n->children; p; p = p->next)
+ for (xmlNodePtr p = xml::first_child(n); p; p = xml::next_child(p))
{
- if (p->type != XML_ELEMENT_NODE)
- continue;
-
if (function_decl_sptr f =
build_function_decl_if_not_suppressed(ctxt, p, decl,
/*add_to_cur_sc=*/true))
@@ -4730,11 +4661,8 @@ build_class_decl(read_context& ctxt,
bool is_ctor = false, is_dtor = false, is_const = false;
read_cdtor_const(n, is_ctor, is_dtor, is_const);
- for (xmlNodePtr p = n->children; p; p = p->next)
+ for (xmlNodePtr p = xml::first_child(n); p; p = xml::next_child(p))
{
- if (p->type != XML_ELEMENT_NODE)
- continue;
-
if (shared_ptr<function_tdecl> f =
build_function_tdecl(ctxt, p,
/*add_to_current_scope=*/true))
@@ -4944,11 +4872,11 @@ build_union_decl(read_context& ctxt,
ctxt.map_xml_node_to_decl(node, decl);
ctxt.key_type_decl(decl, id);
- for (xmlNodePtr n = node->children; !is_decl_only && n; n = n->next)
+ for (xmlNodePtr n = xml::first_child(node); n; n = xml::next_child(n))
{
- if (n->type != XML_ELEMENT_NODE)
- continue;
-
+ // See https://sourceware.org/bugzilla/show_bug.cgi?id=26591#c7.
+ if (is_decl_only)
+ continue;
if (xmlStrEqual(n->name, BAD_CAST("member-type")))
{
access_specifier access = private_access;
@@ -4956,11 +4884,8 @@ build_union_decl(read_context& ctxt,
ctxt.map_xml_node_to_decl(n, decl);
- for (xmlNodePtr p = n->children; p; p = p->next)
+ for (xmlNodePtr p = xml::first_child(n); p; p = xml::next_child(p))
{
- if (p->type != XML_ELEMENT_NODE)
- continue;
-
if (type_base_sptr t =
build_type(ctxt, p, /*add_to_current_scope=*/true))
{
@@ -4988,11 +4913,8 @@ build_union_decl(read_context& ctxt,
bool is_static = false;
read_static(n, is_static);
- for (xmlNodePtr p = n->children; p; p = p->next)
+ for (xmlNodePtr p = xml::first_child(n); p; p = xml::next_child(p))
{
- if (p->type != XML_ELEMENT_NODE)
- continue;
-
if (var_decl_sptr v =
build_var_decl(ctxt, p, /*add_to_cur_scope=*/false))
{
@@ -5030,11 +4952,8 @@ build_union_decl(read_context& ctxt,
bool is_ctor = false, is_dtor = false, is_const = false;
read_cdtor_const(n, is_ctor, is_dtor, is_const);
- for (xmlNodePtr p = n->children; p; p = p->next)
+ for (xmlNodePtr p = xml::first_child(n); p; p = xml::next_child(p))
{
- if (p->type != XML_ELEMENT_NODE)
- continue;
-
if (function_decl_sptr f =
build_function_decl_if_not_suppressed(ctxt, p, decl,
/*add_to_cur_sc=*/true))
@@ -5063,11 +4982,8 @@ build_union_decl(read_context& ctxt,
bool is_ctor = false, is_dtor = false, is_const = false;
read_cdtor_const(n, is_ctor, is_dtor, is_const);
- for (xmlNodePtr p = n->children; p; p = p->next)
+ for (xmlNodePtr p = xml::first_child(n); p; p = xml::next_child(p))
{
- if (p->type != XML_ELEMENT_NODE)
- continue;
-
if (function_tdecl_sptr f =
build_function_tdecl(ctxt, p,
/*add_to_current_scope=*/true))
@@ -5142,11 +5058,8 @@ build_function_tdecl(read_context& ctxt,
ctxt.push_decl_to_current_scope(fn_tmpl_decl, add_to_current_scope);
unsigned parm_index = 0;
- for (xmlNodePtr n = node->children; n; n = n->next)
+ for (xmlNodePtr n = xml::first_child(node); n; n = xml::next_child(n))
{
- if (n->type != XML_ELEMENT_NODE)
- continue;
-
if (template_parameter_sptr parm =
build_template_parameter(ctxt, n, parm_index, fn_tmpl_decl))
{
@@ -5206,11 +5119,8 @@ build_class_tdecl(read_context& ctxt,
ctxt.push_decl_to_current_scope(class_tmpl, add_to_current_scope);
unsigned parm_index = 0;
- for (xmlNodePtr n = node->children; n; n = n->next)
+ for (xmlNodePtr n = xml::first_child(node); n; n = xml::next_child(n))
{
- if (n->type != XML_ELEMENT_NODE)
- continue;
-
if (template_parameter_sptr parm=
build_template_parameter(ctxt, n, parm_index, class_tmpl))
{
@@ -5325,11 +5235,8 @@ build_type_composition(read_context& ctxt,
ctxt.push_decl_to_current_scope(dynamic_pointer_cast<decl_base>(result),
/*add_to_current_scope=*/true);
- for (xmlNodePtr n = node->children; n; n = n->next)
+ for (xmlNodePtr n = xml::first_child(node); n; n = xml::next_child(n))
{
- if (n->type != XML_ELEMENT_NODE)
- continue;
-
if ((composed_type =
build_pointer_type_def(ctxt, n,
/*add_to_current_scope=*/true))
@@ -5455,11 +5362,8 @@ build_template_tparameter(read_context& ctxt,
// Go parse template parameters that are children nodes
int parm_index = 0;
- for (xmlNodePtr n = node->children; n; n = n->next)
+ for (xmlNodePtr n = xml::first_child(node); n; n = xml::next_child(n))
{
- if (n->type != XML_ELEMENT_NODE)
- continue;
-
if (shared_ptr<template_parameter> p =
build_template_parameter(ctxt, n, parm_index, result))
{
@@ -197,6 +197,9 @@ test-abidiff-exit/test-non-leaf-array-v0.o \
test-abidiff-exit/test-non-leaf-array-v1.c \
test-abidiff-exit/test-non-leaf-array-v1.o \
test-abidiff-exit/test-non-leaf-array-report.txt \
+test-abidiff-exit/test-squished-v0.abi \
+test-abidiff-exit/test-squished-v1.abi \
+test-abidiff-exit/test-squished-report.txt \
\
test-diff-dwarf/test0-v0.cc \
test-diff-dwarf/test0-v0.o \
new file mode 100644
new file mode 100644
@@ -0,0 +1,43 @@
+<abi-corpus version='2.0' path='data/test-read-dwarf/test6.so'>
+ <elf-needed>
+ <dependency name='libstdc++.so.6'/>
+ <dependency name='libm.so.6'/>
+ <dependency name='libgcc_s.so.1'/>
+ <dependency name='libc.so.6'/>
+ </elf-needed>
+ <elf-function-symbols>
+ <elf-symbol name='_Z3barv' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+ <elf-symbol name='_Z4blehv' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+ <elf-symbol name='_ZN1B3fooEv' type='func-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
+ <elf-symbol name='_fini' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+ <elf-symbol name='_init' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+ </elf-function-symbols>
+ <elf-variable-symbols>
+ <elf-symbol name='_ZN1CIiE3barE' size='4' type='object-type' binding='gnu-unique-binding' visibility='default-visibility' is-defined='yes'/>
+ <elf-symbol name='_ZZN1B3fooEvE1a' size='4' type='object-type' binding='gnu-unique-binding' visibility='default-visibility' is-defined='yes'/>
+ </elf-variable-symbols>
+ <abi-instr address-size='64' path='test6.cc' comp-dir-path='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf' language='LANG_C_plus_plus'>
+ <type-decl name='int' size-in-bits='32' id='type-id-1'/>
+ <class-decl name='B' size-in-bits='8' is-struct='yes' visibility='default' filepath='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf/test6.cc' line='9' column='1' id='type-id-2'>
+ <member-function access='public'>
+ <function-decl name='foo' mangled-name='_ZN1B3fooEv' filepath='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf/test6.cc' line='11' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZN1B3fooEv'>
+ <parameter type-id='type-id-3' name='this' is-artificial='yes'/>
+ <return type-id='type-id-1'/>
+ </function-decl>
+ </member-function>
+ </class-decl>
+ <class-decl name='C<int>' size-in-bits='8' is-struct='yes' visibility='default' filepath='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf/test6.cc' line='26' column='1' id='type-id-4'>
+ <data-member access='public' static='yes'>
+ <var-decl name='bar' type-id='type-id-1' mangled-name='_ZN1CIiE3barE' visibility='default' filepath='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf/test6.cc' line='31' column='1' elf-symbol-id='_ZN1CIiE3barE'/>
+ </data-member>
+ </class-decl>
+ <pointer-type-def type-id='type-id-2' size-in-bits='64' id='type-id-5'/>
+ <qualified-type-def type-id='type-id-5' const='yes' id='type-id-3'/>
+ <function-decl name='bar' mangled-name='_Z3barv' filepath='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf/test6.cc' line='19' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_Z3barv'>
+ <return type-id='type-id-1'/>
+ </function-decl>
+ <function-decl name='bleh' mangled-name='_Z4blehv' filepath='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf/test6.cc' line='34' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_Z4blehv'>
+ <return type-id='type-id-1'/>
+ </function-decl>
+ </abi-instr>
+</abi-corpus>
new file mode 100644
@@ -0,0 +1 @@
+<abi-corpus version='2.0' path='data/test-read-dwarf/test6.so'><elf-needed><dependency name='libstdc++.so.6'/><dependency name='libm.so.6'/><dependency name='libgcc_s.so.1'/><dependency name='libc.so.6'/></elf-needed><elf-function-symbols><elf-symbol name='_Z3barv' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/><elf-symbol name='_Z4blehv' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/><elf-symbol name='_ZN1B3fooEv' type='func-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/><elf-symbol name='_fini' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/><elf-symbol name='_init' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/></elf-function-symbols><elf-variable-symbols><elf-symbol name='_ZN1CIiE3barE' size='4' type='object-type' binding='gnu-unique-binding' visibility='default-visibility' is-defined='yes'/><elf-symbol name='_ZZN1B3fooEvE1a' size='4' type='object-type' binding='gnu-unique-binding' visibility='default-visibility' is-defined='yes'/></elf-variable-symbols><abi-instr address-size='64' path='test6.cc' comp-dir-path='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf' language='LANG_C_plus_plus'><type-decl name='int' size-in-bits='32' id='type-id-1'/><class-decl name='B' size-in-bits='8' is-struct='yes' visibility='default' filepath='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf/test6.cc' line='9' column='1' id='type-id-2'><member-function access='public'><function-decl name='foo' mangled-name='_ZN1B3fooEv' filepath='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf/test6.cc' line='11' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZN1B3fooEv'><parameter type-id='type-id-3' name='this' is-artificial='yes'/><return type-id='type-id-1'/></function-decl></member-function></class-decl><class-decl name='C<int>' size-in-bits='8' is-struct='yes' visibility='default' filepath='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf/test6.cc' line='26' column='1' id='type-id-4'><data-member access='public' static='yes'><var-decl name='bar' type-id='type-id-1' mangled-name='_ZN1CIiE3barE' visibility='default' filepath='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf/test6.cc' line='31' column='1' elf-symbol-id='_ZN1CIiE3barE'/></data-member></class-decl><pointer-type-def type-id='type-id-2' size-in-bits='64' id='type-id-5'/><qualified-type-def type-id='type-id-5' const='yes' id='type-id-3'/><function-decl name='bar' mangled-name='_Z3barv' filepath='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf/test6.cc' line='19' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_Z3barv'><return type-id='type-id-1'/></function-decl><function-decl name='bleh' mangled-name='_Z4blehv' filepath='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf/test6.cc' line='34' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_Z4blehv'><return type-id='type-id-1'/></function-decl></abi-instr></abi-corpus>
\ No newline at end of file
@@ -392,6 +392,17 @@ InOutSpec in_out_specs[] =
"data/test-abidiff-exit/test-non-leaf-array-report.txt",
"output/test-abidiff-exit/test-non-leaf-array-report.txt"
},
+ {
+ "data/test-abidiff-exit/test-squished-v0.abi",
+ "data/test-abidiff-exit/test-squished-v1.abi",
+ "",
+ "",
+ "",
+ "--harmless",
+ abigail::tools_utils::ABIDIFF_OK,
+ "data/test-abidiff-exit/test-squished-report.txt",
+ "output/test-abidiff-exit/test-squished-report.txt"
+ },
{0, 0, 0 ,0, 0, 0, abigail::tools_utils::ABIDIFF_OK, 0, 0}
};