diff mbox series

[2/2] Add tests for abidw --type-id-style hash.

Message ID 20200612095917.2146-3-gprocida@google.com
State Committed
Headers show
Series Stable type ids | expand

Commit Message

Giuliano Procida June 12, 2020, 9:59 a.m. UTC
This commit adds some test cases to verify that the hashing is
actually stable across architectures.

	* tests/data/Makefile.am: Add new hash type id ABI files.
	* tests/test-read-dwarf.cc: (InOutSpec): Add type_id_style
	member. (in_out_specs): Set type_id_style to COUNTER in
	existing test specifications. Duplicate first 9 test cases
	with type_id_style set to HASH.
	* tests/data/test-read-dwarf/test0.hash.abi: New ABI XML file
	with hash type ids.
	* tests/data/test-read-dwarf/test1.hash.abi: Ditto.
	* tests/data/test-read-dwarf/test2.so.hash.abi: Ditto.
	* tests/data/test-read-dwarf/test3.so.hash.abi: Ditto.
	* tests/data/test-read-dwarf/test4.so.hash.abi: Ditto.
	* tests/data/test-read-dwarf/test5.o.hash.abi: Ditto.
	* tests/data/test-read-dwarf/test6.so.hash.abi: Ditto.
	* tests/data/test-read-dwarf/test7.so.hash.abi: Ditto.
	* tests/data/test-read-dwarf/test8-qualified-this-pointer.so.hash.abi:
	Ditto.

Signed-off-by: Giuliano Procida <gprocida@google.com>
---
 tests/data/Makefile.am                        |   9 ++
 tests/data/test-read-dwarf/test0.hash.abi     |  70 ++++++++++
 tests/data/test-read-dwarf/test1.hash.abi     | 129 ++++++++++++++++++
 tests/data/test-read-dwarf/test2.so.hash.abi  |  79 +++++++++++
 tests/data/test-read-dwarf/test3.so.hash.abi  |  19 +++
 tests/data/test-read-dwarf/test4.so.hash.abi  |  23 ++++
 tests/data/test-read-dwarf/test5.o.hash.abi   |  13 ++
 tests/data/test-read-dwarf/test6.so.hash.abi  |  42 ++++++
 tests/data/test-read-dwarf/test7.so.hash.abi  |  77 +++++++++++
 .../test8-qualified-this-pointer.so.hash.abi  |  37 +++++
 tests/test-read-dwarf.cc                      | 107 ++++++++++++++-
 11 files changed, 603 insertions(+), 2 deletions(-)
 create mode 100644 tests/data/test-read-dwarf/test0.hash.abi
 create mode 100644 tests/data/test-read-dwarf/test1.hash.abi
 create mode 100644 tests/data/test-read-dwarf/test2.so.hash.abi
 create mode 100644 tests/data/test-read-dwarf/test3.so.hash.abi
 create mode 100644 tests/data/test-read-dwarf/test4.so.hash.abi
 create mode 100644 tests/data/test-read-dwarf/test5.o.hash.abi
 create mode 100644 tests/data/test-read-dwarf/test6.so.hash.abi
 create mode 100644 tests/data/test-read-dwarf/test7.so.hash.abi
 create mode 100644 tests/data/test-read-dwarf/test8-qualified-this-pointer.so.hash.abi
diff mbox series

Patch

diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am
index 6592ba32..8ccd50a0 100644
--- a/tests/data/Makefile.am
+++ b/tests/data/Makefile.am
@@ -395,33 +395,42 @@  test-diff-dwarf/PR25058-liblttng-ctl2.10.so \
 \
 test-read-dwarf/test0			\
 test-read-dwarf/test0.abi			\
+test-read-dwarf/test0.hash.abi		\
 test-read-dwarf/test0.cc			\
 test-read-dwarf/test1			\
 test-read-dwarf/test1.abi			\
+test-read-dwarf/test1.hash.abi		\
 test-read-dwarf/test1.cc			\
 test-read-dwarf/test2.h		\
 test-read-dwarf/test2-0.cc		\
 test-read-dwarf/test2-1.cc		\
 test-read-dwarf/test2.so		\
 test-read-dwarf/test2.so.abi		\
+test-read-dwarf/test2.so.hash.abi	\
 test-read-dwarf/test3.c		\
 test-read-dwarf/test3.so		\
 test-read-dwarf/test3.so.abi		\
+test-read-dwarf/test3.so.hash.abi	\
 test-read-dwarf/test4.c		\
 test-read-dwarf/test4.so		\
 test-read-dwarf/test4.so.abi		\
+test-read-dwarf/test4.so.hash.abi	\
 test-read-dwarf/test5.cc		\
 test-read-dwarf/test5.o		\
 test-read-dwarf/test5.o.abi		\
+test-read-dwarf/test5.o.hash.abi	\
 test-read-dwarf/test6.cc		\
 test-read-dwarf/test6.so		\
 test-read-dwarf/test6.so.abi		\
+test-read-dwarf/test6.so.hash.abi	\
 test-read-dwarf/test7.cc		\
 test-read-dwarf/test7.so		\
 test-read-dwarf/test7.so.abi		\
+test-read-dwarf/test7.so.hash.abi	\
 test-read-dwarf/test8-qualified-this-pointer.cc		\
 test-read-dwarf/test8-qualified-this-pointer.so		\
 test-read-dwarf/test8-qualified-this-pointer.so.abi		\
