diff --git a/tests/Makefile.am b/tests/Makefile.am
index e3855aea..17e2d4b4 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -25,6 +25,10 @@ runtestdifffilter		\
 runtestreaddwarf	        \
 runtestcanonicalizetypes.sh
 
+if CTF_READER
+TESTS += runtestreadctf
+endif
+
 # rather cheap tests
 TESTS+=				\
 runtestabicompat		\
@@ -72,7 +76,7 @@ runtestcanonicalizetypes.output.final.txt
 
 noinst_PROGRAMS= $(TESTS) testirwalker testdiff2 printdifftree
 noinst_SCRIPTS = mockfedabipkgdiff
-noinst_LTLIBRARIES = libtestutils.la libcatch.la
+noinst_LTLIBRARIES = libtestutils.la libtestreadcommon.la libcatch.la
 
 libtestutils_la_SOURCES=	\
 test-utils.h 			\
@@ -82,15 +86,31 @@ libtestutils_la_CXXFLAGS=		\
 -DABIGAIL_SRC_DIR=\"${abs_top_srcdir}\"  	\
 -DABIGAIL_BUILD_DIR=\"${abs_top_builddir}\"
 
+libtestreadcommon_la_SOURCES=	\
+test-read-common.h 		\
+test-read-common.cc
+
+libtestreadcommon_la_CXXFLAGS=			\
+-DABIGAIL_SRC_DIR=\"${abs_top_srcdir}\"  	\
+-DABIGAIL_BUILD_DIR=\"${abs_top_builddir}\"
+
 libcatch_la_SOURCES = lib/catch.cc lib/catch.hpp
 
 runtestreadwrite_SOURCES=test-read-write.cc
 runtestreadwrite_LDADD=libtestutils.la $(top_builddir)/src/libabigail.la
 
 runtestreaddwarf_SOURCES=test-read-dwarf.cc
-runtestreaddwarf_LDADD=libtestutils.la $(top_builddir)/src/libabigail.la
+runtestreaddwarf_LDADD=libtestreadcommon.la libtestutils.la	\
+		       $(top_builddir)/src/libabigail.la
 runtestreaddwarf_LDFLAGS=-pthread
 
+if CTF_READER
+runtestreadctf_SOURCES=test-read-ctf.cc
+runtestreadctf_LDADD=libtestreadcommon.la libtestutils.la	\
+		     $(top_builddir)/src/libabigail.la
+runtestreadctf_LDFLAGS=-pthread
+endif
+
 runtestannotate_SOURCES=test-annotate.cc
 runtestannotate_LDADD=libtestutils.la $(top_builddir)/src/libabigail.la
 
diff --git a/tests/data/test-annotate/test3.so.abi b/tests/data/test-annotate/test3.so.abi
index b0928150..691eed12 100644
--- a/tests/data/test-annotate/test3.so.abi
+++ b/tests/data/test-annotate/test3.so.abi
@@ -7,18 +7,14 @@
     <elf-symbol name='__foo' type='func-type' binding='global-binding' visibility='default-visibility' alias='foo,foo__,__foo__' is-defined='yes'/>
     <!-- __foo__ -->
     <elf-symbol name='__foo__' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
-    <!-- _fini -->
-    <elf-symbol name='_fini' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
-    <!-- _init -->
-    <elf-symbol name='_init' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
     <!-- foo -->
     <elf-symbol name='foo' type='func-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
     <!-- foo__ -->
     <elf-symbol name='foo__' type='func-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
   </elf-function-symbols>
-  <abi-instr address-size='64' path='test3.c' comp-dir-path='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf' language='LANG_C89'>
+  <abi-instr address-size='64' path='./tests/data/test-read-common/test3.c' comp-dir-path='/home/byby/oracle/src/libabigail' language='LANG_C11'>
     <!-- void __foo() -->
-    <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'>
+    <function-decl name='__foo' mangled-name='__foo' filepath='./tests/data/test-read-common/test3.c' line='9' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='__foo'>
       <!-- void -->
       <return type-id='type-id-1'/>
     </function-decl>
diff --git a/tests/data/test-annotate/test4.so.abi b/tests/data/test-annotate/test4.so.abi
index bc77a28f..b3a28b0a 100644
--- a/tests/data/test-annotate/test4.so.abi
+++ b/tests/data/test-annotate/test4.so.abi
@@ -1,4 +1,4 @@
-<abi-corpus version='2.0' architecture='elf-amd-x86_64'>
+<abi-corpus version='2.0' architecture='elf-amd-x86_64' soname='test4.so.1'>
   <elf-needed>
     <dependency name='libc.so.6'/>
   </elf-needed>
@@ -6,7 +6,7 @@
     <!-- cpy -->
     <elf-symbol name='cpy' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
   </elf-function-symbols>
-  <abi-instr address-size='64' path='test4.c' comp-dir-path='/home/mark/src/tests' language='LANG_C89'>
+  <abi-instr address-size='64' path='./tests/data/test-read-common/test4.c' comp-dir-path='/home/byby/oracle/src/libabigail' language='LANG_C11'>
     <!-- char -->
     <type-decl name='char' size-in-bits='8' id='type-id-1'/>
     <!-- unsigned int -->
@@ -22,13 +22,13 @@
     <!-- const char* restrict -->
     <qualified-type-def type-id='type-id-6' restrict='yes' id='type-id-7'/>
     <!-- char* cpy(char* restrict, const char* restrict, unsigned int) -->
-    <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'>
+    <function-decl name='cpy' mangled-name='cpy' filepath='./tests/data/test-read-common/test4.c' line='4' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='cpy'>
       <!-- parameter of type 'char* restrict' -->
-      <parameter type-id='type-id-4' name='s1' filepath='/home/mark/src/tests/test4.c' line='2' column='1'/>
+      <parameter type-id='type-id-4' name='s1' filepath='./tests/data/test-read-common/test4.c' line='4' column='1'/>
       <!-- parameter of type 'const char* restrict' -->
-      <parameter type-id='type-id-7' name='s2' filepath='/home/mark/src/tests/test4.c' line='2' column='1'/>
+      <parameter type-id='type-id-7' name='s2' filepath='./tests/data/test-read-common/test4.c' line='4' column='1'/>
       <!-- parameter of type 'unsigned int' -->
-      <parameter type-id='type-id-2' name='n' filepath='/home/mark/src/tests/test4.c' line='2' column='1'/>
+      <parameter type-id='type-id-2' name='n' filepath='./tests/data/test-read-common/test4.c' line='4' column='1'/>
       <!-- char* -->
       <return type-id='type-id-3'/>
     </function-decl>
diff --git a/tests/data/test-read-common/PR26261/PR26261-exe b/tests/data/test-read-common/PR26261/PR26261-exe
new file mode 100755
index 0000000000000000000000000000000000000000..8464c22a23a9fd2c652e05fb5d43a6563a80f129
GIT binary patch
diff --git a/tests/data/test-read-common/PR26261/PR26261-exe-ctf.abi b/tests/data/test-read-common/PR26261/PR26261-exe-ctf.abi
new file mode 100644
index 00000000..0f534f32
--- /dev/null
+++ b/tests/data/test-read-common/PR26261/PR26261-exe-ctf.abi
@@ -0,0 +1,58 @@
+<abi-corpus version='2.0' path='data/test-read-common/PR26261/PR26261-exe'>
+  <elf-function-symbols>
+    <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='_start' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='fun_obja' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='fun_objb' 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-symbol name='wrapped_call' 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-variable-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <type-decl name='char' size-in-bits='8' alignment-in-bits='8' id='type-id-1'/>
+    <class-decl name='SA' size-in-bits='192' alignment-in-bits='32' is-struct='yes' visibility='default' id='type-id-2'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='m1' type-id='type-id-3' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='64'>
+        <var-decl name='m2' type-id='type-id-4' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='128'>
+        <var-decl name='m3' type-id='type-id-5' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <class-decl name='SB' size-in-bits='128' alignment-in-bits='32' is-struct='yes' visibility='default' id='type-id-6'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='m1' type-id='type-id-3' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='64'>
+        <var-decl name='m2' type-id='type-id-7' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='type-id-3'/>
+    <typedef-decl name='fn_ptr_type_a2_t' type-id='type-id-8' id='type-id-5'/>
+    <typedef-decl name='fn_ptr_type_a_t' type-id='type-id-8' id='type-id-4'/>
+    <typedef-decl name='fn_ptr_type_b_t' type-id='type-id-9' id='type-id-7'/>
+    <pointer-type-def type-id='type-id-2' size-in-bits='64' alignment-in-bits='64' id='type-id-10'/>
+    <pointer-type-def type-id='type-id-6' size-in-bits='64' alignment-in-bits='64' id='type-id-11'/>
+    <pointer-type-def type-id='type-id-1' size-in-bits='64' alignment-in-bits='64' id='type-id-12'/>
+    <pointer-type-def type-id='type-id-12' size-in-bits='64' alignment-in-bits='64' id='type-id-13'/>
+    <pointer-type-def type-id='type-id-14' size-in-bits='64' alignment-in-bits='64' id='type-id-8'/>
+    <pointer-type-def type-id='type-id-15' size-in-bits='64' alignment-in-bits='64' id='type-id-9'/>
+    <function-type size-in-bits='64' alignment-in-bits='8' id='type-id-14'>
+      <parameter type-id='type-id-3'/>
+      <parameter type-id='type-id-3'/>
+      <return type-id='type-id-16'/>
+    </function-type>
+    <function-type size-in-bits='64' alignment-in-bits='8' id='type-id-15'>
+      <parameter type-id='type-id-3'/>
+      <parameter type-id='type-id-3'/>
+      <parameter type-id='type-id-1'/>
+      <return type-id='type-id-16'/>
+    </function-type>
+    <type-decl name='void' id='type-id-16'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/PR26261/PR26261-exe.abi b/tests/data/test-read-common/PR26261/PR26261-exe-dwarf.abi
similarity index 53%
rename from tests/data/test-read-dwarf/PR26261/PR26261-exe.abi
rename to tests/data/test-read-common/PR26261/PR26261-exe-dwarf.abi
index b3d2dfd7..a7840334 100644
--- a/tests/data/test-read-dwarf/PR26261/PR26261-exe.abi
+++ b/tests/data/test-read-common/PR26261/PR26261-exe-dwarf.abi
@@ -1,12 +1,10 @@
-<abi-corpus version='2.0' path='data/test-read-dwarf/PR26261/PR26261-exe'>
+<abi-corpus version='2.0' path='data/test-read-common/PR26261/PR26261-exe'>
   <elf-needed>
     <dependency name='libc.so.6'/>
   </elf-needed>
   <elf-function-symbols>
     <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='fun_obja' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
     <elf-symbol name='fun_objb' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
@@ -16,18 +14,18 @@
   <elf-variable-symbols>
     <elf-symbol name='_IO_stdin_used' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
   </elf-variable-symbols>
-  <abi-instr address-size='64' path='PR26261-main.c' comp-dir-path='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261' language='LANG_C89'>
+  <abi-instr address-size='64' path='PR26261-main.c' comp-dir-path='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261' language='LANG_C99'>
     <pointer-type-def type-id='type-id-1' size-in-bits='64' id='type-id-2'/>
     <pointer-type-def type-id='type-id-2' size-in-bits='64' id='type-id-3'/>
-    <function-decl name='wrapped_call' mangled-name='wrapped_call' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-main.c' line='18' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='wrapped_call'>
-      <parameter type-id='type-id-4' name='fun' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-main.c' line='18' column='1'/>
-      <parameter type-id='type-id-5' name='a' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-main.c' line='19' column='1'/>
-      <parameter type-id='type-id-5' name='b' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-main.c' line='20' column='1'/>
+    <function-decl name='wrapped_call' mangled-name='wrapped_call' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-main.c' line='18' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='wrapped_call'>
+      <parameter type-id='type-id-4' name='fun' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-main.c' line='18' column='1'/>
+      <parameter type-id='type-id-5' name='a' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-main.c' line='19' column='1'/>
+      <parameter type-id='type-id-5' name='b' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-main.c' line='20' column='1'/>
       <return type-id='type-id-6'/>
     </function-decl>
-    <function-decl name='main' mangled-name='main' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-main.c' line='27' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='main'>
-      <parameter type-id='type-id-5' name='argc' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-main.c' line='27' column='1'/>
-      <parameter type-id='type-id-3' name='argv' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-main.c' line='27' column='1'/>
+    <function-decl name='main' mangled-name='main' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-main.c' line='27' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='main'>
+      <parameter type-id='type-id-5' name='argc' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-main.c' line='27' column='1'/>
+      <parameter type-id='type-id-3' name='argv' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-main.c' line='27' column='1'/>
       <return type-id='type-id-5'/>
     </function-decl>
     <function-type size-in-bits='64' id='type-id-7'>
@@ -36,44 +34,44 @@
       <return type-id='type-id-6'/>
     </function-type>
   </abi-instr>
-  <abi-instr address-size='64' path='PR26261-obja.c' comp-dir-path='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261' language='LANG_C89'>
+  <abi-instr address-size='64' path='PR26261-obja.c' comp-dir-path='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261' language='LANG_C99'>
     <type-decl name='int' size-in-bits='32' id='type-id-5'/>
-    <typedef-decl name='fn_ptr_type_a_t' type-id='type-id-4' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-obja.h' line='1' column='1' id='type-id-8'/>
-    <typedef-decl name='fn_ptr_type_a2_t' type-id='type-id-4' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-obja.h' line='3' column='1' id='type-id-9'/>
-    <class-decl name='SA' size-in-bits='192' is-struct='yes' visibility='default' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-obja.h' line='5' column='1' id='type-id-10'>
+    <typedef-decl name='fn_ptr_type_a_t' type-id='type-id-4' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-obja.h' line='1' column='1' id='type-id-8'/>
+    <typedef-decl name='fn_ptr_type_a2_t' type-id='type-id-4' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-obja.h' line='3' column='1' id='type-id-9'/>
+    <class-decl name='SA' size-in-bits='192' is-struct='yes' visibility='default' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-obja.h' line='5' column='1' id='type-id-10'>
       <data-member access='public' layout-offset-in-bits='0'>
-        <var-decl name='m1' type-id='type-id-5' visibility='default' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-obja.h' line='7' column='1'/>
+        <var-decl name='m1' type-id='type-id-5' visibility='default' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-obja.h' line='7' column='1'/>
       </data-member>
       <data-member access='public' layout-offset-in-bits='64'>
-        <var-decl name='m2' type-id='type-id-8' visibility='default' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-obja.h' line='8' column='1'/>
+        <var-decl name='m2' type-id='type-id-8' visibility='default' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-obja.h' line='8' column='1'/>
       </data-member>
       <data-member access='public' layout-offset-in-bits='128'>
-        <var-decl name='m3' type-id='type-id-9' visibility='default' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-obja.h' line='9' column='1'/>
+        <var-decl name='m3' type-id='type-id-9' visibility='default' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-obja.h' line='9' column='1'/>
       </data-member>
     </class-decl>
     <pointer-type-def type-id='type-id-10' size-in-bits='64' id='type-id-11'/>
     <pointer-type-def type-id='type-id-7' size-in-bits='64' id='type-id-4'/>
-    <function-decl name='fun_obja' mangled-name='fun_obja' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-obja.c' line='4' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='fun_obja'>
-      <parameter type-id='type-id-11' name='s' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-obja.c' line='4' column='1'/>
+    <function-decl name='fun_obja' mangled-name='fun_obja' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-obja.c' line='4' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='fun_obja'>
+      <parameter type-id='type-id-11' name='s' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-obja.c' line='4' column='1'/>
       <return type-id='type-id-6'/>
     </function-decl>
     <type-decl name='void' id='type-id-6'/>
   </abi-instr>
-  <abi-instr address-size='64' path='PR26261-objb.c' comp-dir-path='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261' language='LANG_C89'>
+  <abi-instr address-size='64' path='PR26261-objb.c' comp-dir-path='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261' language='LANG_C99'>
     <type-decl name='char' size-in-bits='8' id='type-id-1'/>
-    <typedef-decl name='fn_ptr_type_b_t' type-id='type-id-12' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-objb.h' line='1' column='1' id='type-id-13'/>
-    <class-decl name='SB' size-in-bits='128' is-struct='yes' visibility='default' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-objb.h' line='3' column='1' id='type-id-14'>
+    <typedef-decl name='fn_ptr_type_b_t' type-id='type-id-12' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-objb.h' line='1' column='1' id='type-id-13'/>
+    <class-decl name='SB' size-in-bits='128' is-struct='yes' visibility='default' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-objb.h' line='3' column='1' id='type-id-14'>
       <data-member access='public' layout-offset-in-bits='0'>
-        <var-decl name='m1' type-id='type-id-5' visibility='default' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-objb.h' line='5' column='1'/>
+        <var-decl name='m1' type-id='type-id-5' visibility='default' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-objb.h' line='5' column='1'/>
       </data-member>
       <data-member access='public' layout-offset-in-bits='64'>
-        <var-decl name='m2' type-id='type-id-13' visibility='default' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-objb.h' line='6' column='1'/>
+        <var-decl name='m2' type-id='type-id-13' visibility='default' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-objb.h' line='6' column='1'/>
       </data-member>
     </class-decl>
     <pointer-type-def type-id='type-id-14' size-in-bits='64' id='type-id-15'/>
     <pointer-type-def type-id='type-id-16' size-in-bits='64' id='type-id-12'/>
-    <function-decl name='fun_objb' mangled-name='fun_objb' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-objb.c' line='4' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='fun_objb'>
-      <parameter type-id='type-id-15' name='s' filepath='/home/dodji/git/libabigail/patches/tests/data/test-read-dwarf/PR26261/PR26261-objb.c' line='4' column='1'/>
+    <function-decl name='fun_objb' mangled-name='fun_objb' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-objb.c' line='4' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='fun_objb'>
+      <parameter type-id='type-id-15' name='s' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR26261/PR26261-objb.c' line='4' column='1'/>
       <return type-id='type-id-6'/>
     </function-decl>
     <function-type size-in-bits='64' id='type-id-16'>