+test-read-dwarf/test8-qualified-this-pointer.so.hash.abi	\
 test-read-dwarf/test9-pr18818-clang.so  \
 test-read-dwarf/test10-pr18818-gcc.so \
 test-read-dwarf/test9-pr18818-clang.so.abi  \
diff --git a/tests/data/test-read-dwarf/test0.hash.abi b/tests/data/test-read-dwarf/test0.hash.abi
new file mode 100644
index 00000000..3d34a9de
--- /dev/null
+++ b/tests/data/test-read-dwarf/test0.hash.abi
@@ -0,0 +1,70 @@ 
+<abi-corpus path='data/test-read-dwarf/test0'>
+  <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='_ZN3ns03barEiz' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZN3ns03bazERi' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZN3ns03fooEPcl' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZN3ns04bar2ERNS_1EE' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZN3ns04baz2ERi' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='__libc_csu_fini' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='__libc_csu_init' type='func-type' binding='global-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-symbol name='_start' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='main' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-function-symbols>
+  <elf-variable-symbols>
+    <elf-symbol name='_IO_stdin_used' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='global' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-variable-symbols>
+  <abi-instr version='1.0' address-size='64' path='test0.cc' comp-dir-path='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf' language='LANG_C_plus_plus'>
+    <type-decl name='char' size-in-bits='8' id='a84c031d'/>
+    <type-decl name='int' size-in-bits='32' id='95e97e5e'/>
+    <type-decl name='long int' size-in-bits='64' id='bd54fe1a'/>
+    <type-decl name='long long int' size-in-bits='64' id='1eb56b1e'/>
+    <type-decl name='unnamed-enum-underlying-type' is-anonymous='yes' size-in-bits='32' alignment-in-bits='32' id='6406df84'/>
+    <type-decl name='void' id='48b5725f'/>
+    <pointer-type-def type-id='a84c031d' size-in-bits='64' id='26a90f95'/>
+    <reference-type-def kind='lvalue' type-id='95e97e5e' size-in-bits='64' id='769216e8'/>
+    <reference-type-def kind='lvalue' type-id='383eb5fc' size-in-bits='64' id='b176607d'/>
+    <namespace-decl name='ns0'>
+      <function-decl name='bar' mangled-name='_ZN3ns03barEiz' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test0.cc' line='12' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZN3ns03barEiz'>
+        <parameter type-id='95e97e5e'/>
+        <parameter is-variadic='yes'/>
+        <return type-id='48b5725f'/>
+      </function-decl>
+      <function-decl name='baz' mangled-name='_ZN3ns03bazERi' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test0.cc' line='16' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZN3ns03bazERi'>
+        <parameter type-id='769216e8'/>
+        <return type-id='48b5725f'/>
+      </function-decl>
+      <enum-decl name='E' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test0.cc' line='19' column='1' id='383eb5fc'>
+        <underlying-type type-id='6406df84'/>
+        <enumerator name='e0' value='0'/>
+        <enumerator name='e1' value='1'/>
+      </enum-decl>
+      <function-decl name='bar2' mangled-name='_ZN3ns04bar2ERNS_1EE' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test0.cc' line='22' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZN3ns04bar2ERNS_1EE'>
+        <parameter type-id='b176607d'/>
+        <return type-id='48b5725f'/>
+      </function-decl>
+      <typedef-decl name='long_long' type-id='1eb56b1e' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test0.cc' line='25' column='1' id='0eabcaca'/>
+      <function-decl name='baz2' mangled-name='_ZN3ns04baz2ERi' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test0.cc' line='28' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZN3ns04baz2ERi'>
+        <parameter type-id='769216e8'/>
+        <return type-id='0eabcaca'/>
+      </function-decl>
+      <function-decl name='foo' mangled-name='_ZN3ns03fooEPcl' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test0.cc' line='45' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZN3ns03fooEPcl'>
+        <parameter type-id='26a90f95'/>
+        <parameter type-id='bd54fe1a'/>
+        <return type-id='bd54fe1a'/>
+      </function-decl>
+    </namespace-decl>
+    <function-decl name='main' mangled-name='main' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test0.cc' line='49' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='main'>
+      <return type-id='95e97e5e'/>
+    </function-decl>
+    <var-decl name='global' type-id='95e97e5e' mangled-name='global' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test0.cc' line='3' column='1' elf-symbol-id='global'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test1.hash.abi b/tests/data/test-read-dwarf/test1.hash.abi
new file mode 100644
index 00000000..0bd86868
--- /dev/null
+++ b/tests/data/test-read-dwarf/test1.hash.abi
@@ -0,0 +1,129 @@ 
+<abi-corpus path='data/test-read-dwarf/test1'>
+  <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='_Z3fooR2s0' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZN2b0C1Ev' type='func-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZN2b0C2Ev' type='func-type' binding='weak-binding' visibility='default-visibility' alias='_ZN2b0C1Ev' is-defined='yes'/>
+    <elf-symbol name='_ZN2b1C1Ev' type='func-type' binding='weak-binding' visibility='default-visibility' alias='_ZN2b1C2Ev' is-defined='yes'/>
+    <elf-symbol name='_ZN2b1C2Ev' type='func-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZN2s07mem_funEv' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZN2s0C1Ev' type='func-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZN2s0D1Ev' type='func-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='__libc_csu_fini' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='__libc_csu_init' type='func-type' binding='global-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-symbol name='_start' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='main' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-function-symbols>
+  <elf-variable-symbols>
+    <elf-symbol name='_IO_stdin_used' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZTI2b0' size='16' type='object-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZTI2b1' size='16' type='object-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZTI2s0' size='56' type='object-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZTS2b0' size='4' type='object-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZTS2b1' size='4' type='object-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZTS2s0' size='4' type='object-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZTT2s0' size='8' type='object-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZTV2s0' size='32' type='object-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZTVN10__cxxabiv117__class_type_infoE@@CXXABI_1.3' size='88' type='object-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZTVN10__cxxabiv121__vmi_class_type_infoE@@CXXABI_1.3' size='88' type='object-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-variable-symbols>
+  <abi-instr version='1.0' address-size='64' path='test1.cc' comp-dir-path='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf' language='LANG_C_plus_plus'>
+    <type-decl name='char' size-in-bits='8' id='a84c031d'/>
+    <type-decl name='double' size-in-bits='64' id='a0eb0f08'/>
+    <type-decl name='int' size-in-bits='32' id='95e97e5e'/>
+    <type-decl name='long long int' size-in-bits='64' id='1eb56b1e'/>
+    <type-decl name='unsigned char' size-in-bits='8' id='002ac4a6'/>
+    <type-decl name='void' id='48b5725f'/>
+    <class-decl name='b0' size-in-bits='128' is-struct='yes' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test1.cc' line='1' column='1' id='96c6f7f7'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='m0' type-id='1eb56b1e' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test1.cc' line='3' column='1'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='64'>
+        <var-decl name='m1' type-id='a84c031d' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test1.cc' line='4' column='1'/>
+      </data-member>
+    </class-decl>
+    <class-decl name='b1' size-in-bits='128' is-struct='yes' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test1.cc' line='7' column='1' id='95c6f664'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='m0' type-id='a0eb0f08' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test1.cc' line='9' column='1'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='64'>
+        <var-decl name='m1' type-id='a84c031d' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test1.cc' line='10' column='1'/>
+      </data-member>
+    </class-decl>
+    <class-decl name='s0' size-in-bits='384' is-struct='yes' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test1.cc' line='13' column='1' id='10ec88de'>
+      <base-class access='public' layout-offset-in-bits='192' is-virtual='yes' type-id='96c6f7f7'/>
+      <base-class access='public' layout-offset-in-bits='256' is-virtual='yes' type-id='95c6f664'/>
+
+        <member-type access='public'>
+          <typedef-decl name='integer' type-id='95e97e5e' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test1.cc' line='15' column='1' id='61814d27'/>
+        </member-type>
+
+        <member-type access='public'>
+          <typedef-decl name='byte' type-id='002ac4a6' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test1.cc' line='16' column='1' id='92bf8355'/>
+        </member-type>
+      <data-member access='public' layout-offset-in-bits='64'>
+        <var-decl name='m0' type-id='61814d27' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test1.cc' line='18' column='1'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='96'>
+        <var-decl name='m1' type-id='92bf8355' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test1.cc' line='19' column='1'/>
+      </data-member>
+      <member-function access='public' constructor='yes'>
+        <function-decl name='s0' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test1.cc' line='21' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <parameter type-id='a1a34114' is-artificial='yes'/>
+          <parameter type-id='95e97e5e' is-artificial='yes'/>
+          <parameter type-id='63e171df' is-artificial='yes'/>
+          <return type-id='48b5725f'/>
+        </function-decl>
+      </member-function>
+      <member-function access='public' destructor='yes'>
+        <function-decl name='~s0' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test1.cc' line='27' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <parameter type-id='a1a34114' is-artificial='yes'/>
+          <parameter type-id='95e97e5e' is-artificial='yes'/>
+          <parameter type-id='63e171df' is-artificial='yes'/>
+          <return type-id='48b5725f'/>
+        </function-decl>
+      </member-function>
+      <member-function access='public'>
+        <function-decl name='mem_fun' mangled-name='_ZN2s07mem_funEv' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test1.cc' line='36' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZN2s07mem_funEv'>
+          <parameter type-id='a1a34114' is-artificial='yes'/>
+          <return type-id='61814d27'/>
+        </function-decl>
+      </member-function>
+      <member-function access='public' constructor='yes'>
+        <function-decl name='s0' mangled-name='_ZN2s0C1Ev' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test1.cc' line='21' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZN2s0C1Ev'>
+          <parameter type-id='a1a34114' is-artificial='yes'/>
+          <parameter type-id='95e97e5e' is-artificial='yes'/>
+          <parameter type-id='63e171df' is-artificial='yes'/>
+          <return type-id='48b5725f'/>
+        </function-decl>
+      </member-function>
+      <member-function access='public' destructor='yes'>
+        <function-decl name='~s0' mangled-name='_ZN2s0D1Ev' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test1.cc' line='27' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZN2s0D1Ev'>
+          <parameter type-id='a1a34114' is-artificial='yes'/>
+          <parameter type-id='95e97e5e' is-artificial='yes'/>
+          <parameter type-id='63e171df' is-artificial='yes'/>
+          <return type-id='48b5725f'/>
+        </function-decl>
+      </member-function>
+    </class-decl>
+    <qualified-type-def type-id='95a32e30' id='95a32e31'/>
+    <reference-type-def kind='lvalue' type-id='10ec88de' size-in-bits='64' id='95a32e30'/>
+    <pointer-type-def type-id='10ec88de' size-in-bits='64' id='a1a34114'/>
+    <pointer-type-def type-id='48b5725f' size-in-bits='64' id='eaa32e2f'/>
+    <pointer-type-def type-id='eaa32e2f' size-in-bits='64' id='63e171df'/>
+    <function-decl name='foo' mangled-name='_Z3fooR2s0' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test1.cc' line='42' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_Z3fooR2s0'>
+      <parameter type-id='95a32e31' name='s' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test1.cc' line='42' column='1'/>
+      <return type-id='48b5725f'/>
+    </function-decl>
+    <function-decl name='main' mangled-name='main' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test1.cc' line='48' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='main'>
+      <return type-id='95e97e5e'/>
+    </function-decl>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test2.so.hash.abi b/tests/data/test-read-dwarf/test2.so.hash.abi
new file mode 100644
index 00000000..bb814f73
--- /dev/null
+++ b/tests/data/test-read-dwarf/test2.so.hash.abi
@@ -0,0 +1,79 @@ 
+<abi-corpus path='data/test-read-dwarf/test2.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='_ZN10first_typeC1Ev' type='func-type' binding='global-binding' visibility='default-visibility' alias='_ZN10first_typeC2Ev' is-defined='yes'/>
+    <elf-symbol name='_ZN10first_typeC2Ev' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZN11second_typeC1Ev' type='func-type' binding='global-binding' visibility='default-visibility' alias='_ZN11second_typeC2Ev' is-defined='yes'/>
+    <elf-symbol name='_ZN11second_typeC2Ev' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZN1a16build_first_typeEv' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='_ZN1a17build_second_typeEv' type='func-type' binding='global-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>
+  <abi-instr version='1.0' address-size='64' path='test2-0.cc' comp-dir-path='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf' language='LANG_C_plus_plus'>
+    <type-decl name='int' size-in-bits='32' id='95e97e5e'/>
+    <typedef-decl name='character' type-id='002ac4a6' id='8ec86933'/>
+    <typedef-decl name='integer' type-id='95e97e5e' id='c2cab9c6'/>
+    <type-decl name='unsigned char' size-in-bits='8' id='002ac4a6'/>
+    <type-decl name='void' id='48b5725f'/>
+    <class-decl name='first_type' size-in-bits='64' is-struct='yes' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2.h' line='4' column='1' id='55265432'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='member0' type-id='c2cab9c6' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2.h' line='6' column='1'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='32'>
+        <var-decl name='member1' type-id='8ec86933' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2.h' line='7' column='1'/>
+      </data-member>
+      <member-function access='public' constructor='yes'>
+        <function-decl name='first_type' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2.h' line='9' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <parameter type-id='82c95d70' is-artificial='yes'/>
+          <return type-id='48b5725f'/>
+        </function-decl>
+      </member-function>
+      <member-function access='public' constructor='yes'>
+        <function-decl name='first_type' mangled-name='_ZN10first_typeC2Ev' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2.h' line='9' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZN10first_typeC1Ev'>
+          <parameter type-id='82c95d70' is-artificial='yes'/>
+          <return type-id='48b5725f'/>
+        </function-decl>
+      </member-function>
+    </class-decl>
+    <pointer-type-def type-id='55265432' size-in-bits='64' id='82c95d70'/>
+    <namespace-decl name='a'>
+      <function-decl name='build_first_type' mangled-name='_ZN1a16build_first_typeEv' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2-0.cc' line='13' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZN1a16build_first_typeEv'>
+        <return type-id='82c95d70'/>
+      </function-decl>
+    </namespace-decl>
+  </abi-instr>
+  <abi-instr version='1.0' address-size='64' path='test2-1.cc' comp-dir-path='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf' language='LANG_C_plus_plus'>
+    <class-decl name='second_type' size-in-bits='64' is-struct='yes' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2.h' line='12' column='1' id='cf111fae'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='member0' type-id='c2cab9c6' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2.h' line='14' column='1'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='32'>
+        <var-decl name='member1' type-id='8ec86933' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2.h' line='15' column='1'/>
+      </data-member>
+      <member-function access='public' constructor='yes'>
+        <function-decl name='second_type' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2.h' line='17' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <parameter type-id='fc0abc74' is-artificial='yes'/>
+          <return type-id='48b5725f'/>
+        </function-decl>
+      </member-function>
+      <member-function access='public' constructor='yes'>
+        <function-decl name='second_type' mangled-name='_ZN11second_typeC2Ev' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2.h' line='17' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZN11second_typeC1Ev'>
+          <parameter type-id='fc0abc74' is-artificial='yes'/>
+          <return type-id='48b5725f'/>
+        </function-decl>
+      </member-function>
+    </class-decl>
+    <pointer-type-def type-id='cf111fae' size-in-bits='64' id='fc0abc74'/>
+    <namespace-decl name='a'>
+      <function-decl name='build_second_type' mangled-name='_ZN1a17build_second_typeEv' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2-1.cc' line='13' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZN1a17build_second_typeEv'>
+        <return type-id='fc0abc74'/>
+      </function-decl>
+    </namespace-decl>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test3.so.hash.abi b/tests/data/test-read-dwarf/test3.so.hash.abi
new file mode 100644
index 00000000..e01f3959
--- /dev/null
+++ b/tests/data/test-read-dwarf/test3.so.hash.abi
@@ -0,0 +1,19 @@ 
+<abi-corpus path='data/test-read-dwarf/test3.so' soname='test3.so.1'>
+  <elf-needed>
+    <dependency name='libc.so.6'/>
+  </elf-needed>
+  <elf-function-symbols>
+    <elf-symbol name='__foo' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='__foo__' type='func-type' binding='global-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-symbol name='foo' type='func-type' binding='weak-binding' visibility='default-visibility' alias='foo__,__foo__,__foo' is-defined='yes'/>
+    <elf-symbol name='foo__' type='func-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-function-symbols>
+  <abi-instr version='1.0' address-size='64' path='test3.c' comp-dir-path='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf' language='LANG_C89'>
+    <type-decl name='void' id='48b5725f'/>
+    <function-decl name='__foo' mangled-name='foo' filepath='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf/test3.c' line='8' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='foo'>
+      <return type-id='48b5725f'/>
+    </function-decl>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test4.so.hash.abi b/tests/data/test-read-dwarf/test4.so.hash.abi
new file mode 100644
index 00000000..446df1da
--- /dev/null
+++ b/tests/data/test-read-dwarf/test4.so.hash.abi
@@ -0,0 +1,23 @@ 
+<abi-corpus path='data/test-read-dwarf/test4.so'>
+  <elf-needed>
+    <dependency name='libc.so.6'/>
+  </elf-needed>
+  <elf-function-symbols>
+    <elf-symbol name='cpy' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-function-symbols>
+  <abi-instr version='1.0' address-size='64' path='test4.c' comp-dir-path='/home/mark/src/tests' language='LANG_C89'>
+    <type-decl name='char' size-in-bits='8' id='a84c031d'/>
+    <type-decl name='unsigned int' size-in-bits='32' id='f0981eeb'/>
+    <pointer-type-def type-id='a84c031d' size-in-bits='64' id='26a90f95'/>
+    <qualified-type-def type-id='26a90f95' restrict='yes' id='266fe297'/>
+    <qualified-type-def type-id='a84c031d' const='yes' id='9b45d938'/>
+    <pointer-type-def type-id='9b45d938' size-in-bits='64' id='80f4b756'/>
+    <qualified-type-def type-id='80f4b756' restrict='yes' id='9d26089a'/>
+    <function-decl name='cpy' mangled-name='cpy' filepath='/home/mark/src/tests/test4.c' line='2' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='cpy'>
+      <parameter type-id='266fe297' name='s1' filepath='/home/mark/src/tests/test4.c' line='2' column='1'/>
+      <parameter type-id='9d26089a' name='s2' filepath='/home/mark/src/tests/test4.c' line='2' column='1'/>
+      <parameter type-id='f0981eeb' name='n' filepath='/home/mark/src/tests/test4.c' line='2' column='1'/>
+      <return type-id='26a90f95'/>
+    </function-decl>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test5.o.hash.abi b/tests/data/test-read-dwarf/test5.o.hash.abi
new file mode 100644
index 00000000..9ed9932a
--- /dev/null
+++ b/tests/data/test-read-dwarf/test5.o.hash.abi
@@ -0,0 +1,13 @@ 
+<abi-corpus path='data/test-read-dwarf/test5.o'>
+  <elf-function-symbols>
+    <elf-symbol name='_Z3barPv' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-function-symbols>
+  <abi-instr version='1.0' address-size='64' path='test.cc' comp-dir-path='/home/dodji/libabigailtests' language='LANG_C_plus_plus'>
+    <type-decl name='void' id='48b5725f'/>
+    <pointer-type-def type-id='48b5725f' size-in-bits='64' id='eaa32e2f'/>
+    <function-decl name='bar' mangled-name='_Z3barPv' filepath='/home/dodji/libabigailtests/test.cc' line='2' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_Z3barPv'>
+      <parameter type-id='eaa32e2f'/>
+      <return type-id='48b5725f'/>
+    </function-decl>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test6.so.hash.abi b/tests/data/test-read-dwarf/test6.so.hash.abi
new file mode 100644
index 00000000..7867a28f
--- /dev/null
+++ b/tests/data/test-read-dwarf/test6.so.hash.abi
@@ -0,0 +1,42 @@ 
+<abi-corpus 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 version='1.0' 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='95e97e5e'/>
+    <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='41d98c5d'>
+      <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='06dd347d' is-artificial='yes'/>
+          <return type-id='95e97e5e'/>
+        </function-decl>
+      </member-function>
+    </class-decl>
+    <class-decl name='C&lt;int&gt;' 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='923eef9f'>
+      <data-member access='public' static='yes'>
+        <var-decl name='bar' type-id='95e97e5e' 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='41d98c5d' size-in-bits='64' id='06dd347d'/>
+    <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='95e97e5e'/>
+    </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='95e97e5e'/>
+    </function-decl>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test7.so.hash.abi b/tests/data/test-read-dwarf/test7.so.hash.abi
new file mode 100644
index 00000000..a04025f6
--- /dev/null
+++ b/tests/data/test-read-dwarf/test7.so.hash.abi
@@ -0,0 +1,77 @@ 
+<abi-corpus path='data/test-read-dwarf/test7.so'>
+  <elf-function-symbols>
+    <elf-symbol name='_Z3fooR1S' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-function-symbols>
+  <abi-instr version='1.0' address-size='64' path='test7.cc' comp-dir-path='/home/ooprala/rh/u/libabigail/tests/data/test-read-dwarf' language='LANG_C_plus_plus'>
+
+
+
+
+
+
+
+    <type-decl name='char' size-in-bits='8' id='a84c031d'/>
+    <array-type-def dimensions='1' type-id='26a90f95' size-in-bits='448' id='0626c76e'>
+      <subrange length='7' type-id='4c87fef4' id='16fc326e'/>
+
+    </array-type-def>
+    <array-type-def dimensions='1' type-id='a84c031d' size-in-bits='8' id='89feb1ec'>
+      <subrange length='1' type-id='4c87fef4' id='52f813b4'/>
+
+    </array-type-def>
+    <array-type-def dimensions='1' type-id='a84c031d' size-in-bits='infinite' id='e84913bd'>
+      <subrange length='infinite' type-id='4c87fef4' id='031f2035'/>
+
+    </array-type-def>
+    <type-decl name='double' size-in-bits='64' id='a0eb0f08'/>
+    <array-type-def dimensions='2' type-id='a0eb0f08' size-in-bits='960' id='9ba86d8c'>
+      <subrange length='5' type-id='4c87fef4' id='53010e10'/>
+
+      <subrange length='3' type-id='4c87fef4' id='56f209d2'/>
+
+    </array-type-def>
+    <type-decl name='int' size-in-bits='32' id='95e97e5e'/>
+    <array-type-def dimensions='1' type-id='7292109c' size-in-bits='256' id='5abcdf1a'>
+      <subrange length='4' type-id='4c87fef4' id='16fe7105'/>
+
+    </array-type-def>
+    <array-type-def dimensions='1' type-id='07535890' size-in-bits='640' id='bea34bd7'>
+      <subrange length='10' type-id='4c87fef4' id='487da03a'/>
+
+    </array-type-def>
+    <array-type-def dimensions='1' type-id='95e97e5e' size-in-bits='160' id='e41e1db9'>
+      <subrange length='5' type-id='4c87fef4' id='53010e10'/>
+
+    </array-type-def>
+    <type-decl name='sizetype' size-in-bits='64' id='4c87fef4'/>
+    <class-decl name='S' size-in-bits='2304' is-struct='yes' visibility='default' filepath='/home/ooprala/rh/u/libabigail/tests/data/test-read-dwarf/test7.cc' line='1' column='1' id='50d9a3fa'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='a' type-id='e41e1db9' visibility='default' filepath='/home/ooprala/rh/u/libabigail/tests/data/test-read-dwarf/test7.cc' line='3' column='1'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='192'>
+        <var-decl name='b' type-id='0626c76e' visibility='default' filepath='/home/ooprala/rh/u/libabigail/tests/data/test-read-dwarf/test7.cc' line='4' column='1'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='640'>
+        <var-decl name='c' type-id='9ba86d8c' visibility='default' filepath='/home/ooprala/rh/u/libabigail/tests/data/test-read-dwarf/test7.cc' line='5' column='1'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='1600'>
+        <var-decl name='d' type-id='bea34bd7' visibility='default' filepath='/home/ooprala/rh/u/libabigail/tests/data/test-read-dwarf/test7.cc' line='6' column='1'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='2240'>
+        <var-decl name='e' type-id='89feb1ec' visibility='default' filepath='/home/ooprala/rh/u/libabigail/tests/data/test-read-dwarf/test7.cc' line='7' column='1'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='2248'>
+        <var-decl name='f' type-id='e84913bd' visibility='default' filepath='/home/ooprala/rh/u/libabigail/tests/data/test-read-dwarf/test7.cc' line='8' column='1'/>
+      </data-member>
+    </class-decl>
+    <qualified-type-def type-id='f901ef4c' id='f901ef4d'/>
+    <reference-type-def kind='lvalue' type-id='50d9a3fa' size-in-bits='64' id='f901ef4c'/>
+    <pointer-type-def type-id='a84c031d' size-in-bits='64' id='26a90f95'/>
+    <pointer-type-def type-id='95e97e5e' size-in-bits='64' id='7292109c'/>
+    <pointer-type-def type-id='5abcdf1a' size-in-bits='64' id='07535890'/>
+    <function-decl name='foo' mangled-name='_Z3fooR1S' filepath='/home/ooprala/rh/u/libabigail/tests/data/test-read-dwarf/test7.cc' line='11' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_Z3fooR1S'>
+      <parameter type-id='f901ef4d'/>
+      <return type-id='95e97e5e'/>
+    </function-decl>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test8-qualified-this-pointer.so.hash.abi b/tests/data/test-read-dwarf/test8-qualified-this-pointer.so.hash.abi
new file mode 100644
index 00000000..7197425d
--- /dev/null
+++ b/tests/data/test-read-dwarf/test8-qualified-this-pointer.so.hash.abi
@@ -0,0 +1,37 @@ 
+<abi-corpus path='data/test-read-dwarf/test8-qualified-this-pointer.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='_ZNK1S3fooEv' type='func-type' binding='global-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>
+  <abi-instr version='1.0' address-size='64' path='test8-qualified-this-pointer.cc' comp-dir-path='/home/dodji/git/libabigail/master/tests/data/test-read-dwarf' language='LANG_C_plus_plus'>
+    <type-decl name='int' size-in-bits='32' id='95e97e5e'/>
+    <type-decl name='void' id='48b5725f'/>
+    <class-decl name='S' size-in-bits='32' is-struct='yes' visibility='default' filepath='/home/dodji/git/libabigail/master/tests/data/test-read-dwarf/test8-qualified-this-pointer.cc' line='1' column='1' id='50d9a3fa'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='i' type-id='95e97e5e' visibility='default' filepath='/home/dodji/git/libabigail/master/tests/data/test-read-dwarf/test8-qualified-this-pointer.cc' line='3' column='1'/>
+      </data-member>
+      <member-function access='public' constructor='yes'>
+        <function-decl name='S' filepath='/home/dodji/git/libabigail/master/tests/data/test-read-dwarf/test8-qualified-this-pointer.cc' line='5' column='1' visibility='default' binding='global' size-in-bits='64'>
+          <parameter type-id='fd01f598' is-artificial='yes'/>
+          <return type-id='48b5725f'/>
+        </function-decl>
+      </member-function>
+      <member-function access='public' const='yes'>
+        <function-decl name='foo' mangled-name='_ZNK1S3fooEv' filepath='/home/dodji/git/libabigail/master/tests/data/test-read-dwarf/test8-qualified-this-pointer.cc' line='10' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZNK1S3fooEv'>
+          <parameter type-id='2ee6aa55' is-artificial='yes'/>
+          <return type-id='95e97e5e'/>
+        </function-decl>
+      </member-function>
+    </class-decl>
+    <pointer-type-def type-id='50d9a3fa' size-in-bits='64' id='fd01f598'/>
+    <qualified-type-def type-id='50d9a3fa' const='yes' id='0fb3b55d'/>
+    <pointer-type-def type-id='0fb3b55d' size-in-bits='64' id='2ee6aa55'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/test-read-dwarf.cc b/tests/test-read-dwarf.cc
index ecc70cda..5c653f45 100644
--- a/tests/test-read-dwarf.cc
+++ b/tests/test-read-dwarf.cc
@@ -46,7 +46,11 @@  using abigail::dwarf_reader::read_corpus_from_elf;
 using abigail::dwarf_reader::read_context;
 using abigail::dwarf_reader::read_context_sptr;
 using abigail::dwarf_reader::create_read_context;
+using abigail::xml_writer::COUNTER;
+using abigail::xml_writer::HASH;
 using abigail::xml_writer::create_write_context;
+using abigail::xml_writer::set_type_id_style;
+using abigail::xml_writer::type_id_style_kind;
 using abigail::xml_writer::write_context_sptr;
 using abigail::xml_writer::write_corpus;
 
@@ -56,6 +60,7 @@  struct InOutSpec
 {
   const char* in_elf_path;
   const char* in_suppr_spec_path;
+  type_id_style_kind type_id_style;
   const char* in_abi_path;
   const char* out_abi_path;
 };// end struct InOutSpec
@@ -66,174 +71,266 @@  InOutSpec in_out_specs[] =
   {
     "data/test-read-dwarf/test0",
     "",
+    COUNTER,
     "data/test-read-dwarf/test0.abi",
     "output/test-read-dwarf/test0.abi"
   },
+  {
+    "data/test-read-dwarf/test0",
+    "",
+    HASH,
+    "data/test-read-dwarf/test0.hash.abi",
+    "output/test-read-dwarf/test0.hash.abi"
+  },
   {
     "data/test-read-dwarf/test1",
     "",
+    COUNTER,
     "data/test-read-dwarf/test1.abi",
     "output/test-read-dwarf/test1.abi"
   },