diff --git a/tests/data/test-read-common/PR26261/PR26261-exe.abi b/tests/data/test-read-common/PR26261/PR26261-exe.abi
new file mode 100644
index 00000000..9a146364
--- /dev/null
+++ b/tests/data/test-read-common/PR26261/PR26261-exe.abi
@@ -0,0 +1,58 @@
+<abi-corpus version='2.0' path='data/test-read-ctf/PR26261/PR26261-exe'>
+  <elf-function-symbols>
+    <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='_start' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='fun_obja' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='fun_objb' 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-symbol name='wrapped_call' 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-variable-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <type-decl name='char' size-in-bits='8' alignment-in-bits='8' id='type-id-1'/>
+    <class-decl name='SA' size-in-bits='192' alignment-in-bits='32' is-struct='yes' visibility='default' id='type-id-2'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='m1' type-id='type-id-3' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='64'>
+        <var-decl name='m2' type-id='type-id-4' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='128'>
+        <var-decl name='m3' type-id='type-id-5' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <class-decl name='SB' size-in-bits='128' alignment-in-bits='32' is-struct='yes' visibility='default' id='type-id-6'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='m1' type-id='type-id-3' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='64'>
+        <var-decl name='m2' type-id='type-id-7' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='type-id-3'/>
+    <typedef-decl name='fn_ptr_type_a2_t' type-id='type-id-8' id='type-id-5'/>
+    <typedef-decl name='fn_ptr_type_a_t' type-id='type-id-8' id='type-id-4'/>
+    <typedef-decl name='fn_ptr_type_b_t' type-id='type-id-9' id='type-id-7'/>
+    <pointer-type-def type-id='type-id-2' size-in-bits='64' alignment-in-bits='64' id='type-id-10'/>
+    <pointer-type-def type-id='type-id-6' size-in-bits='64' alignment-in-bits='64' id='type-id-11'/>
+    <pointer-type-def type-id='type-id-1' size-in-bits='64' alignment-in-bits='64' id='type-id-12'/>
+    <pointer-type-def type-id='type-id-12' size-in-bits='64' alignment-in-bits='64' id='type-id-13'/>
+    <pointer-type-def type-id='type-id-14' size-in-bits='64' alignment-in-bits='64' id='type-id-8'/>
+    <pointer-type-def type-id='type-id-15' size-in-bits='64' alignment-in-bits='64' id='type-id-9'/>
+    <function-type size-in-bits='64' alignment-in-bits='8' id='type-id-14'>
+      <parameter type-id='type-id-3'/>
+      <parameter type-id='type-id-3'/>
+      <return type-id='type-id-16'/>
+    </function-type>
+    <function-type size-in-bits='64' alignment-in-bits='8' id='type-id-15'>
+      <parameter type-id='type-id-3'/>
+      <parameter type-id='type-id-3'/>
+      <parameter type-id='type-id-1'/>
+      <return type-id='type-id-16'/>
+    </function-type>
+    <type-decl name='void' id='type-id-16'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-common/PR26261/PR26261-exe_ctf.abi b/tests/data/test-read-common/PR26261/PR26261-exe_ctf.abi
new file mode 100644
index 00000000..0f534f32
--- /dev/null
+++ b/tests/data/test-read-common/PR26261/PR26261-exe_ctf.abi
@@ -0,0 +1,58 @@
+<abi-corpus version='2.0' path='data/test-read-common/PR26261/PR26261-exe'>
+  <elf-function-symbols>
+    <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='_start' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='fun_obja' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='fun_objb' 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-symbol name='wrapped_call' 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-variable-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <type-decl name='char' size-in-bits='8' alignment-in-bits='8' id='type-id-1'/>
+    <class-decl name='SA' size-in-bits='192' alignment-in-bits='32' is-struct='yes' visibility='default' id='type-id-2'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='m1' type-id='type-id-3' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='64'>
+        <var-decl name='m2' type-id='type-id-4' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='128'>
+        <var-decl name='m3' type-id='type-id-5' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <class-decl name='SB' size-in-bits='128' alignment-in-bits='32' is-struct='yes' visibility='default' id='type-id-6'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='m1' type-id='type-id-3' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='64'>
+        <var-decl name='m2' type-id='type-id-7' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='type-id-3'/>
+    <typedef-decl name='fn_ptr_type_a2_t' type-id='type-id-8' id='type-id-5'/>
+    <typedef-decl name='fn_ptr_type_a_t' type-id='type-id-8' id='type-id-4'/>
+    <typedef-decl name='fn_ptr_type_b_t' type-id='type-id-9' id='type-id-7'/>
+    <pointer-type-def type-id='type-id-2' size-in-bits='64' alignment-in-bits='64' id='type-id-10'/>
+    <pointer-type-def type-id='type-id-6' size-in-bits='64' alignment-in-bits='64' id='type-id-11'/>
+    <pointer-type-def type-id='type-id-1' size-in-bits='64' alignment-in-bits='64' id='type-id-12'/>
+    <pointer-type-def type-id='type-id-12' size-in-bits='64' alignment-in-bits='64' id='type-id-13'/>
+    <pointer-type-def type-id='type-id-14' size-in-bits='64' alignment-in-bits='64' id='type-id-8'/>
+    <pointer-type-def type-id='type-id-15' size-in-bits='64' alignment-in-bits='64' id='type-id-9'/>
+    <function-type size-in-bits='64' alignment-in-bits='8' id='type-id-14'>
+      <parameter type-id='type-id-3'/>
+      <parameter type-id='type-id-3'/>
+      <return type-id='type-id-16'/>
+    </function-type>
+    <function-type size-in-bits='64' alignment-in-bits='8' id='type-id-15'>
+      <parameter type-id='type-id-3'/>
+      <parameter type-id='type-id-3'/>
+      <parameter type-id='type-id-1'/>
+      <return type-id='type-id-16'/>
+    </function-type>
+    <type-decl name='void' id='type-id-16'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/PR26261/PR26261-main.c b/tests/data/test-read-common/PR26261/PR26261-main.c
similarity index 100%
rename from tests/data/test-read-dwarf/PR26261/PR26261-main.c
rename to tests/data/test-read-common/PR26261/PR26261-main.c
diff --git a/tests/data/test-read-dwarf/PR26261/PR26261-obja.c b/tests/data/test-read-common/PR26261/PR26261-obja.c
similarity index 100%
rename from tests/data/test-read-dwarf/PR26261/PR26261-obja.c
rename to tests/data/test-read-common/PR26261/PR26261-obja.c
diff --git a/tests/data/test-read-dwarf/PR26261/PR26261-obja.h b/tests/data/test-read-common/PR26261/PR26261-obja.h
similarity index 100%
rename from tests/data/test-read-dwarf/PR26261/PR26261-obja.h
rename to tests/data/test-read-common/PR26261/PR26261-obja.h
diff --git a/tests/data/test-read-dwarf/PR26261/PR26261-objb.c b/tests/data/test-read-common/PR26261/PR26261-objb.c
similarity index 100%
rename from tests/data/test-read-dwarf/PR26261/PR26261-objb.c
rename to tests/data/test-read-common/PR26261/PR26261-objb.c
diff --git a/tests/data/test-read-dwarf/PR26261/PR26261-objb.h b/tests/data/test-read-common/PR26261/PR26261-objb.h
similarity index 100%
rename from tests/data/test-read-dwarf/PR26261/PR26261-objb.h
rename to tests/data/test-read-common/PR26261/PR26261-objb.h
diff --git a/tests/data/test-read-dwarf/PR27700/include-dir/priv.h b/tests/data/test-read-common/PR27700/include-dir/priv.h
similarity index 100%
rename from tests/data/test-read-dwarf/PR27700/include-dir/priv.h
rename to tests/data/test-read-common/PR27700/include-dir/priv.h
diff --git a/tests/data/test-read-dwarf/PR27700/include-dir/pub.h b/tests/data/test-read-common/PR27700/include-dir/pub.h
similarity index 100%
rename from tests/data/test-read-dwarf/PR27700/include-dir/pub.h
rename to tests/data/test-read-common/PR27700/include-dir/pub.h
diff --git a/tests/data/test-read-dwarf/PR27700/pub-incdir/inc.h b/tests/data/test-read-common/PR27700/pub-incdir/inc.h
similarity index 100%
rename from tests/data/test-read-dwarf/PR27700/pub-incdir/inc.h
rename to tests/data/test-read-common/PR27700/pub-incdir/inc.h
diff --git a/tests/data/test-read-common/PR27700/test-PR27700-ctf.abi b/tests/data/test-read-common/PR27700/test-PR27700-ctf.abi
new file mode 100644
index 00000000..2210a10f
--- /dev/null
+++ b/tests/data/test-read-common/PR27700/test-PR27700-ctf.abi
@@ -0,0 +1,22 @@
+<abi-corpus version='2.0' path='data/test-read-common/PR27700/test-PR27700.o'>
+  <elf-function-symbols>
+    <elf-symbol name='foo' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-function-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <type-decl name='' is-anonymous='yes' size-in-bits='32' alignment-in-bits='32' id='811c9dc5'/>
+    <enum-decl name='foo' linkage-name='foo' id='022218d8'>
+      <underlying-type type-id='811c9dc5'/>
+      <enumerator name='foo_e0' value='0'/>
+      <enumerator name='foo_e1' value='1'/>
+      <enumerator name='foo_e2' value='2'/>
+      <enumerator name='foo_e3' value='3'/>
+    </enum-decl>
+    <type-decl name='unsigned int' size-in-bits='32' alignment-in-bits='32' id='f0981eeb'/>
+    <pointer-type-def type-id='022218d8' size-in-bits='64' alignment-in-bits='64' id='8750e847'/>
+    <function-decl name='foo' visibility='default' binding='global' size-in-bits='64' alignment-in-bits='8'>
+      <parameter type-id='8750e847'/>
+      <return type-id='48b5725f'/>
+    </function-decl>
+    <type-decl name='void' id='48b5725f'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/PR27700/test-PR27700.abi b/tests/data/test-read-common/PR27700/test-PR27700-dwarf.abi
similarity index 60%
rename from tests/data/test-read-dwarf/PR27700/test-PR27700.abi
rename to tests/data/test-read-common/PR27700/test-PR27700-dwarf.abi
index 4f861fb8..51367d7b 100644
--- a/tests/data/test-read-dwarf/PR27700/test-PR27700.abi
+++ b/tests/data/test-read-common/PR27700/test-PR27700-dwarf.abi
@@ -1,15 +1,15 @@
-<abi-corpus version='2.0' path='data/test-read-dwarf/PR27700/test-PR27700.o'>
+<abi-corpus version='2.0' path='data/test-read-common/PR27700/test-PR27700.o'>
   <elf-function-symbols>
     <elf-symbol name='foo' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
   </elf-function-symbols>
-  <abi-instr address-size='64' path='test-PR27700.c' comp-dir-path='/home/dodji/git/libabigail/PR27700/tests/data/test-read-dwarf/PR27700' language='LANG_C11'>
+  <abi-instr address-size='64' path='test-PR27700.c' comp-dir-path='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR27700' language='LANG_C11'>
     <type-decl name='unnamed-enum-underlying-type-32' is-anonymous='yes' size-in-bits='32' alignment-in-bits='32' id='9cac1fee'/>
     <enum-decl name='foo' filepath='include-dir/priv.h' line='1' column='1' id='022218d8'>
       <underlying-type type-id='9cac1fee'/>
     </enum-decl>
     <pointer-type-def type-id='022218d8' size-in-bits='64' id='8750e847'/>
-    <function-decl name='foo' mangled-name='foo' filepath='/home/dodji/git/libabigail/PR27700/tests/data/test-read-dwarf/PR27700/test-PR27700.c' line='4' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='foo'>
-      <parameter type-id='8750e847' name='c' filepath='/home/dodji/git/libabigail/PR27700/tests/data/test-read-dwarf/PR27700/test-PR27700.c' line='4' column='1'/>
+    <function-decl name='foo' mangled-name='foo' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR27700/test-PR27700.c' line='4' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='foo'>
+      <parameter type-id='8750e847' name='c' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/PR27700/test-PR27700.c' line='4' column='1'/>
       <return type-id='48b5725f'/>
     </function-decl>
     <type-decl name='void' id='48b5725f'/>
diff --git a/tests/data/test-read-dwarf/PR27700/test-PR27700.c b/tests/data/test-read-common/PR27700/test-PR27700.c
similarity index 55%
rename from tests/data/test-read-dwarf/PR27700/test-PR27700.c
rename to tests/data/test-read-common/PR27700/test-PR27700.c
index b44a3226..a16a0bb7 100644
--- a/tests/data/test-read-dwarf/PR27700/test-PR27700.c
+++ b/tests/data/test-read-common/PR27700/test-PR27700.c
@@ -1,5 +1,7 @@
 #include "include-dir/priv.h"
 
+/* gcc -I. -gctf -gdwarf -c -o test-PR27700.o test-PR27700.c */
+
 void
 foo(enum foo* c __attribute__((unused)))
 {
diff --git a/tests/data/test-read-common/test-PR26568-1-ctf.o.abi b/tests/data/test-read-common/test-PR26568-1-ctf.o.abi
new file mode 100644
index 00000000..f74e9b6d
--- /dev/null
+++ b/tests/data/test-read-common/test-PR26568-1-ctf.o.abi
@@ -0,0 +1,56 @@
+<abi-corpus version='2.0' path='data/test-read-common/test-PR26568-1.o'>
+  <elf-function-symbols>
+    <elf-symbol name='fun' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-function-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <class-decl name='A' size-in-bits='64' alignment-in-bits='64' is-struct='yes' visibility='default' id='type-id-1'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='' type-id='type-id-2' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='' type-id='type-id-3' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='x' type-id='type-id-4' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='' type-id='type-id-5' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='y' type-id='type-id-6' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <class-decl name='' size-in-bits='32' alignment-in-bits='32' is-struct='yes' is-anonymous='yes' visibility='default' id='type-id-3'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='x' type-id='type-id-4' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <class-decl name='' size-in-bits='64' alignment-in-bits='64' is-struct='yes' is-anonymous='yes' visibility='default' id='type-id-5'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='y' type-id='type-id-6' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='type-id-4'/>
+    <type-decl name='long int' size-in-bits='64' alignment-in-bits='64' id='type-id-6'/>
+    <union-decl name='' size-in-bits='64' is-anonymous='yes' visibility='default' id='type-id-2'>
+      <data-member access='public'>
+        <var-decl name='' type-id='type-id-3' visibility='default'/>
+      </data-member>
+      <data-member access='public'>
+        <var-decl name='x' type-id='type-id-4' visibility='default'/>
+      </data-member>
+      <data-member access='public'>
+        <var-decl name='' type-id='type-id-5' visibility='default'/>
+      </data-member>
+      <data-member access='public'>
+        <var-decl name='y' type-id='type-id-6' visibility='default'/>
+      </data-member>
+    </union-decl>
+    <pointer-type-def type-id='type-id-1' size-in-bits='64' alignment-in-bits='64' id='type-id-7'/>
+    <function-decl name='fun' visibility='default' binding='global' size-in-bits='64' alignment-in-bits='8'>
+      <parameter type-id='type-id-7'/>
+      <return type-id='type-id-8'/>
+    </function-decl>
+    <type-decl name='void' id='type-id-8'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test-PR26568-1.o.abi b/tests/data/test-read-common/test-PR26568-1-dwarf.o.abi
similarity index 54%
rename from tests/data/test-read-dwarf/test-PR26568-1.o.abi
rename to tests/data/test-read-common/test-PR26568-1-dwarf.o.abi
index 3663eb4a..54c499bb 100644
--- a/tests/data/test-read-dwarf/test-PR26568-1.o.abi
+++ b/tests/data/test-read-common/test-PR26568-1-dwarf.o.abi
@@ -1,16 +1,16 @@
-<abi-corpus version='2.0' path='data/test-read-dwarf/test-PR26568-1.o'>
+<abi-corpus version='2.0' path='data/test-read-common/test-PR26568-1.o'>
   <elf-function-symbols>
     <elf-symbol name='fun' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
   </elf-function-symbols>
-  <abi-instr address-size='64' path='test-PR26568-1.c' comp-dir-path='/home/dodji/git/libabigail/fixes/tests/data/test-read-dwarf' language='LANG_C89'>
+  <abi-instr address-size='64' path='./tests/data/test-read-common/test-PR26568-1.c' comp-dir-path='/home/byby/oracle/src/libabigail' language='LANG_C99'>
     <type-decl name='int' size-in-bits='32' id='type-id-1'/>
     <type-decl name='long int' size-in-bits='64' id='type-id-2'/>
-    <class-decl name='A' size-in-bits='64' is-struct='yes' visibility='default' filepath='/home/dodji/git/libabigail/fixes/tests/data/test-read-dwarf/test-PR26568-1.c' line='1' column='1' id='type-id-3'>
+    <class-decl name='A' size-in-bits='64' is-struct='yes' visibility='default' filepath='./tests/data/test-read-common/test-PR26568-1.c' line='1' column='1' id='type-id-3'>
       <data-member access='public' layout-offset-in-bits='0'>
         <var-decl name='' type-id='type-id-4' visibility='default'/>
       </data-member>
     </class-decl>
-    <union-decl name='__anonymous_union__' size-in-bits='64' is-anonymous='yes' visibility='default' filepath='/home/dodji/git/libabigail/fixes/tests/data/test-read-dwarf/test-PR26568-1.c' line='2' column='1' id='type-id-4'>
+    <union-decl name='__anonymous_union__' size-in-bits='64' is-anonymous='yes' visibility='default' filepath='./tests/data/test-read-common/test-PR26568-1.c' line='2' column='1' id='type-id-4'>
       <data-member access='public'>
         <var-decl name='' type-id='type-id-5' visibility='default'/>
       </data-member>
@@ -18,19 +18,19 @@
         <var-decl name='' type-id='type-id-6' visibility='default'/>
       </data-member>
     </union-decl>
-    <class-decl name='__anonymous_struct__' size-in-bits='32' is-struct='yes' is-anonymous='yes' visibility='default' filepath='/home/dodji/git/libabigail/fixes/tests/data/test-read-dwarf/test-PR26568-1.c' line='3' column='1' id='type-id-5'>
+    <class-decl name='__anonymous_struct__' size-in-bits='32' is-struct='yes' is-anonymous='yes' visibility='default' filepath='./tests/data/test-read-common/test-PR26568-1.c' line='3' column='1' id='type-id-5'>
       <data-member access='public' layout-offset-in-bits='0'>
-        <var-decl name='x' type-id='type-id-1' visibility='default' filepath='/home/dodji/git/libabigail/fixes/tests/data/test-read-dwarf/test-PR26568-1.c' line='4' column='1'/>
+        <var-decl name='x' type-id='type-id-1' visibility='default' filepath='./tests/data/test-read-common/test-PR26568-1.c' line='4' column='1'/>
       </data-member>
     </class-decl>
-    <class-decl name='__anonymous_struct__1' size-in-bits='64' is-struct='yes' is-anonymous='yes' visibility='default' filepath='/home/dodji/git/libabigail/fixes/tests/data/test-read-dwarf/test-PR26568-1.c' line='6' column='1' id='type-id-6'>
+    <class-decl name='__anonymous_struct__1' size-in-bits='64' is-struct='yes' is-anonymous='yes' visibility='default' filepath='./tests/data/test-read-common/test-PR26568-1.c' line='6' column='1' id='type-id-6'>
       <data-member access='public' layout-offset-in-bits='0'>
-        <var-decl name='y' type-id='type-id-2' visibility='default' filepath='/home/dodji/git/libabigail/fixes/tests/data/test-read-dwarf/test-PR26568-1.c' line='7' column='1'/>
+        <var-decl name='y' type-id='type-id-2' visibility='default' filepath='./tests/data/test-read-common/test-PR26568-1.c' line='7' column='1'/>
       </data-member>
     </class-decl>
     <pointer-type-def type-id='type-id-3' size-in-bits='64' id='type-id-7'/>
-    <function-decl name='fun' mangled-name='fun' filepath='/home/dodji/git/libabigail/fixes/tests/data/test-read-dwarf/test-PR26568-1.c' line='12' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='fun'>
-      <parameter type-id='type-id-7' name='a' filepath='/home/dodji/git/libabigail/fixes/tests/data/test-read-dwarf/test-PR26568-1.c' line='12' column='1'/>
+    <function-decl name='fun' mangled-name='fun' filepath='./tests/data/test-read-common/test-PR26568-1.c' line='12' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='fun'>
+      <parameter type-id='type-id-7' name='a' filepath='./tests/data/test-read-common/test-PR26568-1.c' line='12' column='1'/>
       <return type-id='type-id-8'/>
     </function-decl>
     <type-decl name='void' id='type-id-8'/>
diff --git a/tests/data/test-read-dwarf/test-PR26568-1.c b/tests/data/test-read-common/test-PR26568-1.c
similarity index 100%
rename from tests/data/test-read-dwarf/test-PR26568-1.c
rename to tests/data/test-read-common/test-PR26568-1.c
diff --git a/tests/data/test-read-common/test-PR26568-2-ctf.o.abi b/tests/data/test-read-common/test-PR26568-2-ctf.o.abi
new file mode 100644
index 00000000..d39d20c2
--- /dev/null
+++ b/tests/data/test-read-common/test-PR26568-2-ctf.o.abi
@@ -0,0 +1,39 @@
+<abi-corpus version='2.0' path='data/test-read-common/test-PR26568-2.o'>
+  <elf-function-symbols>
+    <elf-symbol name='fun' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-function-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <class-decl name='' size-in-bits='32' alignment-in-bits='32' is-struct='yes' is-anonymous='yes' visibility='default' id='type-id-1'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='x' type-id='type-id-2' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <class-decl name='' size-in-bits='64' alignment-in-bits='64' is-struct='yes' is-anonymous='yes' visibility='default' id='type-id-3'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='y' type-id='type-id-4' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='type-id-2'/>
+    <type-decl name='long int' size-in-bits='64' alignment-in-bits='64' id='type-id-4'/>
+    <union-decl name='A' size-in-bits='64' visibility='default' id='type-id-5'>
+      <data-member access='public'>
+        <var-decl name='' type-id='type-id-1' visibility='default'/>
+      </data-member>
+      <data-member access='public'>
+        <var-decl name='x' type-id='type-id-2' visibility='default'/>
+      </data-member>
+      <data-member access='public'>
+        <var-decl name='' type-id='type-id-3' visibility='default'/>
+      </data-member>
+      <data-member access='public'>
+        <var-decl name='y' type-id='type-id-4' visibility='default'/>
+      </data-member>
+    </union-decl>
+    <pointer-type-def type-id='type-id-5' size-in-bits='64' alignment-in-bits='64' id='type-id-6'/>
+    <function-decl name='fun' visibility='default' binding='global' size-in-bits='64' alignment-in-bits='8'>
+      <parameter type-id='type-id-6'/>
+      <return type-id='type-id-7'/>
+    </function-decl>
+    <type-decl name='void' id='type-id-7'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test-PR26568-2.o.abi b/tests/data/test-read-common/test-PR26568-2-dwarf.o.abi
similarity index 59%
rename from tests/data/test-read-dwarf/test-PR26568-2.o.abi
rename to tests/data/test-read-common/test-PR26568-2-dwarf.o.abi
index 9129da2c..413435ae 100644
--- a/tests/data/test-read-dwarf/test-PR26568-2.o.abi
+++ b/tests/data/test-read-common/test-PR26568-2-dwarf.o.abi
@@ -1,11 +1,11 @@
-<abi-corpus version='2.0' path='data/test-read-dwarf/test-PR26568-2.o'>
+<abi-corpus version='2.0' path='data/test-read-common/test-PR26568-2.o'>
   <elf-function-symbols>
     <elf-symbol name='fun' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
   </elf-function-symbols>
-  <abi-instr address-size='64' path='test-PR26568-2.c' comp-dir-path='/home/dodji/git/libabigail/fixes/tests/data/test-read-dwarf' language='LANG_C89'>
+  <abi-instr address-size='64' path='test-PR26568-2.c' comp-dir-path='/home/byby/oracle/src/libabigail/tests/data/test-read-common' language='LANG_C11'>
     <type-decl name='int' size-in-bits='32' id='type-id-1'/>
     <type-decl name='long int' size-in-bits='64' id='type-id-2'/>
-    <union-decl name='A' size-in-bits='64' visibility='default' filepath='/home/dodji/git/libabigail/fixes/tests/data/test-read-dwarf/test-PR26568-2.c' line='1' column='1' id='type-id-3'>
+    <union-decl name='A' size-in-bits='64' visibility='default' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/test-PR26568-2.c' line='1' column='1' id='type-id-3'>
       <data-member access='public'>
         <var-decl name='' type-id='type-id-4' visibility='default'/>
       </data-member>
@@ -13,19 +13,19 @@
         <var-decl name='' type-id='type-id-5' visibility='default'/>
       </data-member>
     </union-decl>
-    <class-decl name='__anonymous_struct__' size-in-bits='32' is-struct='yes' is-anonymous='yes' visibility='default' filepath='/home/dodji/git/libabigail/fixes/tests/data/test-read-dwarf/test-PR26568-2.c' line='2' column='1' id='type-id-4'>
+    <class-decl name='__anonymous_struct__' size-in-bits='32' is-struct='yes' is-anonymous='yes' visibility='default' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/test-PR26568-2.c' line='2' column='1' id='type-id-4'>
       <data-member access='public' layout-offset-in-bits='0'>
-        <var-decl name='x' type-id='type-id-1' visibility='default' filepath='/home/dodji/git/libabigail/fixes/tests/data/test-read-dwarf/test-PR26568-2.c' line='3' column='1'/>
+        <var-decl name='x' type-id='type-id-1' visibility='default' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/test-PR26568-2.c' line='3' column='1'/>
       </data-member>
     </class-decl>
-    <class-decl name='__anonymous_struct__1' size-in-bits='64' is-struct='yes' is-anonymous='yes' visibility='default' filepath='/home/dodji/git/libabigail/fixes/tests/data/test-read-dwarf/test-PR26568-2.c' line='5' column='1' id='type-id-5'>
+    <class-decl name='__anonymous_struct__1' size-in-bits='64' is-struct='yes' is-anonymous='yes' visibility='default' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/test-PR26568-2.c' line='5' column='1' id='type-id-5'>
       <data-member access='public' layout-offset-in-bits='0'>
-        <var-decl name='y' type-id='type-id-2' visibility='default' filepath='/home/dodji/git/libabigail/fixes/tests/data/test-read-dwarf/test-PR26568-2.c' line='6' column='1'/>
+        <var-decl name='y' type-id='type-id-2' visibility='default' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/test-PR26568-2.c' line='6' column='1'/>
       </data-member>
     </class-decl>
     <pointer-type-def type-id='type-id-3' size-in-bits='64' id='type-id-6'/>
-    <function-decl name='fun' mangled-name='fun' filepath='/home/dodji/git/libabigail/fixes/tests/data/test-read-dwarf/test-PR26568-2.c' line='10' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='fun'>
-      <parameter type-id='type-id-6' name='a' filepath='/home/dodji/git/libabigail/fixes/tests/data/test-read-dwarf/test-PR26568-2.c' line='10' column='1'/>
+    <function-decl name='fun' mangled-name='fun' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/test-PR26568-2.c' line='10' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='fun'>
+      <parameter type-id='type-id-6' name='a' filepath='/home/byby/oracle/src/libabigail/tests/data/test-read-common/test-PR26568-2.c' line='10' column='1'/>
       <return type-id='type-id-7'/>
     </function-decl>
     <type-decl name='void' id='type-id-7'/>
diff --git a/tests/data/test-read-dwarf/test-PR26568-2.c b/tests/data/test-read-common/test-PR26568-2.c
similarity index 68%
rename from tests/data/test-read-dwarf/test-PR26568-2.c
rename to tests/data/test-read-common/test-PR26568-2.c
index 656e8eea..dc3804f3 100644
--- a/tests/data/test-read-dwarf/test-PR26568-2.c
+++ b/tests/data/test-read-common/test-PR26568-2.c
@@ -1,3 +1,5 @@
+/* gcc -gctf -gdwarf -c -o test-PR26568-2.o test-PR26568-2.c */
+
 union A {
   struct {
     int x;
diff --git a/tests/data/test-read-common/test3-alias-1-dwarf.so.hash.abi b/tests/data/test-read-common/test3-alias-1-dwarf.so.hash.abi
new file mode 100644
index 00000000..b18c75b8
--- /dev/null
+++ b/tests/data/test-read-common/test3-alias-1-dwarf.so.hash.abi
@@ -0,0 +1,14 @@
+<abi-corpus version='2.0' path='data/test-read-common/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-function-symbols>
+  <abi-instr address-size='64' path='./tests/data/test-read-common/test3.c' comp-dir-path='/home/byby/oracle/src/libabigail' language='LANG_C11'>
+    <function-decl name='__foo' mangled-name='__foo' filepath='./tests/data/test-read-common/test3.c' line='9' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='__foo'>
+      <return type-id='48b5725f'/>
+    </function-decl>
+    <type-decl name='void' id='48b5725f'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test3-alias-1.suppr b/tests/data/test-read-common/test3-alias-1.suppr
similarity index 100%
rename from tests/data/test-read-dwarf/test3-alias-1.suppr
rename to tests/data/test-read-common/test3-alias-1.suppr
diff --git a/tests/data/test-read-common/test3-alias-2-dwarf.so.hash.abi b/tests/data/test-read-common/test3-alias-2-dwarf.so.hash.abi
new file mode 100644
index 00000000..eacc7040
--- /dev/null
+++ b/tests/data/test-read-common/test3-alias-2-dwarf.so.hash.abi
@@ -0,0 +1,16 @@
+<abi-corpus version='2.0' path='data/test-read-common/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='weak-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='foo__' type='func-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-function-symbols>
+  <abi-instr address-size='64' path='./tests/data/test-read-common/test3.c' comp-dir-path='/home/byby/oracle/src/libabigail' language='LANG_C11'>
+    <function-decl name='__foo' mangled-name='__foo' filepath='./tests/data/test-read-common/test3.c' line='9' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='foo'>
+      <return type-id='48b5725f'/>
+    </function-decl>
+    <type-decl name='void' id='48b5725f'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test3-alias-2.suppr b/tests/data/test-read-common/test3-alias-2.suppr
similarity index 100%
rename from tests/data/test-read-dwarf/test3-alias-2.suppr
rename to tests/data/test-read-common/test3-alias-2.suppr
diff --git a/tests/data/test-read-common/test3-alias-3-dwarf.so.hash.abi b/tests/data/test-read-common/test3-alias-3-dwarf.so.hash.abi
new file mode 100644
index 00000000..0c4fbb84
--- /dev/null
+++ b/tests/data/test-read-common/test3-alias-3-dwarf.so.hash.abi
@@ -0,0 +1,14 @@
+<abi-corpus version='2.0' path='data/test-read-common/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='weak-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-function-symbols>
+  <abi-instr address-size='64' path='./tests/data/test-read-common/test3.c' comp-dir-path='/home/byby/oracle/src/libabigail' language='LANG_C11'>
+    <function-decl name='__foo' mangled-name='__foo' filepath='./tests/data/test-read-common/test3.c' line='9' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='foo'>
+      <return type-id='48b5725f'/>
+    </function-decl>
+    <type-decl name='void' id='48b5725f'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test3-alias-3.suppr b/tests/data/test-read-common/test3-alias-3.suppr
similarity index 100%
rename from tests/data/test-read-dwarf/test3-alias-3.suppr
rename to tests/data/test-read-common/test3-alias-3.suppr
diff --git a/tests/data/test-read-common/test3-alias-4-dwarf.so.hash.abi b/tests/data/test-read-common/test3-alias-4-dwarf.so.hash.abi
new file mode 100644
index 00000000..a3ac2abd
--- /dev/null
+++ b/tests/data/test-read-common/test3-alias-4-dwarf.so.hash.abi
@@ -0,0 +1,11 @@
+<abi-corpus version='2.0' path='data/test-read-common/test3.so'>
+  <elf-function-symbols>
+    <elf-symbol name='_init' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-function-symbols>
+  <abi-instr address-size='64' path='./tests/data/test-read-common/test3.c' comp-dir-path='/home/byby/oracle/src/libabigail' language='LANG_C11'>
+    <function-decl name='_init' mangled-name='_init' filepath='./tests/data/test-read-common/test3.c' line='17' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_init'>
+      <return type-id='48b5725f'/>
+    </function-decl>
+    <type-decl name='void' id='48b5725f'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test3-alias-4.suppr b/tests/data/test-read-common/test3-alias-4.suppr
similarity index 100%
rename from tests/data/test-read-dwarf/test3-alias-4.suppr
rename to tests/data/test-read-common/test3-alias-4.suppr
diff --git a/tests/data/test-read-common/test3-ctf.so.abi b/tests/data/test-read-common/test3-ctf.so.abi
new file mode 100644
index 00000000..0153f4f2
--- /dev/null
+++ b/tests/data/test-read-common/test3-ctf.so.abi
@@ -0,0 +1,10 @@
+<abi-corpus version='2.0' path='data/test-read-common/test3.so'>
+  <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='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 address-size='64' language='LANG_C'>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-common/test3-ctf.so.hash.abi b/tests/data/test-read-common/test3-ctf.so.hash.abi
new file mode 100644
index 00000000..0153f4f2
--- /dev/null
+++ b/tests/data/test-read-common/test3-ctf.so.hash.abi
@@ -0,0 +1,10 @@
+<abi-corpus version='2.0' path='data/test-read-common/test3.so'>
+  <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='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 address-size='64' language='LANG_C'>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test3.so.abi b/tests/data/test-read-common/test3-dwarf.so.abi
similarity index 50%
rename from tests/data/test-read-dwarf/test3.so.abi
rename to tests/data/test-read-common/test3-dwarf.so.abi
index bb691101..97f8b6cf 100644
--- a/tests/data/test-read-dwarf/test3.so.abi
+++ b/tests/data/test-read-common/test3-dwarf.so.abi
@@ -1,17 +1,15 @@
-<abi-corpus version='2.0' path='data/test-read-dwarf/test3.so' soname='test3.so.1'>
+<abi-corpus version='2.0' path='data/test-read-common/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' alias='foo,foo__,__foo__' 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' is-defined='yes'/>
     <elf-symbol name='foo__' type='func-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
   </elf-function-symbols>
-  <abi-instr address-size='64' path='test3.c' comp-dir-path='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf' language='LANG_C89'>
-    <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'>
+  <abi-instr address-size='64' path='./tests/data/test-read-common/test3.c' comp-dir-path='/home/byby/oracle/src/libabigail' language='LANG_C11'>
+    <function-decl name='__foo' mangled-name='__foo' filepath='./tests/data/test-read-common/test3.c' line='9' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='__foo'>
       <return type-id='type-id-1'/>
     </function-decl>
     <type-decl name='void' id='type-id-1'/>
diff --git a/tests/data/test-read-dwarf/test3.so.hash.abi b/tests/data/test-read-common/test3-dwarf.so.hash.abi
similarity index 50%
rename from tests/data/test-read-dwarf/test3.so.hash.abi
rename to tests/data/test-read-common/test3-dwarf.so.hash.abi
index 52207884..d332c803 100644
--- a/tests/data/test-read-dwarf/test3.so.hash.abi
+++ b/tests/data/test-read-common/test3-dwarf.so.hash.abi
@@ -1,17 +1,15 @@
-<abi-corpus version='2.0' path='data/test-read-dwarf/test3.so' soname='test3.so.1'>
+<abi-corpus version='2.0' path='data/test-read-common/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' alias='foo,foo__,__foo__' 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' is-defined='yes'/>
     <elf-symbol name='foo__' type='func-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
   </elf-function-symbols>
-  <abi-instr address-size='64' path='test3.c' comp-dir-path='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf' language='LANG_C89'>
-    <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'>
+  <abi-instr address-size='64' path='./tests/data/test-read-common/test3.c' comp-dir-path='/home/byby/oracle/src/libabigail' language='LANG_C11'>
+    <function-decl name='__foo' mangled-name='__foo' filepath='./tests/data/test-read-common/test3.c' line='9' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='__foo'>
       <return type-id='48b5725f'/>
     </function-decl>
     <type-decl name='void' id='48b5725f'/>
diff --git a/tests/data/test-read-dwarf/test3.c b/tests/data/test-read-common/test3.c
similarity index 71%
rename from tests/data/test-read-dwarf/test3.c
rename to tests/data/test-read-common/test3.c
index 2808db4b..f7860ee8 100644
--- a/tests/data/test-read-dwarf/test3.c
+++ b/tests/data/test-read-common/test3.c
@@ -1,4 +1,5 @@
 // Test file for creating multiple alias for a symbol
+// gcc -shared -gctf -g -mtune=generic -march=x86-64 -fPIC -Wl,-soname=test3.so.1 -o test3.so test3.c
 
 void __foo(void);
 void foo(void) __attribute__((weak, alias("__foo")));
diff --git a/tests/data/test-read-common/test3.so b/tests/data/test-read-common/test3.so
new file mode 100755
index 0000000000000000000000000000000000000000..beddf426c93d3f3b77afd1ec3235581d7cea7e03
GIT binary patch
diff --git a/tests/data/test-read-common/test4-ctf.so.abi b/tests/data/test-read-common/test4-ctf.so.abi
new file mode 100644
index 00000000..59d222dc
--- /dev/null
+++ b/tests/data/test-read-common/test4-ctf.so.abi
@@ -0,0 +1,14 @@
+<abi-corpus version='2.0' path='data/test-read-common/test4.so'>
+  <elf-function-symbols>
+    <elf-symbol name='cpy' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-function-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <type-decl name='char' size-in-bits='8' alignment-in-bits='8' id='type-id-1'/>
+    <type-decl name='unsigned int' size-in-bits='32' alignment-in-bits='32' id='type-id-2'/>
+    <pointer-type-def type-id='type-id-1' size-in-bits='64' alignment-in-bits='64' id='type-id-3'/>
+    <qualified-type-def type-id='type-id-3' restrict='yes' id='type-id-4'/>
+    <qualified-type-def type-id='type-id-1' const='yes' id='type-id-5'/>
+    <pointer-type-def type-id='type-id-5' size-in-bits='64' alignment-in-bits='64' id='type-id-6'/>
+    <qualified-type-def type-id='type-id-6' restrict='yes' id='type-id-7'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-common/test4-ctf.so.hash.abi b/tests/data/test-read-common/test4-ctf.so.hash.abi
new file mode 100644
index 00000000..de249080
--- /dev/null
+++ b/tests/data/test-read-common/test4-ctf.so.hash.abi
@@ -0,0 +1,14 @@
+<abi-corpus version='2.0' path='data/test-read-common/test4.so'>
+  <elf-function-symbols>
+    <elf-symbol name='cpy' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-function-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <type-decl name='char' size-in-bits='8' alignment-in-bits='8' id='a84c031d'/>
+    <type-decl name='unsigned int' size-in-bits='32' alignment-in-bits='32' id='f0981eeb'/>
+    <pointer-type-def type-id='a84c031d' size-in-bits='64' alignment-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' alignment-in-bits='64' id='80f4b756'/>
+    <qualified-type-def type-id='80f4b756' restrict='yes' id='9d26089a'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test4.so.abi b/tests/data/test-read-common/test4-dwarf.so.abi
similarity index 51%
rename from tests/data/test-read-dwarf/test4.so.abi
rename to tests/data/test-read-common/test4-dwarf.so.abi
index 451e90b6..5c8383f6 100644
--- a/tests/data/test-read-dwarf/test4.so.abi
+++ b/tests/data/test-read-common/test4-dwarf.so.abi
@@ -1,11 +1,11 @@
-<abi-corpus version='2.0' path='data/test-read-dwarf/test4.so'>
+<abi-corpus version='2.0' path='data/test-read-common/test4.so' soname='test4.so.1'>
   <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 address-size='64' path='test4.c' comp-dir-path='/home/mark/src/tests' language='LANG_C89'>
+  <abi-instr address-size='64' path='./tests/data/test-read-common/test4.c' comp-dir-path='/home/byby/oracle/src/libabigail' language='LANG_C11'>
     <type-decl name='char' size-in-bits='8' id='type-id-1'/>
     <type-decl name='unsigned int' size-in-bits='32' id='type-id-2'/>
     <pointer-type-def type-id='type-id-1' size-in-bits='64' id='type-id-3'/>
@@ -13,10 +13,10 @@
     <qualified-type-def type-id='type-id-1' const='yes' id='type-id-5'/>
     <pointer-type-def type-id='type-id-5' size-in-bits='64' id='type-id-6'/>
     <qualified-type-def type-id='type-id-6' restrict='yes' id='type-id-7'/>
-    <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='type-id-4' name='s1' filepath='/home/mark/src/tests/test4.c' line='2' column='1'/>
-      <parameter type-id='type-id-7' name='s2' filepath='/home/mark/src/tests/test4.c' line='2' column='1'/>
-      <parameter type-id='type-id-2' name='n' filepath='/home/mark/src/tests/test4.c' line='2' column='1'/>
+    <function-decl name='cpy' mangled-name='cpy' filepath='./tests/data/test-read-common/test4.c' line='4' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='cpy'>
+      <parameter type-id='type-id-4' name='s1' filepath='./tests/data/test-read-common/test4.c' line='4' column='1'/>
+      <parameter type-id='type-id-7' name='s2' filepath='./tests/data/test-read-common/test4.c' line='4' column='1'/>
+      <parameter type-id='type-id-2' name='n' filepath='./tests/data/test-read-common/test4.c' line='4' column='1'/>
       <return type-id='type-id-3'/>
     </function-decl>
   </abi-instr>
diff --git a/tests/data/test-read-dwarf/test4.so.hash.abi b/tests/data/test-read-common/test4-dwarf.so.hash.abi
similarity index 51%
rename from tests/data/test-read-dwarf/test4.so.hash.abi
rename to tests/data/test-read-common/test4-dwarf.so.hash.abi
index 52652bf7..9fffaeb0 100644
--- a/tests/data/test-read-dwarf/test4.so.hash.abi
+++ b/tests/data/test-read-common/test4-dwarf.so.hash.abi
@@ -1,11 +1,11 @@
-<abi-corpus version='2.0' path='data/test-read-dwarf/test4.so'>
+<abi-corpus version='2.0' path='data/test-read-common/test4.so' soname='test4.so.1'>
   <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 address-size='64' path='test4.c' comp-dir-path='/home/mark/src/tests' language='LANG_C89'>
+  <abi-instr address-size='64' path='./tests/data/test-read-common/test4.c' comp-dir-path='/home/byby/oracle/src/libabigail' language='LANG_C11'>
     <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'/>
@@ -13,10 +13,10 @@
     <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'/>
+    <function-decl name='cpy' mangled-name='cpy' filepath='./tests/data/test-read-common/test4.c' line='4' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='cpy'>
+      <parameter type-id='266fe297' name='s1' filepath='./tests/data/test-read-common/test4.c' line='4' column='1'/>
+      <parameter type-id='9d26089a' name='s2' filepath='./tests/data/test-read-common/test4.c' line='4' column='1'/>
+      <parameter type-id='f0981eeb' name='n' filepath='./tests/data/test-read-common/test4.c' line='4' column='1'/>
       <return type-id='26a90f95'/>
     </function-decl>
   </abi-instr>
diff --git a/tests/data/test-read-common/test4.c b/tests/data/test-read-common/test4.c
new file mode 100644
index 00000000..5fa5348b
--- /dev/null
+++ b/tests/data/test-read-common/test4.c
@@ -0,0 +1,11 @@
+// gcc -shared -gctf -g -mtune=generic -march=x86-64 -fPIC -Wl,-soname=test4.so.1 -o test4.so test4.c
+
+char *
+cpy (char * restrict s1, const char * restrict s2, unsigned int n)
+{
+  char *t1 = s1;
+  const char *t2 = s2;
+  while(n-- > 0)
+    *t1++ = *t2++;
+  return s1;
+}
diff --git a/tests/data/test-read-common/test4.so b/tests/data/test-read-common/test4.so
new file mode 100755
index 0000000000000000000000000000000000000000..2d665a8e1b0407e398ef824f61c8ac6ce8ec29ff
GIT binary patch
diff --git a/tests/data/test-read-ctf/test-alias.c b/tests/data/test-read-ctf/test-alias.c
new file mode 100644
index 00000000..a7812736
--- /dev/null
+++ b/tests/data/test-read-ctf/test-alias.c
@@ -0,0 +1,16 @@
+
+// function aliases
+
+void main_func(void);
+void alias_func(void) __attribute__((weak, alias("main_func")));
+
+void main_func(void)
+{
+
+}
+
+// variables aliases
+
+int main_var;
+extern int alias_var __attribute__((weak, alias("main_var")));
+
diff --git a/tests/data/test-read-ctf/test-alias.o.abi b/tests/data/test-read-ctf/test-alias.o.abi
new file mode 100644
index 00000000..90ca3f28
--- /dev/null
+++ b/tests/data/test-read-ctf/test-alias.o.abi
@@ -0,0 +1,19 @@
+<abi-corpus version='2.0' path='data/test-read-ctf/test-alias.o'>
+  <elf-function-symbols>
+    <elf-symbol name='alias_func' type='func-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='main_func' type='func-type' binding='global-binding' visibility='default-visibility' alias='alias_func,main_var,alias_var' is-defined='yes'/>
+  </elf-function-symbols>
+  <elf-variable-symbols>
+    <elf-symbol name='alias_var' size='4' type='object-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='main_var' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-variable-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='95e97e5e'/>
+    <function-decl name='main_func' visibility='default' binding='global' size-in-bits='64' alignment-in-bits='8'>
+      <return type-id='48b5725f'/>
+    </function-decl>
+    <var-decl name='alias_var' type-id='95e97e5e' mangled-name='alias_var' visibility='default'/>
+    <var-decl name='main_var' type-id='95e97e5e' mangled-name='main_var' visibility='default'/>
+    <type-decl name='void' id='48b5725f'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-ctf/test-ambiguous-struct-A.c b/tests/data/test-read-ctf/test-ambiguous-struct-A.c
new file mode 100644
index 00000000..67047c44
--- /dev/null
+++ b/tests/data/test-read-ctf/test-ambiguous-struct-A.c
@@ -0,0 +1,8 @@
+struct A;
+struct B { struct A *a; };
+struct A { struct B b; long foo; long bar; struct B b2; };
+
+typedef struct A a_array[50];
+a_array *foo __attribute__((__used__));
+
+static struct A a __attribute ((__used__));
diff --git a/tests/data/test-read-ctf/test-ambiguous-struct-A.o.hash.abi b/tests/data/test-read-ctf/test-ambiguous-struct-A.o.hash.abi
new file mode 100644
index 00000000..f0da1381
--- /dev/null
+++ b/tests/data/test-read-ctf/test-ambiguous-struct-A.o.hash.abi
@@ -0,0 +1,36 @@
+<abi-corpus version='2.0' path='data/test-read-ctf/test-ambiguous-struct-A.o'>
+  <elf-variable-symbols>
+    <elf-symbol name='foo' size='8' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-variable-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <array-type-def dimensions='1' type-id='3ed987a4' size-in-bits='12800' alignment-in-bits='64' id='e022be37'>
+      <subrange length='50' type-id='7359adad' id='3c1860ce'/>
+    </array-type-def>
+    <class-decl name='A' size-in-bits='256' alignment-in-bits='64' is-struct='yes' visibility='default' id='3ed987a4'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='b' type-id='41d98c5d' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='64'>
+        <var-decl name='foo' type-id='bd54fe1a' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='128'>
+        <var-decl name='bar' type-id='bd54fe1a' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='192'>
+        <var-decl name='b2' type-id='41d98c5d' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <class-decl name='B' size-in-bits='64' alignment-in-bits='64' is-struct='yes' visibility='default' id='41d98c5d'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='a' type-id='84d5ac12' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <type-decl name='long int' size-in-bits='64' alignment-in-bits='64' id='bd54fe1a'/>
+    <typedef-decl name='a_array' type-id='e022be37' id='1c12b755'/>
+    <type-decl name='unsigned long int' size-in-bits='64' alignment-in-bits='64' id='7359adad'/>
+    <pointer-type-def type-id='3ed987a4' size-in-bits='64' alignment-in-bits='64' id='84d5ac12'/>
+    <pointer-type-def type-id='1c12b755' size-in-bits='64' alignment-in-bits='64' id='55cd64e8'/>
+    <var-decl name='a' type-id='3ed987a4' mangled-name='a' visibility='default'/>
+    <var-decl name='foo' type-id='55cd64e8' mangled-name='foo' visibility='default'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-ctf/test-ambiguous-struct-B.c b/tests/data/test-read-ctf/test-ambiguous-struct-B.c
new file mode 100644
index 00000000..95a93469
--- /dev/null
+++ b/tests/data/test-read-ctf/test-ambiguous-struct-B.c
@@ -0,0 +1,5 @@
+struct A;
+struct B { struct A *a; };
+struct A { struct B b; int foo; struct B b2; };
+
+static struct A a __attribute__((__used__));
diff --git a/tests/data/test-read-ctf/test-ambiguous-struct-B.o.hash.abi b/tests/data/test-read-ctf/test-ambiguous-struct-B.o.hash.abi
new file mode 100644
index 00000000..da969de3
--- /dev/null
+++ b/tests/data/test-read-ctf/test-ambiguous-struct-B.o.hash.abi
@@ -0,0 +1,23 @@
+<abi-corpus version='2.0' path='data/test-read-ctf/test-ambiguous-struct-B.o'>
+  <abi-instr address-size='64' language='LANG_C'>
+    <class-decl name='A' size-in-bits='192' alignment-in-bits='64' is-struct='yes' visibility='default' id='3ed987a4'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='b' type-id='41d98c5d' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='64'>
+        <var-decl name='foo' type-id='95e97e5e' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='128'>
+        <var-decl name='b2' type-id='41d98c5d' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <class-decl name='B' size-in-bits='64' alignment-in-bits='64' is-struct='yes' visibility='default' id='41d98c5d'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='a' type-id='84d5ac12' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='95e97e5e'/>
+    <pointer-type-def type-id='3ed987a4' size-in-bits='64' alignment-in-bits='64' id='84d5ac12'/>
+    <var-decl name='a' type-id='3ed987a4' mangled-name='a' visibility='default'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-ctf/test-conflicting-type-syms-a.c b/tests/data/test-read-ctf/test-conflicting-type-syms-a.c
new file mode 100644
index 00000000..65414877
--- /dev/null
+++ b/tests/data/test-read-ctf/test-conflicting-type-syms-a.c
@@ -0,0 +1,5 @@
+typedef long a_t;
+typedef long b_t;
+
+a_t *a;
+b_t ignore2;
diff --git a/tests/data/test-read-ctf/test-conflicting-type-syms-a.o.hash.abi b/tests/data/test-read-ctf/test-conflicting-type-syms-a.o.hash.abi
new file mode 100644
index 00000000..cbe6b8cc
--- /dev/null
+++ b/tests/data/test-read-ctf/test-conflicting-type-syms-a.o.hash.abi
@@ -0,0 +1,14 @@
+<abi-corpus version='2.0' path='data/test-read-ctf/test-conflicting-type-syms-a.o'>
+  <elf-variable-symbols>
+    <elf-symbol name='a' size='8' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='ignore2' size='8' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-variable-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <type-decl name='long int' size-in-bits='64' alignment-in-bits='64' id='bd54fe1a'/>
+    <typedef-decl name='a_t' type-id='bd54fe1a' id='40acc204'/>
+    <typedef-decl name='b_t' type-id='bd54fe1a' id='b3d2db81'/>
+    <pointer-type-def type-id='40acc204' size-in-bits='64' alignment-in-bits='64' id='c6fd4117'/>
+    <var-decl name='a' type-id='c6fd4117' mangled-name='a' visibility='default'/>
+    <var-decl name='ignore2' type-id='b3d2db81' mangled-name='ignore2' visibility='default'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-ctf/test-conflicting-type-syms-b.c b/tests/data/test-read-ctf/test-conflicting-type-syms-b.c
new file mode 100644
index 00000000..e458021e
--- /dev/null
+++ b/tests/data/test-read-ctf/test-conflicting-type-syms-b.c
@@ -0,0 +1,5 @@
+typedef long a_t;
+typedef long b_t;
+
+a_t b;
+b_t ignore1;
diff --git a/tests/data/test-read-ctf/test-conflicting-type-syms-b.o.hash.abi b/tests/data/test-read-ctf/test-conflicting-type-syms-b.o.hash.abi
new file mode 100644
index 00000000..65921b6e
--- /dev/null
+++ b/tests/data/test-read-ctf/test-conflicting-type-syms-b.o.hash.abi
@@ -0,0 +1,13 @@
+<abi-corpus version='2.0' path='data/test-read-ctf/test-conflicting-type-syms-b.o'>
+  <elf-variable-symbols>
+    <elf-symbol name='b' size='8' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='ignore1' size='8' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-variable-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <type-decl name='long int' size-in-bits='64' alignment-in-bits='64' id='bd54fe1a'/>
+    <typedef-decl name='a_t' type-id='bd54fe1a' id='40acc204'/>
+    <typedef-decl name='b_t' type-id='bd54fe1a' id='b3d2db81'/>
+    <var-decl name='b' type-id='40acc204' mangled-name='b' visibility='default'/>
+    <var-decl name='ignore1' type-id='b3d2db81' mangled-name='ignore1' visibility='default'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-ctf/test-enum-ctf.c b/tests/data/test-read-ctf/test-enum-ctf.c
new file mode 100644
index 00000000..aa60d727
--- /dev/null
+++ b/tests/data/test-read-ctf/test-enum-ctf.c
@@ -0,0 +1,8 @@
+/* Looked up item by item. */
+enum e { ENUMSAMPLE_1 = 0, ENUMSAMPLE_2 = 1 };
+
+/* Looked up via both sorts of iterator in turn.  */
+enum ie { IENUMSAMPLE_1 = -10, IENUMSAMPLE_2, IENUMSAMPLE_3 };
+
+enum e foo;
+enum ie bar;
diff --git a/tests/data/test-read-ctf/test-enum-ctf.o.abi b/tests/data/test-read-ctf/test-enum-ctf.o.abi
new file mode 100644
index 00000000..e9104d87
--- /dev/null
+++ b/tests/data/test-read-ctf/test-enum-ctf.o.abi
@@ -0,0 +1,24 @@
+<abi-corpus version='2.0' path='data/test-read-ctf/test-enum-ctf.o'>
+  <elf-variable-symbols>
+    <elf-symbol name='bar' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='foo' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-variable-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <type-decl name='' is-anonymous='yes' size-in-bits='32' alignment-in-bits='32' id='type-id-1'/>
+    <enum-decl name='e' linkage-name='e' id='type-id-2'>
+      <underlying-type type-id='type-id-1'/>
+      <enumerator name='ENUMSAMPLE_1' value='0'/>
+      <enumerator name='ENUMSAMPLE_2' value='1'/>
+    </enum-decl>
+    <enum-decl name='ie' linkage-name='ie' id='type-id-3'>
+      <underlying-type type-id='type-id-1'/>
+      <enumerator name='IENUMSAMPLE_1' value='-10'/>
+      <enumerator name='IENUMSAMPLE_2' value='-9'/>
+      <enumerator name='IENUMSAMPLE_3' value='-8'/>
+    </enum-decl>
+    <type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='type-id-4'/>
+    <type-decl name='unsigned int' size-in-bits='32' alignment-in-bits='32' id='type-id-5'/>
+    <var-decl name='foo' type-id='type-id-2' mangled-name='foo' visibility='default'/>
+    <var-decl name='bar' type-id='type-id-3' mangled-name='bar' visibility='default'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-ctf/test-enum-many-ctf.c b/tests/data/test-read-ctf/test-enum-many-ctf.c
new file mode 100644
index 00000000..f2297d72
--- /dev/null
+++ b/tests/data/test-read-ctf/test-enum-many-ctf.c
@@ -0,0 +1,10 @@
+/* Looked up item by item. */
+enum e { ENUMSAMPLE_1 = 0, ENUMSAMPLE_2 = 1 };
+
+/* Looked up via both sorts of iterator in turn.  */
+enum ie { IE_0 = -10, IE_1, IE_2, IE_3, IE_4, IE_5, IE_6, IE_7, IE_8, IE_9, IE_A, IE_B, IE_C, IE_D, IE_E, IE_F,
+	  IE_10, IE_11, IE_12, IE_13, IE_14, IE_15, IE_16, IE_17, IE_18, IE_19, IE_1A, IE_1B, IE_1C, IE_1D, IE_1E, IE_1F,
+	  IE_20, IE_21, IE_22, IE_23, IE_24, IE_25, IE_26, IE_27, IE_28, IE_29, IE_2A, IE_2B, IE_2C, IE_2D, IE_2E, IE_2F};
+
+enum e foo;
+enum ie bar;
diff --git a/tests/data/test-read-ctf/test-enum-many-ctf.o.hash.abi b/tests/data/test-read-ctf/test-enum-many-ctf.o.hash.abi
new file mode 100644
index 00000000..d69f290b
--- /dev/null
+++ b/tests/data/test-read-ctf/test-enum-many-ctf.o.hash.abi
@@ -0,0 +1,69 @@
+<abi-corpus version='2.0' path='data/test-read-ctf/test-enum-many-ctf.o'>
+  <elf-variable-symbols>
+    <elf-symbol name='bar' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='foo' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-variable-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <type-decl name='' is-anonymous='yes' size-in-bits='32' alignment-in-bits='32' id='811c9dc5'/>
+    <enum-decl name='e' linkage-name='e' id='a6c2eddf'>
+      <underlying-type type-id='811c9dc5'/>
+      <enumerator name='ENUMSAMPLE_1' value='0'/>
+      <enumerator name='ENUMSAMPLE_2' value='1'/>
+    </enum-decl>
+    <enum-decl name='ie' linkage-name='ie' id='1ee696ca'>
+      <underlying-type type-id='811c9dc5'/>
+      <enumerator name='IE_0' value='-10'/>
+      <enumerator name='IE_1' value='-9'/>
+      <enumerator name='IE_2' value='-8'/>
+      <enumerator name='IE_3' value='-7'/>
+      <enumerator name='IE_4' value='-6'/>
+      <enumerator name='IE_5' value='-5'/>
+      <enumerator name='IE_6' value='-4'/>
+      <enumerator name='IE_7' value='-3'/>
+      <enumerator name='IE_8' value='-2'/>
+      <enumerator name='IE_9' value='-1'/>
+      <enumerator name='IE_A' value='0'/>
+      <enumerator name='IE_B' value='1'/>
+      <enumerator name='IE_C' value='2'/>
+      <enumerator name='IE_D' value='3'/>
+      <enumerator name='IE_E' value='4'/>
+      <enumerator name='IE_F' value='5'/>
+      <enumerator name='IE_10' value='6'/>
+      <enumerator name='IE_11' value='7'/>
+      <enumerator name='IE_12' value='8'/>
+      <enumerator name='IE_13' value='9'/>
+      <enumerator name='IE_14' value='10'/>
+      <enumerator name='IE_15' value='11'/>
+      <enumerator name='IE_16' value='12'/>
+      <enumerator name='IE_17' value='13'/>
+      <enumerator name='IE_18' value='14'/>
+      <enumerator name='IE_19' value='15'/>
+      <enumerator name='IE_1A' value='16'/>
+      <enumerator name='IE_1B' value='17'/>
+      <enumerator name='IE_1C' value='18'/>
+      <enumerator name='IE_1D' value='19'/>
+      <enumerator name='IE_1E' value='20'/>
+      <enumerator name='IE_1F' value='21'/>
+      <enumerator name='IE_20' value='22'/>
+      <enumerator name='IE_21' value='23'/>
+      <enumerator name='IE_22' value='24'/>
+      <enumerator name='IE_23' value='25'/>
+      <enumerator name='IE_24' value='26'/>
+      <enumerator name='IE_25' value='27'/>
+      <enumerator name='IE_26' value='28'/>
+      <enumerator name='IE_27' value='29'/>
+      <enumerator name='IE_28' value='30'/>
+      <enumerator name='IE_29' value='31'/>
+      <enumerator name='IE_2A' value='32'/>
+      <enumerator name='IE_2B' value='33'/>
+      <enumerator name='IE_2C' value='34'/>
+      <enumerator name='IE_2D' value='35'/>
+      <enumerator name='IE_2E' value='36'/>
+      <enumerator name='IE_2F' value='37'/>
+    </enum-decl>
+    <type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='95e97e5e'/>
+    <type-decl name='unsigned int' size-in-bits='32' alignment-in-bits='32' id='f0981eeb'/>
+    <var-decl name='foo' type-id='a6c2eddf' mangled-name='foo' visibility='default'/>
+    <var-decl name='bar' type-id='1ee696ca' mangled-name='bar' visibility='default'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-ctf/test-enum-symbol-ctf.c b/tests/data/test-read-ctf/test-enum-symbol-ctf.c
new file mode 100644
index 00000000..f7f99c67
--- /dev/null
+++ b/tests/data/test-read-ctf/test-enum-symbol-ctf.c
@@ -0,0 +1 @@
+enum {red1, green1, blue1} primary1;
diff --git a/tests/data/test-read-ctf/test-enum-symbol-ctf.o.hash.abi b/tests/data/test-read-ctf/test-enum-symbol-ctf.o.hash.abi
new file mode 100644
index 00000000..9bcf2d20
--- /dev/null
+++ b/tests/data/test-read-ctf/test-enum-symbol-ctf.o.hash.abi
@@ -0,0 +1,16 @@
+<abi-corpus version='2.0' path='data/test-read-ctf/test-enum-symbol-ctf.o'>
+  <elf-variable-symbols>
+    <elf-symbol name='primary1' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-variable-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <type-decl name='' is-anonymous='yes' size-in-bits='32' alignment-in-bits='32' id='811c9dc5'/>
+    <enum-decl name='' is-anonymous='yes' id='08f5ca17'>
+      <underlying-type type-id='811c9dc5'/>
+      <enumerator name='red1' value='0'/>
+      <enumerator name='green1' value='1'/>
+      <enumerator name='blue1' value='2'/>
+    </enum-decl>
+    <type-decl name='unsigned int' size-in-bits='32' alignment-in-bits='32' id='f0981eeb'/>
+    <var-decl name='primary1' type-id='08f5ca17' mangled-name='primary1' visibility='default'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-ctf/test-struct-iteration-ctf.c b/tests/data/test-read-ctf/test-struct-iteration-ctf.c
new file mode 100644
index 00000000..7df67ada
--- /dev/null
+++ b/tests/data/test-read-ctf/test-struct-iteration-ctf.c
@@ -0,0 +1,28 @@
+#include <unistd.h>
+
+struct foo_t
+{
+  int foo;
+  size_t bar;
+  const char *baz;
+  struct foo_t *self;
+  union
+  {
+    double should_not_appear;
+    char *nor_should_this;
+  } named;
+  struct
+  {
+    long unnamed_sub_member;
+    union
+    {
+      double one_more_level;
+      long yes_really_one_more;
+    };
+  };
+  struct {};		/* Empty ones */
+  union {};
+  int after_the_end;
+};
+
+struct foo_t used;
diff --git a/tests/data/test-read-ctf/test-struct-iteration-ctf.o.abi b/tests/data/test-read-ctf/test-struct-iteration-ctf.o.abi
new file mode 100644
index 00000000..cfc0b785
--- /dev/null
+++ b/tests/data/test-read-ctf/test-struct-iteration-ctf.o.abi
@@ -0,0 +1,96 @@
+<abi-corpus version='2.0' path='data/test-read-ctf/test-struct-iteration-ctf.o'>
+  <elf-variable-symbols>
+    <elf-symbol name='used' size='64' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-variable-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <type-decl name='char' size-in-bits='8' alignment-in-bits='8' id='type-id-1'/>
+    <class-decl name='' is-struct='yes' is-anonymous='yes' visibility='default' id='type-id-2'/>
+    <class-decl name='' size-in-bits='128' alignment-in-bits='64' is-struct='yes' is-anonymous='yes' visibility='default' id='type-id-3'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='unnamed_sub_member' type-id='type-id-4' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='64'>
+        <var-decl name='' type-id='type-id-5' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='one_more_level' type-id='type-id-6' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='yes_really_one_more' type-id='type-id-4' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <class-decl name='foo_t' size-in-bits='512' alignment-in-bits='32' is-struct='yes' visibility='default' id='type-id-7'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='foo' type-id='type-id-8' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='64'>
+        <var-decl name='bar' type-id='type-id-9' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='128'>
+        <var-decl name='baz' type-id='type-id-10' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='192'>
+        <var-decl name='self' type-id='type-id-11' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='256'>
+        <var-decl name='named' type-id='type-id-12' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='64'>
+        <var-decl name='' type-id='type-id-3' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='unnamed_sub_member' type-id='type-id-4' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='64'>
+        <var-decl name='' type-id='type-id-5' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='one_more_level' type-id='type-id-6' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='yes_really_one_more' type-id='type-id-4' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='64'>
+        <var-decl name='' type-id='type-id-2' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='64'>
+        <var-decl name='' type-id='type-id-13' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='448'>
+        <var-decl name='after_the_end' type-id='type-id-8' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <type-decl name='double' size-in-bits='64' alignment-in-bits='64' id='type-id-6'/>
+    <type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='type-id-8'/>
+    <type-decl name='long int' size-in-bits='64' alignment-in-bits='64' id='type-id-4'/>
+    <type-decl name='short int' size-in-bits='16' alignment-in-bits='16' id='type-id-14'/>
+    <type-decl name='signed char' size-in-bits='8' alignment-in-bits='8' id='type-id-15'/>
+    <typedef-decl name='size_t' type-id='type-id-16' id='type-id-9'/>
+    <union-decl name='' size-in-bits='64' is-anonymous='yes' visibility='default' id='type-id-12'>
+      <data-member access='public'>
+        <var-decl name='should_not_appear' type-id='type-id-6' visibility='default'/>
+      </data-member>
+      <data-member access='public'>
+        <var-decl name='nor_should_this' type-id='type-id-17' visibility='default'/>
+      </data-member>
+    </union-decl>
+    <union-decl name='' is-anonymous='yes' visibility='default' id='type-id-13'/>
+    <union-decl name='' size-in-bits='64' is-anonymous='yes' visibility='default' id='type-id-5'>
+      <data-member access='public'>
+        <var-decl name='one_more_level' type-id='type-id-6' visibility='default'/>
+      </data-member>
+      <data-member access='public'>
+        <var-decl name='yes_really_one_more' type-id='type-id-4' visibility='default'/>
+      </data-member>
+    </union-decl>
+    <type-decl name='unsigned char' size-in-bits='8' alignment-in-bits='8' id='type-id-18'/>
+    <type-decl name='unsigned int' size-in-bits='32' alignment-in-bits='32' id='type-id-19'/>
+    <type-decl name='unsigned long int' size-in-bits='64' alignment-in-bits='64' id='type-id-16'/>
+    <type-decl name='unsigned short int' size-in-bits='16' alignment-in-bits='16' id='type-id-20'/>
+    <pointer-type-def type-id='type-id-1' size-in-bits='64' alignment-in-bits='64' id='type-id-17'/>
+    <qualified-type-def type-id='type-id-1' const='yes' id='type-id-21'/>
+    <pointer-type-def type-id='type-id-21' size-in-bits='64' alignment-in-bits='64' id='type-id-10'/>
+    <pointer-type-def type-id='type-id-7' size-in-bits='64' alignment-in-bits='64' id='type-id-11'/>
+    <var-decl name='used' type-id='type-id-7' mangled-name='used' visibility='default'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-ctf/test0 b/tests/data/test-read-ctf/test0
new file mode 100644
index 0000000000000000000000000000000000000000..b30b8133cccb2663283de474de1e26493ad897d8
GIT binary patch
diff --git a/tests/data/test-read-ctf/test0.abi b/tests/data/test-read-ctf/test0.abi
new file mode 100644
index 00000000..b5ee8d78
--- /dev/null
+++ b/tests/data/test-read-ctf/test0.abi
@@ -0,0 +1,64 @@
+<abi-corpus version='2.0' path='data/test-read-ctf/test0'>
+  <elf-function-symbols>
+    <elf-symbol name='foo_1' 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='status' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='test_array' size='40' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='test_const' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='test_float' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='test_pointer' size='8' type='object-type' binding='global-binding' visibility='default-visibility' alias='test_volatile,test_const,foo_1' is-defined='yes'/>
+    <elf-symbol name='test_restrict' size='8' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='test_volatile' size='2' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-variable-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <type-decl name='' is-anonymous='yes' size-in-bits='1' alignment-in-bits='8' id='type-id-1'/>
+    <type-decl name='char' size-in-bits='8' alignment-in-bits='8' id='type-id-2'/>
+    <class-decl name='S' size-in-bits='32' alignment-in-bits='32' is-struct='yes' visibility='default' id='type-id-3'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='m0' type-id='type-id-4' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <class-decl name='' size-in-bits='32' alignment-in-bits='8' is-struct='yes' is-anonymous='yes' visibility='default' id='type-id-5'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='status0' type-id='type-id-1' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='1'>
+        <var-decl name='status1' type-id='type-id-1' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <type-decl name='float' size-in-bits='32' alignment-in-bits='32' id='type-id-6'/>
+    <type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='type-id-4'/>
+    <array-type-def dimensions='1' type-id='type-id-4' size-in-bits='320' alignment-in-bits='32' id='type-id-7'>
+      <subrange length='10' type-id='type-id-8' id='type-id-9'/>
+    </array-type-def>
+    <type-decl name='long int' size-in-bits='64' alignment-in-bits='64' id='type-id-10'/>
+    <type-decl name='short int' size-in-bits='16' alignment-in-bits='16' id='type-id-11'/>
+    <type-decl name='signed char' size-in-bits='8' alignment-in-bits='8' id='type-id-12'/>
+    <type-decl name='unsigned char' size-in-bits='8' alignment-in-bits='8' id='type-id-13'/>
+    <type-decl name='unsigned int' size-in-bits='32' alignment-in-bits='32' id='type-id-14'/>
+    <type-decl name='unsigned long int' size-in-bits='64' alignment-in-bits='64' id='type-id-8'/>
+    <type-decl name='unsigned short int' size-in-bits='16' alignment-in-bits='16' id='type-id-15'/>
+    <pointer-type-def type-id='type-id-3' size-in-bits='64' alignment-in-bits='64' id='type-id-16'/>
+    <pointer-type-def type-id='type-id-2' size-in-bits='64' alignment-in-bits='64' id='type-id-17'/>
+    <qualified-type-def type-id='type-id-3' const='yes' id='type-id-18'/>
+    <pointer-type-def type-id='type-id-10' size-in-bits='64' alignment-in-bits='64' id='type-id-19'/>
+    <qualified-type-def type-id='type-id-19' restrict='yes' id='type-id-20'/>
+    <qualified-type-def type-id='type-id-11' volatile='yes' id='type-id-21'/>
+    <var-decl name='status' type-id='type-id-5' mangled-name='status' visibility='default'/>
+    <var-decl name='test_pointer' type-id='type-id-17' mangled-name='test_pointer' visibility='default'/>
+    <var-decl name='test_const' type-id='type-id-18' mangled-name='test_const' visibility='default'/>
+    <var-decl name='test_float' type-id='type-id-6' mangled-name='test_float' visibility='default'/>
+    <function-decl name='foo_1' visibility='default' binding='global' size-in-bits='64' alignment-in-bits='8'>
+      <parameter type-id='type-id-16'/>
+      <return type-id='type-id-4'/>
+    </function-decl>
+    <function-decl name='main' visibility='default' binding='global' size-in-bits='64' alignment-in-bits='8'>
+      <return type-id='type-id-4'/>
+    </function-decl>
+    <var-decl name='test_array' type-id='type-id-7' mangled-name='test_array' visibility='default'/>
+    <var-decl name='test_restrict' type-id='type-id-20' mangled-name='test_restrict' visibility='default'/>
+    <var-decl name='test_volatile' type-id='type-id-21' mangled-name='test_volatile' visibility='default'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-ctf/test0.c b/tests/data/test-read-ctf/test0.c
new file mode 100644
index 00000000..eb702312
--- /dev/null
+++ b/tests/data/test-read-ctf/test0.c
@@ -0,0 +1,32 @@
+
+#include <stdio.h>
+
+char* test_pointer = NULL;
+int test_array[10] = {0};
+volatile short test_volatile = 1;
+float test_float = 0.0;
+
+struct {
+  unsigned int status0 : 1;
+  unsigned int status1 : 1;
+} status;
+
+
+struct S
+{
+  int m0;
+};
+
+const struct S test_const;
+long* restrict test_restrict;
+
+int
+foo_1(struct S* s)
+{
+  return s->m0;
+}
+
+int main()
+{
+
+}
diff --git a/tests/data/test-read-ctf/test0.hash.abi b/tests/data/test-read-ctf/test0.hash.abi
new file mode 100644
index 00000000..26706b60
--- /dev/null
+++ b/tests/data/test-read-ctf/test0.hash.abi
@@ -0,0 +1,64 @@
+<abi-corpus version='2.0' path='data/test-read-ctf/test0'>
+  <elf-function-symbols>
+    <elf-symbol name='foo_1' 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='status' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='test_array' size='40' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='test_const' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='test_float' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='test_pointer' size='8' type='object-type' binding='global-binding' visibility='default-visibility' alias='test_volatile,test_const,foo_1' is-defined='yes'/>
+    <elf-symbol name='test_restrict' size='8' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+    <elf-symbol name='test_volatile' size='2' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-variable-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <type-decl name='' is-anonymous='yes' size-in-bits='1' alignment-in-bits='8' id='811c9dc5'/>
+    <type-decl name='char' size-in-bits='8' alignment-in-bits='8' id='a84c031d'/>
+    <class-decl name='S' size-in-bits='32' alignment-in-bits='32' is-struct='yes' visibility='default' id='50d9a3fa'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='m0' type-id='95e97e5e' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <class-decl name='' size-in-bits='32' alignment-in-bits='8' is-struct='yes' is-anonymous='yes' visibility='default' id='e7f43f72'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='status0' type-id='811c9dc5' visibility='default'/>
+      </data-member>
+      <data-member access='public' layout-offset-in-bits='1'>
+        <var-decl name='status1' type-id='811c9dc5' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <type-decl name='float' size-in-bits='32' alignment-in-bits='32' id='a6c45d85'/>
+    <type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='95e97e5e'/>
+    <array-type-def dimensions='1' type-id='95e97e5e' size-in-bits='320' alignment-in-bits='32' id='b7bd1749'>
+      <subrange length='10' type-id='7359adad' id='487da03a'/>
+    </array-type-def>
+    <type-decl name='long int' size-in-bits='64' alignment-in-bits='64' id='bd54fe1a'/>
+    <type-decl name='short int' size-in-bits='16' alignment-in-bits='16' id='a2185560'/>
+    <type-decl name='signed char' size-in-bits='8' alignment-in-bits='8' id='28577a57'/>
+    <type-decl name='unsigned char' size-in-bits='8' alignment-in-bits='8' id='002ac4a6'/>
+    <type-decl name='unsigned int' size-in-bits='32' alignment-in-bits='32' id='f0981eeb'/>
+    <type-decl name='unsigned long int' size-in-bits='64' alignment-in-bits='64' id='7359adad'/>
+    <type-decl name='unsigned short int' size-in-bits='16' alignment-in-bits='16' id='8efea9e5'/>
+    <pointer-type-def type-id='50d9a3fa' size-in-bits='64' alignment-in-bits='64' id='fd01f598'/>
+    <pointer-type-def type-id='a84c031d' size-in-bits='64' alignment-in-bits='64' id='26a90f95'/>
+    <qualified-type-def type-id='50d9a3fa' const='yes' id='0fb3b55d'/>
+    <pointer-type-def type-id='bd54fe1a' size-in-bits='64' alignment-in-bits='64' id='3ccc2590'/>
+    <qualified-type-def type-id='3ccc2590' restrict='yes' id='af4b1b38'/>
+    <qualified-type-def type-id='a2185560' volatile='yes' id='ec67e496'/>
+    <var-decl name='status' type-id='e7f43f72' mangled-name='status' visibility='default'/>
+    <var-decl name='test_pointer' type-id='26a90f95' mangled-name='test_pointer' visibility='default'/>
+    <var-decl name='test_const' type-id='0fb3b55d' mangled-name='test_const' visibility='default'/>
+    <var-decl name='test_float' type-id='a6c45d85' mangled-name='test_float' visibility='default'/>
+    <function-decl name='foo_1' visibility='default' binding='global' size-in-bits='64' alignment-in-bits='8'>
+      <parameter type-id='fd01f598'/>
+      <return type-id='95e97e5e'/>
+    </function-decl>
+    <function-decl name='main' visibility='default' binding='global' size-in-bits='64' alignment-in-bits='8'>
+      <return type-id='95e97e5e'/>
+    </function-decl>
+    <var-decl name='test_array' type-id='b7bd1749' mangled-name='test_array' visibility='default'/>
+    <var-decl name='test_restrict' type-id='af4b1b38' mangled-name='test_restrict' visibility='default'/>
+    <var-decl name='test_volatile' type-id='ec67e496' mangled-name='test_volatile' visibility='default'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-ctf/test1.c b/tests/data/test-read-ctf/test1.c
new file mode 100644
index 00000000..3a5bac49
--- /dev/null
+++ b/tests/data/test-read-ctf/test1.c
@@ -0,0 +1,25 @@
+enum opaque_enum;
+struct opaque_struct;
+
+typedef enum opaque_enum opaque_enum;
+typedef struct opaque_struct opaque_struct;
+
+void
+fn(opaque_struct *, opaque_enum *e);
+
+enum opaque_enum
+{
+  e0,
+  e1
+};
+
+struct opaque_struct
+{
+  opaque_enum m0;
+};
+
+void
+fn(opaque_struct * s, opaque_enum *e)
+{
+  s->m0 = *e;
+}
diff --git a/tests/data/test-read-ctf/test1.so b/tests/data/test-read-ctf/test1.so
new file mode 100755
index 0000000000000000000000000000000000000000..df5ef8d38fa53081007cab96424e3d60b512751f
GIT binary patch
diff --git a/tests/data/test-read-ctf/test1.so.abi b/tests/data/test-read-ctf/test1.so.abi
new file mode 100644
index 00000000..dfcbfe3f
--- /dev/null
+++ b/tests/data/test-read-ctf/test1.so.abi
@@ -0,0 +1,23 @@
+<abi-corpus version='2.0' path='data/test-read-ctf/test1.so'>
+  <elf-function-symbols>
+    <elf-symbol name='fn' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-function-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <type-decl name='' is-anonymous='yes' size-in-bits='32' alignment-in-bits='32' id='type-id-1'/>
+    <class-decl name='opaque_struct' size-in-bits='32' alignment-in-bits='32' is-struct='yes' visibility='default' id='type-id-2'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='m0' type-id='type-id-3' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <enum-decl name='opaque_enum' linkage-name='opaque_enum' id='type-id-4'>
+      <underlying-type type-id='type-id-1'/>
+      <enumerator name='e0' value='0'/>
+      <enumerator name='e1' value='1'/>
+    </enum-decl>
+    <typedef-decl name='opaque_enum' type-id='type-id-4' id='type-id-3'/>
+    <typedef-decl name='opaque_struct' type-id='type-id-2' id='type-id-5'/>
+    <type-decl name='unsigned int' size-in-bits='32' alignment-in-bits='32' id='type-id-6'/>
+    <pointer-type-def type-id='type-id-3' size-in-bits='64' alignment-in-bits='64' id='type-id-7'/>
+    <pointer-type-def type-id='type-id-5' size-in-bits='64' alignment-in-bits='64' id='type-id-8'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-ctf/test1.so.hash.abi b/tests/data/test-read-ctf/test1.so.hash.abi
new file mode 100644
index 00000000..c9346476
--- /dev/null
+++ b/tests/data/test-read-ctf/test1.so.hash.abi
@@ -0,0 +1,23 @@
+<abi-corpus version='2.0' path='data/test-read-ctf/test1.so'>
+  <elf-function-symbols>
+    <elf-symbol name='fn' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-function-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <type-decl name='' is-anonymous='yes' size-in-bits='32' alignment-in-bits='32' id='811c9dc5'/>
+    <class-decl name='opaque_struct' size-in-bits='32' alignment-in-bits='32' is-struct='yes' visibility='default' id='6cde5052'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='m0' type-id='99fcd3a5' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <enum-decl name='opaque_enum' linkage-name='opaque_enum' id='55763a91'>
+      <underlying-type type-id='811c9dc5'/>
+      <enumerator name='e0' value='0'/>
+      <enumerator name='e1' value='1'/>
+    </enum-decl>
+    <typedef-decl name='opaque_enum' type-id='55763a91' id='99fcd3a5'/>
+    <typedef-decl name='opaque_struct' type-id='6cde5052' id='dae69ca1'/>
+    <type-decl name='unsigned int' size-in-bits='32' alignment-in-bits='32' id='f0981eeb'/>
+    <pointer-type-def type-id='99fcd3a5' size-in-bits='64' alignment-in-bits='64' id='0e0526e0'/>
+    <pointer-type-def type-id='dae69ca1' size-in-bits='64' alignment-in-bits='64' id='3f6e71d0'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-ctf/test2.c b/tests/data/test-read-ctf/test2.c
new file mode 100644
index 00000000..b04490a8
--- /dev/null
+++ b/tests/data/test-read-ctf/test2.c
@@ -0,0 +1,19 @@
+struct S0
+{
+  void* m0;
+};
+
+typedef const void* POINTER;
+
+struct S1
+{
+  POINTER m0;
+};
+
+void foo(struct S0* a __attribute__((unused)))
+{
+}
+
+void bar(struct S1* a __attribute__((unused)))
+{
+}
diff --git a/tests/data/test-read-ctf/test2.so b/tests/data/test-read-ctf/test2.so
new file mode 100755
index 0000000000000000000000000000000000000000..d9c07517527553d99951c2129da2f2ae6c1bce03
GIT binary patch
diff --git a/tests/data/test-read-ctf/test2.so.abi b/tests/data/test-read-ctf/test2.so.abi
new file mode 100644
index 00000000..40e6aab5
--- /dev/null
+++ b/tests/data/test-read-ctf/test2.so.abi
@@ -0,0 +1,25 @@
+<abi-corpus version='2.0' path='data/test-read-ctf/test2.so'>
+  <elf-function-symbols>
+    <elf-symbol name='bar' 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-function-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <class-decl name='S0' size-in-bits='64' alignment-in-bits='64' is-struct='yes' visibility='default' id='type-id-1'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='m0' type-id='type-id-2' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <class-decl name='S1' size-in-bits='64' alignment-in-bits='64' is-struct='yes' visibility='default' id='type-id-3'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='m0' type-id='type-id-4' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <typedef-decl name='POINTER' type-id='type-id-5' id='type-id-4'/>
+    <pointer-type-def type-id='type-id-1' size-in-bits='64' alignment-in-bits='64' id='type-id-6'/>
+    <pointer-type-def type-id='type-id-3' size-in-bits='64' alignment-in-bits='64' id='type-id-7'/>
+    <qualified-type-def type-id='type-id-8' const='yes' id='type-id-9'/>
+    <pointer-type-def type-id='type-id-9' size-in-bits='64' alignment-in-bits='64' id='type-id-5'/>
+    <pointer-type-def type-id='type-id-8' size-in-bits='64' alignment-in-bits='64' id='type-id-2'/>
+    <type-decl name='void' id='type-id-8'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-ctf/test2.so.hash.abi b/tests/data/test-read-ctf/test2.so.hash.abi
new file mode 100644
index 00000000..4148da48
--- /dev/null
+++ b/tests/data/test-read-ctf/test2.so.hash.abi
@@ -0,0 +1,25 @@
+<abi-corpus version='2.0' path='data/test-read-ctf/test2.so'>
+  <elf-function-symbols>
+    <elf-symbol name='bar' 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-function-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <class-decl name='S0' size-in-bits='64' alignment-in-bits='64' is-struct='yes' visibility='default' id='109cd6fe'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='m0' type-id='eaa32e2f' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <class-decl name='S1' size-in-bits='64' alignment-in-bits='64' is-struct='yes' visibility='default' id='119cd891'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='m0' type-id='8a34a235' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <typedef-decl name='POINTER' type-id='6e97a70c' id='8a34a235'/>
+    <pointer-type-def type-id='109cd6fe' size-in-bits='64' alignment-in-bits='64' id='842ea234'/>
+    <pointer-type-def type-id='119cd891' size-in-bits='64' alignment-in-bits='64' id='5e30a4f9'/>
+    <qualified-type-def type-id='48b5725f' const='yes' id='8581546e'/>
+    <pointer-type-def type-id='8581546e' size-in-bits='64' alignment-in-bits='64' id='6e97a70c'/>
+    <pointer-type-def type-id='48b5725f' size-in-bits='64' alignment-in-bits='64' id='eaa32e2f'/>
+    <type-decl name='void' id='48b5725f'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/data/test-read-dwarf/PR26261/Makefile b/tests/data/test-read-dwarf/PR26261/Makefile
deleted file mode 100644
index f66fa38a..00000000
--- a/tests/data/test-read-dwarf/PR26261/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-SRCS	= PR26261-obja.c PR26261-objb.c PR26261-main.c
-EXE	= PR26261-exe
-OBJS	= $(SRCS:.c=.o)
-CFLAGS	= -Wall -g
-
-all: $(EXE)
-
-%.o: %.c
-	$(CC) $(CFLAGS) -c $<
-
-$(EXE): $(OBJS)
-	gcc -fPIC $(OBJS) -o $@
-
-cleanobjs:
-	rm -rf $(OBJS)
-
-cleanexe:
-	rm $(EXE)
-
-clean: cleanobjs
-	rm -rf *~ 
diff --git a/tests/data/test-read-dwarf/PR26261/PR26261-exe b/tests/data/test-read-dwarf/PR26261/PR26261-exe
deleted file mode 100755
index 564a4247643942bbfd91c0e75653dffe80ce5851..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/tests/data/test-read-dwarf/PR27700/test-PR27700.o b/tests/data/test-read-dwarf/PR27700/test-PR27700.o
deleted file mode 100644
index 3f084d2132f0f43a683769ea91e9733fc599700a..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/tests/data/test-read-dwarf/test-PR26568-1.o b/tests/data/test-read-dwarf/test-PR26568-1.o
deleted file mode 100644
index 9249e16d4d52b4556b1cf071cc504d2a71204619..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/tests/data/test-read-dwarf/test-PR26568-2.o b/tests/data/test-read-dwarf/test-PR26568-2.o
deleted file mode 100644
index cc94708c9cb10e2f0f5e51aed7e7a713767caaf8..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/tests/data/test-read-dwarf/test3-alias-1.so.hash.abi b/tests/data/test-read-dwarf/test3-alias-1.so.hash.abi
deleted file mode 100644
index 0e8b2815..00000000
--- a/tests/data/test-read-dwarf/test3-alias-1.so.hash.abi
+++ /dev/null
@@ -1,14 +0,0 @@
-<abi-corpus version='2.0' 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-function-symbols>
-  <abi-instr address-size='64' path='test3.c' comp-dir-path='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf' language='LANG_C89'>
-    <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>
-    <type-decl name='void' id='48b5725f'/>
-  </abi-instr>
-</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test3-alias-2.so.hash.abi b/tests/data/test-read-dwarf/test3-alias-2.so.hash.abi
deleted file mode 100644
index a18e47e2..00000000
--- a/tests/data/test-read-dwarf/test3-alias-2.so.hash.abi
+++ /dev/null
@@ -1,18 +0,0 @@
-<abi-corpus version='2.0' 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='_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' is-defined='yes'/>
-    <elf-symbol name='foo__' type='func-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
-  </elf-function-symbols>
-  <abi-instr address-size='64' path='test3.c' comp-dir-path='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf' language='LANG_C89'>
-    <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>
-    <type-decl name='void' id='48b5725f'/>
-  </abi-instr>
-</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test3-alias-3.so.hash.abi b/tests/data/test-read-dwarf/test3-alias-3.so.hash.abi
deleted file mode 100644
index 8ae39bb1..00000000
--- a/tests/data/test-read-dwarf/test3-alias-3.so.hash.abi
+++ /dev/null
@@ -1,14 +0,0 @@
-<abi-corpus version='2.0' 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='weak-binding' visibility='default-visibility' is-defined='yes'/>
-  </elf-function-symbols>
-  <abi-instr address-size='64' path='test3.c' comp-dir-path='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf' language='LANG_C89'>
-    <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>
-    <type-decl name='void' id='48b5725f'/>
-  </abi-instr>
-</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test3-alias-4.so.hash.abi b/tests/data/test-read-dwarf/test3-alias-4.so.hash.abi
deleted file mode 100644
index 4d3a5b01..00000000
--- a/tests/data/test-read-dwarf/test3-alias-4.so.hash.abi
+++ /dev/null
@@ -1,8 +0,0 @@
-<abi-corpus version='2.0' 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='_init' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
-  </elf-function-symbols>
-</abi-corpus>
diff --git a/tests/data/test-read-dwarf/test3.so b/tests/data/test-read-dwarf/test3.so
deleted file mode 100755
index 4c426fc3c202d2f2dd027ffd8825ccfea36b2a09..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/tests/data/test-read-dwarf/test4.c b/tests/data/test-read-dwarf/test4.c
deleted file mode 100644
index 7f0abaa1..00000000
--- a/tests/data/test-read-dwarf/test4.c
+++ /dev/null
@@ -1,14 +0,0 @@
-// Test file for restrict (needs to be compiled by a GCC that actually emits
-// DW_TAG_restrict_type. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59051
-//
-// gcc -gdwarf-3 -std=c99 -shared -nostartfiles -o test4.so test4.c
-
-char *
-cpy (char * restrict s1, const char * restrict s2, unsigned int n)
-{
-  char *t1 = s1;
-  const char *t2 = s2;
-  while(n-- > 0)
-    *t1++ = *t2++;
-  return s1;
-}
diff --git a/tests/data/test-read-dwarf/test4.so b/tests/data/test-read-dwarf/test4.so
deleted file mode 100755
index 3be3f0d644190425cbb2a08ed7b4f1d164c13ef1..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/tests/test-annotate.cc b/tests/test-annotate.cc
index d6504dd4..828746c9 100644
--- a/tests/test-annotate.cc
+++ b/tests/test-annotate.cc
@@ -40,12 +40,12 @@ InOutSpec in_out_specs[] =
     "output/test-annotate/test2.so.abi"
   },
   {
-    "data/test-read-dwarf/test3.so",
+    "data/test-read-common/test3.so",
     "data/test-annotate/test3.so.abi",
     "output/test-annotate/test3.so.abi"
   },
   {
-    "data/test-read-dwarf/test4.so",
+    "data/test-read-common/test4.so",
     "data/test-annotate/test4.so.abi",
     "output/test-annotate/test4.so.abi"
   },
diff --git a/tests/test-read-common.cc b/tests/test-read-common.cc
new file mode 100644
index 00000000..431a660e
--- /dev/null
+++ b/tests/test-read-common.cc
@@ -0,0 +1,184 @@
+// -*- Mode: C++ -*-
+//
+
+#include <fstream>
+#include <cstring>
+#include "test-read-common.h"
+
+using std::ofstream;
+using std::cerr;
+using std::dynamic_pointer_cast;
+
+using abigail::tools_utils::emit_prefix;
+using abigail::tests::get_build_dir;
+using abigail::xml_writer::write_context_sptr;
+using abigail::xml_writer::create_write_context;
+using abigail::xml_writer::write_corpus;
+
+namespace abigail
+{
+namespace tests
+{
+namespace read_common
+{
+
+test_task::test_task(const InOutSpec &s,
+                     string& a_out_abi_base,
+                     string& a_in_elf_base,
+                     string& a_in_abi_base)
+    : is_ok(true),
+      spec(s),
+      out_abi_base(a_out_abi_base),
+      in_elf_base(a_in_elf_base),
+      in_abi_base(a_in_abi_base)
+  {}
+
+bool
+test_task::serialize_corpus(const string& out_abi_path,
+                            corpus_sptr corp)
+{
+  ofstream of(out_abi_path.c_str(), std::ios_base::trunc);
+  if (!of.is_open())
+    {
+       error_message = string("failed to read ") + out_abi_path + "\n";
+       return false;
+    }
+
+  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();
+
+  return true;
+}
+
+bool
+test_task::run_abidw(const string& extargs)
+{
+  string abidw = string(get_build_dir()) + "/tools/abidw";
+  string drop_private_types;
+  if (!in_public_headers_path.empty())
+    drop_private_types += "--headers-dir " + in_public_headers_path +
+      " --drop-private-types";
+  string cmd = abidw + " " + drop_private_types + " --abidiff " + extargs +
+   in_elf_path;
+  if (system(cmd.c_str()))
+    {
+      error_message = string("ABIs differ:\n")
+        + in_elf_path
+        + "\nand:\n"
+        + out_abi_path
+        + "\n";
+
+      return false;
+    }
+
+  return true;
+}
+
+bool
+test_task::run_diff()
+{
+  set_in_abi_path();
+  string cmd = "diff -u " + in_abi_path + " " + out_abi_path;
+  if (system(cmd.c_str()))
+    {
+      error_message = string("ABIs differ:\n")
+        + in_abi_path
+        + "\nand:\n"
+        + out_abi_path
+        + "\n";
+
+      return false;
+    }
+
+  return true;
+}
+
+void
+display_usage(const string& prog_name, ostream& out)
+{
+  emit_prefix(prog_name, out)
+    << "usage: " << prog_name << " [options]\n"
+    << " where options can be: \n"
+    << "  --help|-h  display this message\n"
+    << "  --no-parallel execute testsuite is a sigle thread\n"
+  ;
+}
+
+bool
+parse_command_line(int argc, char* argv[], options& opts)
+{
+  for (int i = 1; i < argc; ++i)
+    {
+      if (!strcmp(argv[i], "--no-parallel"))
+        opts.parallel = false;
+      else if (!strcmp(argv[i], "--help")
+               || !strcmp(argv[i], "--h"))
+        return false;
+      else
+        {
+          if (strlen(argv[i]) >= 2 && argv[i][0] == '-' && argv[i][1] == '-')
+            opts.wrong_option = argv[i];
+          return false;
+        }
+    }
+
+  return true;
+}
+
+bool
+run_tests(const size_t num_tests, const InOutSpec* specs,
+          const options& opts, create_new_test new_test)
+{
+  size_t num_workers = (opts.parallel
+                        ? std::min(abigail::workers::get_number_of_threads(),
+                                   num_tests)
+                        : 1);
+  abigail::workers::queue task_queue(num_workers);
+  bool is_ok = true;
+
+  string out_abi_base = string(get_build_dir()) + "/tests/";
+  string in_elf_base  = string(abigail::tests::get_src_dir()) + "/tests/";
+  string in_abi_base = in_elf_base;
+
+  for (const InOutSpec *s = specs; s->in_elf_path; ++s)
+    {
+      test_task_sptr t(new_test(s, out_abi_base,
+                                in_elf_base,
+                                in_abi_base));
+      ABG_ASSERT(task_queue.schedule_task(t));
+    }
+
+  /// Wait for all worker threads to finish their job, and wind down.
+  task_queue.wait_for_workers_to_complete();
+
+  // Now walk the results and print whatever error messages need to be
+  // printed.
+
+  const vector<abigail::workers::task_sptr>& completed_tasks =
+    task_queue.get_completed_tasks();
+
+  ABG_ASSERT(completed_tasks.size() == num_tests);
+
+  for (vector<abigail::workers::task_sptr>::const_iterator ti =
+         completed_tasks.begin();
+       ti != completed_tasks.end();
+       ++ti)
+    {
+      test_task_sptr t = dynamic_pointer_cast<test_task>(*ti);
+      if (!t->is_ok)
+        {
+          is_ok = false;
+          if (!t->error_message.empty())
+            cerr << t->error_message << '\n';
+        }
+    }
+
+  return !is_ok;
+}
+
+}//end namespace read_common
+}//end namespace tests
+}//end namespace abigail
diff --git a/tests/test-read-common.h b/tests/test-read-common.h
new file mode 100644
index 00000000..784f41f5
--- /dev/null
+++ b/tests/test-read-common.h
@@ -0,0 +1,148 @@
+#ifndef __TEST_READ_COMMON_H__
+#define __TEST_READ_COMMON_H__
+
+#include <string>
+#include "abg-ir.h"
+#include "abg-corpus.h"
+#include "abg-workers.h"
+#include "abg-writer.h"
+#include "test-utils.h"
+#include "abg-tools-utils.h"
+
+using std::string;
+
+using abigail::xml_writer::type_id_style_kind;
+using abigail::ir::corpus_sptr;
+
+namespace abigail
+{
+namespace tests
+{
+namespace read_common
+{
+
+/// This is an aggregate that specifies where a test shall get its
+/// input from, and where it shall write its ouput to.
+struct InOutSpec
+{
+  const char* in_elf_path;
+  const char* in_suppr_spec_path;
+  const char* in_public_headers_path;
+  type_id_style_kind type_id_style;
+  const char* in_abi_path;
+  const char* out_abi_path;
+};// end struct InOutSpec
+
+/// The task that peforms the tests.
+struct test_task : public abigail::workers::task
+{
+  bool is_ok;
+  InOutSpec spec;
+  string error_message;
+  string out_abi_base;
+  string in_elf_base;
+  string in_abi_base;
+
+  string in_elf_path;
+  string in_abi_path;
+  string in_suppr_spec_path;
+  string in_public_headers_path;
+  string out_abi_path;
+
+  void
+  set_in_elf_path()
+  {
+    in_elf_path = in_elf_base + spec.in_elf_path;
+  }
+
+  void
+  set_in_suppr_spec_path()
+  {
+    if (spec.in_suppr_spec_path)
+      in_suppr_spec_path = in_elf_base + spec.in_suppr_spec_path;
+    else
+      in_suppr_spec_path.clear();
+  }
+
+  void
+  set_in_public_headers_path()
+  {
+    if (spec.in_public_headers_path)
+      in_public_headers_path = spec.in_public_headers_path;
+    if (!in_public_headers_path.empty())
+      in_public_headers_path = in_elf_base + spec.in_public_headers_path;
+  }
+
+  bool
+  set_out_abi_path()
+  {
+    out_abi_path = out_abi_base + spec.out_abi_path;
+    if (!abigail::tools_utils::ensure_parent_dir_created(out_abi_path))
+      {
+          error_message =
+            string("Could not create parent directory for ") + out_abi_path;
+          return false;
+      }
+    return true;
+  }
+
+  void
+  set_in_abi_path()
+  {
+    in_abi_path = in_abi_base + spec.in_abi_path;
+  }
+
+  test_task(const InOutSpec &s,
+            string& a_out_abi_base,
+            string& a_in_elf_base,
+            string& a_in_abi_base);
+  bool
+  serialize_corpus(const string& out_abi_path,
+                   corpus_sptr corp);
+  bool
+  run_abidw(const string& extargs = "");
+
+  bool
+  run_diff();
+
+  virtual
+  ~test_task()
+  {}
+
+}; // end struct test_task
+
+typedef shared_ptr<test_task> test_task_sptr;
+
+struct options
+{
+  string        wrong_option;
+  bool          parallel;
+
+  options()
+    : parallel(true)
+  {}
+
+  ~options()
+  {
+  }
+};
+
+void
+display_usage(const string& prog_name, ostream& out);
+
+bool
+parse_command_line(int argc, char* argv[], options& opts);
+
+typedef test_task* (*create_new_test)(const InOutSpec* s,
+                                      string& a_out_abi_base,
+                                      string& a_in_elf_base,
+                                      string& a_in_abi_base);
+bool
+run_tests(const size_t num_test, const InOutSpec* specs,
+          const options& opts, create_new_test new_test);
+
+}//end namespace read_common
+}//end namespace tests
+}//end namespace abigail
+
+#endif //__TEST_READ_COMMON_H__
diff --git a/tests/test-read-ctf.cc b/tests/test-read-ctf.cc
new file mode 100644
index 00000000..bfa8c87b
--- /dev/null
+++ b/tests/test-read-ctf.cc
@@ -0,0 +1,328 @@
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+// -*- Mode: C++ -*-
+//
+// Copyright (C) 2021 Oracle, Inc.
+//
+// Author: Guillermo E. Martinez
+
+/// @file read ELF binaries containing CTF, save them in XML corpus
+/// files and diff the corpus files against reference XML corpus
+/// files.
+
+#include <cstdlib>
+#include <fstream>
+#include <iostream>
+#include <memory>
+#include <string>
+#include <vector>
+#include "abg-ctf-reader.h"
+#include "test-read-common.h"
+
+using std::string;
+using std::cerr;
+
+using abigail::tests::read_common::InOutSpec;
+using abigail::tests::read_common::test_task;
+using abigail::tests::read_common::display_usage;
+using abigail::tests::read_common::options;
+
+using abigail::ctf_reader::read_context_sptr;
+using abigail::ctf_reader::create_read_context;
+using abigail::xml_writer::SEQUENCE_TYPE_ID_STYLE;
+using abigail::xml_writer::HASH_TYPE_ID_STYLE;
+using abigail::tools_utils::emit_prefix;
+
+static InOutSpec in_out_specs[] =
+{
+  {
+    "data/test-read-ctf/test0",
+    "",
+    "",
+    SEQUENCE_TYPE_ID_STYLE,
+    "data/test-read-ctf/test0.abi",
+    "output/test-read-ctf/test0.abi"
+  },
+  {
+    "data/test-read-ctf/test0",
+    "",
+    "",
+    HASH_TYPE_ID_STYLE,
+    "data/test-read-ctf/test0.hash.abi",
+    "output/test-read-ctf/test0.hash.abi"
+  },
+  {
+    "data/test-read-ctf/test1.so",
+    "",
+    "",
+    SEQUENCE_TYPE_ID_STYLE,
+    "data/test-read-ctf/test1.so.abi",
+    "output/test-read-ctf/test1.so.abi"
+  },
+  {
+    "data/test-read-ctf/test1.so",
+    "",
+    "",
+    HASH_TYPE_ID_STYLE,
+    "data/test-read-ctf/test1.so.hash.abi",
+    "output/test-read-ctf/test1.so.hash.abi"
+  },
+  {
+    "data/test-read-ctf/test2.so",
+    "",
+    "",
+    SEQUENCE_TYPE_ID_STYLE,
+    "data/test-read-ctf/test2.so.abi",
+    "output/test-read-ctf/test2.so.abi"
+  },
+  {
+    "data/test-read-ctf/test2.so",
+    "",
+    "",
+    HASH_TYPE_ID_STYLE,
+    "data/test-read-ctf/test2.so.hash.abi",
+    "output/test-read-ctf/test2.so.hash.abi"
+  },
+  {
+    "data/test-read-common/test3.so",
+    "",
+    "",
+    SEQUENCE_TYPE_ID_STYLE,
+    "data/test-read-common/test3-ctf.so.abi",
+    "output/test-read-common/test3-ctf.so.abi"
+  },
+  {
+    "data/test-read-common/test3.so",
+    "",
+    "",
+    HASH_TYPE_ID_STYLE,
+    "data/test-read-common/test3-ctf.so.hash.abi",
+    "output/test-read-common/test3-ctf.so.hash.abi"
+  },
+  {
+    "data/test-read-ctf/test-enum-many-ctf.o",
+    "",
+    "",
+    HASH_TYPE_ID_STYLE,
+    "data/test-read-ctf/test-enum-many-ctf.o.hash.abi",
+    "output/test-read-ctf/test-enum-many-ctf.o.hash.abi"
+  },
+  {
+    "data/test-read-ctf/test-ambiguous-struct-A.o",
+    "",
+    "",
+    HASH_TYPE_ID_STYLE,
+    "data/test-read-ctf/test-ambiguous-struct-A.o.hash.abi",
+    "output/test-read-ctf/test-ambiguous-struct-A.o.hash.abi"
+  },
+  {
+    "data/test-read-ctf/test-ambiguous-struct-B.o",
+    "",
+    "",
+    HASH_TYPE_ID_STYLE,
+    "data/test-read-ctf/test-ambiguous-struct-B.o.hash.abi",
+    "output/test-read-ctf/test-ambiguous-struct-B.o.hash.abi"
+  },
+  {
+    "data/test-read-ctf/test-conflicting-type-syms-a.o",
+    "",
+    "",
+    HASH_TYPE_ID_STYLE,
+    "data/test-read-ctf/test-conflicting-type-syms-a.o.hash.abi",
+    "output/test-read-ctf/test-conflicting-type-syms-a.o.hash.abi"
+  },
+  {
+    "data/test-read-ctf/test-conflicting-type-syms-b.o",
+    "",
+    "",
+    HASH_TYPE_ID_STYLE,
+    "data/test-read-ctf/test-conflicting-type-syms-b.o.hash.abi",
+    "output/test-read-ctf/test-conflicting-type-syms-b.o.hash.abi"
+  },
+  {
+    "data/test-read-ctf/test-alias.o",
+    "",
+    "",
+    HASH_TYPE_ID_STYLE,
+    "data/test-read-ctf/test-alias.o.abi",
+    "output/test-read-ctf/test-alias.o.abi",
+  },
+  {
+    "data/test-read-common/test4.so",
+    "",
+    "",
+    SEQUENCE_TYPE_ID_STYLE,
+    "data/test-read-common/test4-ctf.so.abi",
+    "output/test-read-common/test4-ctf.so.abi"
+  },
+  {
+    "data/test-read-common/test4.so",
+    "",
+    "",
+    HASH_TYPE_ID_STYLE,
+    "data/test-read-common/test4-ctf.so.hash.abi",
+    "output/test-read-common/test4-ctf.so.hash.abi"
+  },
+  {
+    "data/test-read-ctf/test-enum-ctf.o",
+    "",
+    "",
+    SEQUENCE_TYPE_ID_STYLE,
+    "data/test-read-ctf/test-enum-ctf.o.abi",
+    "output/test-read-ctf/test-enum-ctf.o.abi"
+  },
+  {
+    "data/test-read-ctf/test-enum-symbol-ctf.o",
+    "",
+    "",
+    HASH_TYPE_ID_STYLE,
+    "data/test-read-ctf/test-enum-symbol-ctf.o.hash.abi",
+    "output/test-read-ctf/test-enum-symbol-ctf.o.hash.abi"
+  },
+  {
+    "data/test-read-ctf/test-struct-iteration-ctf.o",
+    "",
+    "",
+    SEQUENCE_TYPE_ID_STYLE,
+    "data/test-read-ctf/test-struct-iteration-ctf.o.abi",
+    "output/test-read-ctf/test-struct-iteration-ctf.o.abi"
+  },
+  {
+    "data/test-read-common/PR26261/PR26261-exe",
+    "",
+    "",
+    SEQUENCE_TYPE_ID_STYLE,
+    "data/test-read-common/PR26261/PR26261-exe-ctf.abi",
+    "output/test-read-common/PR26261/PR26261-exe-ctf.abi",
+  },
+  {
+    "data/test-read-common/test-PR26568-1.o",
+    "",
+    "",
+    SEQUENCE_TYPE_ID_STYLE,
+    "data/test-read-common/test-PR26568-1-ctf.o.abi",
+    "output/test-read-common/test-PR26568-1-ctf.o.abi",
+  },
+  {
+    "data/test-read-common/test-PR26568-2.o",
+    "",
+    "",
+    SEQUENCE_TYPE_ID_STYLE,
+    "data/test-read-common/test-PR26568-2-ctf.o.abi",
+    "output/test-read-common/test-PR26568-2-ctf.o.abi",
+  },
+  {
+    "data/test-read-common/PR27700/test-PR27700.o",
+    "",
+    "data/test-read-common/PR27700/pub-incdir",
+    HASH_TYPE_ID_STYLE,
+    "data/test-read-common/PR27700/test-PR27700-ctf.abi",
+    "output/test-read-common/PR27700/test-PR27700-ctf.abi",
+  },
+  // This should be the last entry.
+  {NULL, NULL, NULL, SEQUENCE_TYPE_ID_STYLE, NULL, NULL}
+};
+
+/// The task that peforms the tests.
+struct test_task_ctf : public test_task
+{
+  test_task_ctf(const InOutSpec &s,
+                string& a_out_abi_base,
+                string& a_in_elf_base,
+                string& a_in_abi_base);
+  virtual void
+  perform();
+
+  virtual
+  ~test_task_ctf()
+  {}
+};
+
+test_task_ctf::test_task_ctf(const InOutSpec &s,
+                             string& a_out_abi_base,
+                             string& a_in_elf_base,
+                             string& a_in_abi_base)
+        : test_task(s, a_out_abi_base, a_in_elf_base, a_in_abi_base)
+  {}
+
+/// The actual test.
+///
+/// This reads the corpus into memory, saves it to disk, loads it
+/// again and compares the new in-memory representation against the
+void
+test_task_ctf::perform()
+{
+  abigail::ir::environment_sptr env;
+
+  set_in_elf_path();
+  set_in_suppr_spec_path();
+
+  env.reset(new abigail::ir::environment);
+  ABG_ASSERT(abigail::tools_utils::file_exists(in_elf_path));
+
+  read_context_sptr ctxt = create_read_context(in_elf_path,
+                                               env.get());
+  ABG_ASSERT(ctxt);
+
+  corpus_sptr corp = read_corpus(ctxt.get());
+  // if there is no output and no input, assume that we do not care about the
+  // actual read result, just that it succeeded.
+  if (!spec.in_abi_path && !spec.out_abi_path)
+    {
+        // Phew! we made it here and we did not crash! yay!
+        return;
+    }
+  if (!corp)
+    {
+        error_message = string("failed to read ") + in_elf_path  + "\n";
+        is_ok = false;
+        return;
+    }
+  corp->set_path(spec.in_elf_path);
+  // Do not take architecture names in comparison so that these
+  // test input binaries can come from whatever arch the
+  // programmer likes.
+  corp->set_architecture_name("");
+
+  if (!(is_ok = set_out_abi_path()))
+      return;
+
+  if (!(is_ok = serialize_corpus(out_abi_path, corp)))
+       return;
+
+  if (!(is_ok = run_abidw("--ctf ")))
+    return;
+
+  if (!(is_ok = run_diff()))
+      return;
+}
+
+static test_task*
+new_task(const InOutSpec* s, string& a_out_abi_base,
+         string& a_in_elf_base, string& a_in_abi_base)
+{
+  return new test_task_ctf(*s, a_in_abi_base,
+                           a_in_elf_base, a_in_abi_base);
+}
+
+int
+main(int argc, char *argv[])
+{
+  options opts;
+  if (!parse_command_line(argc, argv, opts))
+    {
+      if (!opts.wrong_option.empty())
+        emit_prefix(argv[0], cerr)
+          << "unrecognized option: " << opts.wrong_option << "\n";
+        display_usage(argv[0], cerr);
+      return 1;
+    }
+
+  /// Create a task queue.  The max number of worker threads of the
+  /// queue is the number of the concurrent threads supported by the
+  /// processor of the machine this code runs on.  But if
+  /// --no-parallel was provided then the number of worker threads
+  /// equals 1.
+  const size_t num_tests = sizeof(in_out_specs) / sizeof (InOutSpec) - 1;
+
+  return run_tests(num_tests, in_out_specs, opts, new_task);
+}
diff --git a/tests/test-read-dwarf.cc b/tests/test-read-dwarf.cc
index 509bc11a..f0e74d4a 100644
--- a/tests/test-read-dwarf.cc
+++ b/tests/test-read-dwarf.cc
@@ -15,45 +15,28 @@
 #include <memory>
 #include <string>
 #include <vector>
-#include "abg-ir.h"
+// #include "abg-ir.h"
+#include "test-read-common.h"
 #include "abg-dwarf-reader.h"
-#include "abg-workers.h"
-#include "abg-writer.h"
-#include "abg-tools-utils.h"
-#include "test-utils.h"
 
 using std::vector;
 using std::string;
-using std::ofstream;
 using std::cerr;
-using std::dynamic_pointer_cast;
-using abigail::tests::get_build_dir;
+
+using abigail::tests::read_common::InOutSpec;
+using abigail::tests::read_common::test_task;
+using abigail::tests::read_common::display_usage;
+using abigail::tests::read_common::options;
+
 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::SEQUENCE_TYPE_ID_STYLE;
 using abigail::xml_writer::HASH_TYPE_ID_STYLE;
-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;
-
-/// This is an aggregate that specifies where a test shall get its
-/// input from, and where it shall write its ouput to.
-struct InOutSpec
-{
-  const char* in_elf_path;
-  const char* in_suppr_spec_path;
-  const char* in_public_headers_path;
-  type_id_style_kind type_id_style;
-  const char* in_abi_path;
-  const char* out_abi_path;
-};// end struct InOutSpec
-
+using abigail::tools_utils::emit_prefix;
 
-InOutSpec in_out_specs[] =
+static InOutSpec in_out_specs[] =
 {
   {
     "data/test-read-dwarf/test0",
@@ -104,56 +87,56 @@ InOutSpec in_out_specs[] =
     "output/test-read-dwarf/test2.so.hash.abi"
   },
   {
-    "data/test-read-dwarf/test3.so",
+    "data/test-read-common/test3.so",
     "",
     "",
     SEQUENCE_TYPE_ID_STYLE,
-    "data/test-read-dwarf/test3.so.abi",
-    "output/test-read-dwarf/test3.so.abi"
+    "data/test-read-common/test3-dwarf.so.abi",
+    "output/test-read-common/test3-dwarf.so.abi"
   },
   {
-    "data/test-read-dwarf/test3.so",
+    "data/test-read-common/test3.so",
     "",
     "",
     HASH_TYPE_ID_STYLE,
-    "data/test-read-dwarf/test3.so.hash.abi",
-    "output/test-read-dwarf/test3.so.hash.abi"
+    "data/test-read-common/test3-dwarf.so.hash.abi",
+    "output/test-read-common/test3-dwarf.so.hash.abi"
   },
   // suppress all except the main symbol of a group of aliases
   {
-    "data/test-read-dwarf/test3.so",
-    "data/test-read-dwarf/test3-alias-1.suppr",
+    "data/test-read-common/test3.so",
+    "data/test-read-common/test3-alias-1.suppr",
     "",
     HASH_TYPE_ID_STYLE,
-    "data/test-read-dwarf/test3-alias-1.so.hash.abi",
-    "output/test-read-dwarf/test3-alias-1.so.hash.abi"
+    "data/test-read-common/test3-alias-1-dwarf.so.hash.abi",
+    "output/test-read-common/test3-alias-1-dwarf.so.hash.abi"
   },
   // suppress the main symbol of a group of aliases
   {
-    "data/test-read-dwarf/test3.so",
-    "data/test-read-dwarf/test3-alias-2.suppr",
+    "data/test-read-common/test3.so",
+    "data/test-read-common/test3-alias-2.suppr",
     "",
     HASH_TYPE_ID_STYLE,
-    "data/test-read-dwarf/test3-alias-2.so.hash.abi",
-    "output/test-read-dwarf/test3-alias-2.so.hash.abi"
+    "data/test-read-common/test3-alias-2-dwarf.so.hash.abi",
+    "output/test-read-common/test3-alias-2-dwarf.so.hash.abi"
   },
   // suppress all except one non main symbol of a group of aliases
   {
-    "data/test-read-dwarf/test3.so",
-    "data/test-read-dwarf/test3-alias-3.suppr",
+    "data/test-read-common/test3.so",
+    "data/test-read-common/test3-alias-3.suppr",
     "",
     HASH_TYPE_ID_STYLE,
-    "data/test-read-dwarf/test3-alias-3.so.hash.abi",
-    "output/test-read-dwarf/test3-alias-3.so.hash.abi"
+    "data/test-read-common/test3-alias-3-dwarf.so.hash.abi",
+    "output/test-read-common/test3-alias-3-dwarf.so.hash.abi"
   },
   // suppress all symbols of a group of aliases
   {
-    "data/test-read-dwarf/test3.so",
-    "data/test-read-dwarf/test3-alias-4.suppr",
+    "data/test-read-common/test3.so",
+    "data/test-read-common/test3-alias-4.suppr",
     "",
     HASH_TYPE_ID_STYLE,
-    "data/test-read-dwarf/test3-alias-4.so.hash.abi",
-    "output/test-read-dwarf/test3-alias-4.so.hash.abi"
+    "data/test-read-common/test3-alias-4-dwarf.so.hash.abi",
+    "output/test-read-common/test3-alias-4-dwarf.so.hash.abi"
   },
   // suppress the main symbols with alias (function+variable) in .o file
   {
@@ -165,20 +148,20 @@ InOutSpec in_out_specs[] =
     "output/test-read-dwarf/test-suppressed-alias.o.abi",
   },
   {
-    "data/test-read-dwarf/test4.so",
+    "data/test-read-common/test4.so",
     "",
     "",
     SEQUENCE_TYPE_ID_STYLE,
-    "data/test-read-dwarf/test4.so.abi",
-    "output/test-read-dwarf/test4.so.abi"
+    "data/test-read-common/test4-dwarf.so.abi",
+    "output/test-read-common/test4-dwarf.so.abi"
   },
   {
-    "data/test-read-dwarf/test4.so",
+    "data/test-read-common/test4.so",
     "",
     "",
     HASH_TYPE_ID_STYLE,
-    "data/test-read-dwarf/test4.so.hash.abi",
-    "output/test-read-dwarf/test4.so.hash.abi"
+    "data/test-read-common/test4-dwarf.so.hash.abi",
+    "output/test-read-common/test4-dwarf.so.hash.abi"
   },
   {
     "data/test-read-dwarf/test5.o",
@@ -449,28 +432,28 @@ InOutSpec in_out_specs[] =
     NULL,
   },
   {
-    "data/test-read-dwarf/PR26261/PR26261-exe",
+    "data/test-read-common/PR26261/PR26261-exe",
     "",
     "",
     SEQUENCE_TYPE_ID_STYLE,
-    "data/test-read-dwarf/PR26261/PR26261-exe.abi",
-    "output/test-read-dwarf/PR26261/PR26261-exe.abi",
+    "data/test-read-common/PR26261/PR26261-exe-dwarf.abi",
+    "output/test-read-common/PR26261/PR26261-exe-dwarf.abi",
   },
   {
-    "data/test-read-dwarf/test-PR26568-1.o",
+    "data/test-read-common/test-PR26568-1.o",
     "",
     "",
     SEQUENCE_TYPE_ID_STYLE,
-    "data/test-read-dwarf/test-PR26568-1.o.abi",
-    "output/test-read-dwarf/test-PR26568-1.o.abi",
+    "data/test-read-common/test-PR26568-1-dwarf.o.abi",
+    "output/test-read-common/test-PR26568-1-dwarf.o.abi",
   },
   {
-    "data/test-read-dwarf/test-PR26568-2.o",
+    "data/test-read-common/test-PR26568-2.o",
     "",
     "",
     SEQUENCE_TYPE_ID_STYLE,
-    "data/test-read-dwarf/test-PR26568-2.o.abi",
-    "output/test-read-dwarf/test-PR26568-2.o.abi",
+    "data/test-read-common/test-PR26568-2-dwarf.o.abi",
+    "output/test-read-common/test-PR26568-2-dwarf.o.abi",
   },
   {
     "data/test-read-dwarf/test-libandroid.so",
@@ -481,12 +464,12 @@ InOutSpec in_out_specs[] =
     "output/test-read-dwarf/test-libandroid.so.abi",
   },
   {
-    "data/test-read-dwarf/PR27700/test-PR27700.o",
+    "data/test-read-common/PR27700/test-PR27700.o",
     "",
-    "data/test-read-dwarf/PR27700/pub-incdir",
+    "data/test-read-common/PR27700/pub-incdir",
     HASH_TYPE_ID_STYLE,
-    "data/test-read-dwarf/PR27700/test-PR27700.abi",
-    "output/test-read-dwarf/PR27700/test-PR27700.abi",
+    "data/test-read-common/PR27700/test-PR27700-dwarf.abi",
+    "output/test-read-common/PR27700/test-PR27700-dwarf.abi",
   },
   {
     "data/test-read-dwarf/test-libaaudio.so",
@@ -545,146 +528,107 @@ set_suppressions_from_headers(read_context& read_ctxt, const string& path)
 }
 
 /// The task that peforms the tests.
-struct test_task : public abigail::workers::task
+struct test_task_dwarf : public test_task
 {
-  bool is_ok;
-  InOutSpec spec;
-  string error_message;
-  string out_abi_base;
-  string in_elf_base;
-  string in_abi_base;
+  test_task_dwarf(const InOutSpec &s,
+                string& a_out_abi_base,
+                string& a_in_elf_base,
+                string& a_in_abi_base);
+  virtual void
+  perform();
 
-  test_task(const InOutSpec &s,
-	    string& a_out_abi_base,
-	    string& a_in_elf_base,
-	    string& a_in_abi_base)
-    : is_ok(true),
-      spec(s),
-      out_abi_base(a_out_abi_base),
-      in_elf_base(a_in_elf_base),
-      in_abi_base(a_in_abi_base)
+  virtual
+  ~test_task_dwarf()
   {}
+};
 
-  /// The actual test.
-  ///
-  /// This reads the corpus into memory, saves it to disk, loads it
-  /// again and compares the new in-memory representation against the
-  /// saved one.
-  virtual void
-  perform()
-  {
-    string in_elf_path, in_abi_path, in_suppr_spec_path, in_public_headers_path,
-      out_abi_path;
-    abigail::ir::environment_sptr env;
+/// The task that peforms the tests.
+test_task_dwarf::test_task_dwarf(const InOutSpec &s,
+                             string& a_out_abi_base,
+                             string& a_in_elf_base,
+                             string& a_in_abi_base)
+        : test_task(s, a_out_abi_base, a_in_elf_base, a_in_abi_base)
+  {}
 
-    in_elf_path = in_elf_base + spec.in_elf_path;
-    if (spec.in_suppr_spec_path)
-      in_suppr_spec_path = in_elf_base + spec.in_suppr_spec_path;
-    else
-      in_suppr_spec_path.clear();
+void
+test_task_dwarf::perform()
+{
+  abigail::ir::environment_sptr env;
 
-    if (spec.in_public_headers_path)
-      in_public_headers_path = spec.in_public_headers_path;
-    if (!in_public_headers_path.empty())
-      in_public_headers_path = in_elf_base + spec.in_public_headers_path;
+  set_in_elf_path();
+  set_in_suppr_spec_path();
+  set_in_public_headers_path();
 
-    env.reset(new abigail::ir::environment);
-    abigail::dwarf_reader::status status =
+  env.reset(new abigail::ir::environment);
+  abigail::dwarf_reader::status status =
     abigail::dwarf_reader::STATUS_UNKNOWN;
-    vector<char**> di_roots;
-    ABG_ASSERT(abigail::tools_utils::file_exists(in_elf_path));
-    read_context_sptr ctxt = create_read_context(in_elf_path,
-						 di_roots,
-						 env.get());
-    ABG_ASSERT(ctxt);
-    if (!in_suppr_spec_path.empty())
-      set_suppressions(*ctxt, in_suppr_spec_path);
-
-    if (!in_public_headers_path.empty())
-      set_suppressions_from_headers(*ctxt, in_public_headers_path);
+  vector<char**> di_roots;
+  ABG_ASSERT(abigail::tools_utils::file_exists(in_elf_path));
+  read_context_sptr ctxt = create_read_context(in_elf_path,
+                                               di_roots,
+                                               env.get());
+  ABG_ASSERT(ctxt);
+  if (!in_suppr_spec_path.empty())
+    set_suppressions(*ctxt, in_suppr_spec_path);
+
+  if (!in_public_headers_path.empty())
+    set_suppressions_from_headers(*ctxt, in_public_headers_path);
+
+  abigail::corpus_sptr corp = read_corpus_from_elf(*ctxt, status);
+  // if there is no output and no input, assume that we do not care about the
+  // actual read result, just that it succeeded.
+  if (!spec.in_abi_path && !spec.out_abi_path)
+    {
+      // Phew! we made it here and we did not crash! yay!
+      return;
+    }
+  if (!corp)
+    {
+      error_message = string("failed to read ") + in_elf_path  + "\n";
+      is_ok = false;
+      return;
+    }
+  corp->set_path(spec.in_elf_path);
+  // Do not take architecture names in comparison so that these
+  // test input binaries can come from whatever arch the
+  // programmer likes.
+  corp->set_architecture_name("");
 
-    abigail::corpus_sptr corp = read_corpus_from_elf(*ctxt, status);
-    // if there is no output and no input, assume that we do not care about the
-    // actual read result, just that it succeeded.
-    if (!spec.in_abi_path && !spec.out_abi_path)
-      {
-	// Phew! we made it here and we did not crash! yay!
-	return;
-      }
-    if (!corp)
-      {
-	error_message = string("failed to read ") + in_elf_path  + "\n";
-	is_ok = false;
-	return;
-      }
-    corp->set_path(spec.in_elf_path);
-    // Do not take architecture names in comparison so that these
-    // test input binaries can come from whatever arch the
-    // programmer likes.
-    corp->set_architecture_name("");
+  if (!(is_ok = set_out_abi_path()))
+      return;
 
-    out_abi_path = out_abi_base + spec.out_abi_path;
-    if (!abigail::tools_utils::ensure_parent_dir_created(out_abi_path))
-      {
-	error_message =
-	  string("Could not create parent directory for ") + out_abi_path;
-	is_ok = false;
-	return;
-      }
+  if (!(is_ok = serialize_corpus(out_abi_path, corp)))
+       return;
 
-    ofstream of(out_abi_path.c_str(), std::ios_base::trunc);
-    if (!of.is_open())
-      {
-	error_message = string("failed to read ") + out_abi_path + "\n";
-	is_ok = false;
-	return;
-      }
-    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();
+  if (!(is_ok = run_abidw()))
+    return;
 
-    string abidw = string(get_build_dir()) + "/tools/abidw";
-    string drop_private_types;
-    if (!in_public_headers_path.empty())
-      drop_private_types += "--headers-dir " + in_public_headers_path +
-	" --drop-private-types";
-    string cmd = abidw + " " + drop_private_types + " --abidiff " + in_elf_path;
-    if (system(cmd.c_str()))
-      {
-	error_message = string("ABIs differ:\n")
-	  + in_elf_path
-	  + "\nand:\n"
-	  + out_abi_path
-	  + "\n";
-	is_ok = false;
-      }
+  if (!(is_ok = run_diff()))
+      return;
+}
 
-    in_abi_path = in_abi_base + spec.in_abi_path;
-    cmd = "diff -u " + in_abi_path + " " + out_abi_path;
-    if (system(cmd.c_str()))
-      is_ok = false;
-  }
-}; // end struct test_task
 
-typedef shared_ptr<test_task> test_task_sptr;
+static test_task*
+new_task(const InOutSpec* s, string& a_out_abi_base,
+         string& a_in_elf_base, string& a_in_abi_base)
+{
+  return new test_task_dwarf(*s, a_in_abi_base,
+                             a_in_elf_base, a_in_abi_base);
+}
 
 int
 main(int argc, char *argv[])
 {
   bool no_parallel = false;
 
-  if (argc == 2)
+  options opts;
+  if (!parse_command_line(argc, argv, opts))
     {
-      if (argv[1] == string("--no-parallel"))
-	no_parallel = true;
-      else
-	{
-	  cerr << "unrecognized option\n";
-	  cerr << "usage: " << argv[0] << " [--no-parallel]\n" ;
-	  return 1;
-	}
+      if (!opts.wrong_option.empty())
+        emit_prefix(argv[0], cerr)
+          << "unrecognized option: " << opts.wrong_option << "\n";
+        display_usage(argv[0], cerr);
+      return 1;
     }
 
   /// Create a task queue.  The max number of worker threads of the
@@ -693,49 +637,6 @@ main(int argc, char *argv[])
   /// --no-parallel was provided then the number of worker threads
   /// equals 1.
   const size_t num_tests = sizeof(in_out_specs) / sizeof (InOutSpec) - 1;
-  size_t num_workers = (no_parallel
-			? 1
-			: std::min(abigail::workers::get_number_of_threads(),
-				   num_tests));
-  abigail::workers::queue task_queue(num_workers);
-  bool is_ok = true;
-
-  string out_abi_base = string(get_build_dir()) + "/tests/";
-  string in_elf_base  = string(abigail::tests::get_src_dir()) + "/tests/";
-  string in_abi_base = in_elf_base;
-
-  for (InOutSpec *s = in_out_specs; s->in_elf_path; ++s)
-    {
-      test_task_sptr t(new test_task(*s, out_abi_base,
-				     in_elf_base,
-				     in_abi_base));
-      ABG_ASSERT(task_queue.schedule_task(t));
-    }
-
-  /// Wait for all worker threads to finish their job, and wind down.
-  task_queue.wait_for_workers_to_complete();
-
-  // Now walk the results and print whatever error messages need to be
-  // printed.
-
-  const vector<abigail::workers::task_sptr>& completed_tasks =
-    task_queue.get_completed_tasks();
-
-  ABG_ASSERT(completed_tasks.size() == num_tests);
-
-  for (vector<abigail::workers::task_sptr>::const_iterator ti =
-	 completed_tasks.begin();
-       ti != completed_tasks.end();
-       ++ti)
-    {
-      test_task_sptr t = dynamic_pointer_cast<test_task>(*ti);
-      if (!t->is_ok)
-	{
-	  is_ok = false;
-	  if (!t->error_message.empty())
-	    cerr << t->error_message << '\n';
-	}
-    }
 
-  return !is_ok;
+  return run_tests(num_tests, in_out_specs, opts, new_task);
 }