+  {
+    "data/test-read-dwarf/test1",
+    "",
+    HASH,
+    "data/test-read-dwarf/test1.hash.abi",
+    "output/test-read-dwarf/test1.hash.abi"
+  },
   {
     "data/test-read-dwarf/test2.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test2.so.abi",
     "output/test-read-dwarf/test2.so.abi"
   },
+  {
+    "data/test-read-dwarf/test2.so",
+    "",
+    HASH,
+    "data/test-read-dwarf/test2.so.hash.abi",
+    "output/test-read-dwarf/test2.so.hash.abi"
+  },
   {
     "data/test-read-dwarf/test3.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test3.so.abi",
     "output/test-read-dwarf/test3.so.abi"
   },
+  {
+    "data/test-read-dwarf/test3.so",
+    "",
+    HASH,
+    "data/test-read-dwarf/test3.so.hash.abi",
+    "output/test-read-dwarf/test3.so.hash.abi"
+  },
   {
     "data/test-read-dwarf/test4.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test4.so.abi",
     "output/test-read-dwarf/test4.so.abi"
   },
+  {
+    "data/test-read-dwarf/test4.so",
+    "",
+    HASH,
+    "data/test-read-dwarf/test4.so.hash.abi",
+    "output/test-read-dwarf/test4.so.hash.abi"
+  },
   {
     "data/test-read-dwarf/test5.o",
     "",
+    COUNTER,
     "data/test-read-dwarf/test5.o.abi",
     "output/test-read-dwarf/test5.o.abi"
   },
+  {
+    "data/test-read-dwarf/test5.o",
+    "",
+    HASH,
+    "data/test-read-dwarf/test5.o.hash.abi",
+    "output/test-read-dwarf/test5.o.hash.abi"
+  },
   {
     "data/test-read-dwarf/test6.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test6.so.abi",
     "output/test-read-dwarf/test6.so.abi"
   },
+  {
+    "data/test-read-dwarf/test6.so",
+    "",
+    HASH,
+    "data/test-read-dwarf/test6.so.hash.abi",
+    "output/test-read-dwarf/test6.so.hash.abi"
+  },
   {
     "data/test-read-dwarf/test7.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test7.so.abi",
     "output/test-read-dwarf/test7.so.abi"
   },
+  {
+    "data/test-read-dwarf/test7.so",
+    "",
+    HASH,
+    "data/test-read-dwarf/test7.so.hash.abi",
+    "output/test-read-dwarf/test7.so.hash.abi"
+  },
   {
     "data/test-read-dwarf/test8-qualified-this-pointer.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test8-qualified-this-pointer.so.abi",
     "output/test-read-dwarf/test8-qualified-this-pointer.so.abi"
   },
+  {
+    "data/test-read-dwarf/test8-qualified-this-pointer.so",
+    "",
+    HASH,
+    "data/test-read-dwarf/test8-qualified-this-pointer.so.hash.abi",
+    "output/test-read-dwarf/test8-qualified-this-pointer.so.hash.abi"
+  },
   {
     "data/test-read-dwarf/test9-pr18818-clang.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test9-pr18818-clang.so.abi",
     "output/test-read-dwarf/test9-pr18818-clang.so.abi"
   },
   {
     "data/test-read-dwarf/test10-pr18818-gcc.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test10-pr18818-gcc.so.abi",
     "output/test-read-dwarf/test10-pr18818-gcc.so.abi"
   },
   {
     "data/test-read-dwarf/test11-pr18828.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test11-pr18828.so.abi",
     "output/test-read-dwarf/test11-pr18828.so.abi",
   },
   {
     "data/test-read-dwarf/test12-pr18844.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test12-pr18844.so.abi",
     "output/test-read-dwarf/test12-pr18844.so.abi",
   },
   {
     "data/test-read-dwarf/test13-pr18894.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test13-pr18894.so.abi",
     "output/test-read-dwarf/test13-pr18894.so.abi",
   },
   {
     "data/test-read-dwarf/test14-pr18893.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test14-pr18893.so.abi",
     "output/test-read-dwarf/test14-pr18893.so.abi",
   },
   {
     "data/test-read-dwarf/test15-pr18892.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test15-pr18892.so.abi",
     "output/test-read-dwarf/test15-pr18892.so.abi",
   },
   {
     "data/test-read-dwarf/test16-pr18904.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test16-pr18904.so.abi",
     "output/test-read-dwarf/test16-pr18904.so.abi",
   },
   {
     "data/test-read-dwarf/test17-pr19027.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test17-pr19027.so.abi",
     "output/test-read-dwarf/test17-pr19027.so.abi",
   },
   {
     "data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi",
     "output/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi",
   },
   {
     "data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi",
     "output/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi",
   },
   {
     "data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi",
     "output/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi",
   },
   {
     "data/test-read-dwarf/test21-pr19092.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test21-pr19092.so.abi",
     "output/test-read-dwarf/test21-pr19092.so.abi",
   },
   {
     "data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi",
     "output/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi",
   },
   {
     "data/test-read-dwarf/libtest23.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/libtest23.so.abi",
     "output/test-read-dwarf/libtest23.so.abi",
   },
   {
     "data/test-read-dwarf/libtest24-drop-fns.so",
     "data/test-read-dwarf/test24-drop-fns-0.suppr",
+    COUNTER,
     "data/test-read-dwarf/libtest24-drop-fns.so.abi",
     "output/test-read-dwarf/libtest24-drop-fns.so.abi",
   },
   {
     "data/test-read-dwarf/libtest24-drop-fns.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/libtest24-drop-fns-2.so.abi",
     "output/test-read-dwarf/libtest24-drop-fns-2.so.abi",
   },
   {
     "data/test-read-dwarf/PR22015-libboost_iostreams.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/PR22015-libboost_iostreams.so.abi",
     "output/test-read-dwarf/PR22015-libboost_iostreams.so.abi",
   },
   {
     "data/test-read-dwarf/PR22122-libftdc.so",
     "",
+    COUNTER,
     "data/test-read-dwarf/PR22122-libftdc.so.abi",
     "output/test-read-dwarf/PR22122-libftdc.so.abi",
   },
   {
     "data/test-read-dwarf/PR24378-fn-is-not-scope.o",
     "",
+    COUNTER,
     "data/test-read-dwarf/PR24378-fn-is-not-scope.abi",
     "output/test-read-dwarf/PR24378-fn-is-not-scope.abi",
   },
@@ -241,6 +338,7 @@  InOutSpec in_out_specs[] =
   {
     "data/test-read-dwarf/PR25007-sdhci.ko",
     "",
+    COUNTER,
     "data/test-read-dwarf/PR25007-sdhci.ko.abi",
     "output/test-read-dwarf/PR25007-sdhci.ko.abi",
   },
@@ -249,6 +347,7 @@  InOutSpec in_out_specs[] =
   {
     "data/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0",
     "",
+    COUNTER,
     "data/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi",
     "output/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi",
   },
@@ -256,23 +355,26 @@  InOutSpec in_out_specs[] =
   {
     "data/test-read-dwarf/test25-bogus-binary.elf",
     "",
+    COUNTER,
     nullptr,
     nullptr,
   },
   {
     "data/test-read-dwarf/test26-bogus-binary.elf",
     "",
+    COUNTER,
     nullptr,
     nullptr,
   },
   {
     "data/test-read-dwarf/test27-bogus-binary.elf",
     "",
+    COUNTER,
     nullptr,
     nullptr,
   },
   // This should be the last entry.
-  {NULL, NULL, NULL, NULL}
+  {NULL, NULL, COUNTER, NULL, NULL}
 };
 
 using abigail::suppr::suppression_sptr;
@@ -378,8 +480,9 @@  struct test_task : public abigail::workers::task
 	is_ok = false;
 	return;
       }
-    const write_context_sptr write_ctxt
+    write_context_sptr write_ctxt
 	= create_write_context(corp->get_environment(), of);
+    set_type_id_style(*write_ctxt, spec.type_id_style);
     is_ok = write_corpus(*write_ctxt, corp, /*indent=*/0);
     of.close();