ctf-front-end: Add test for alias symbols

Message ID 20221221201233.139537-1-guillermo.e.martinez@oracle.com
State New
Headers
Series ctf-front-end: Add test for alias symbols |

Commit Message

Guillermo E. Martinez Dec. 21, 2022, 8:12 p.m. UTC
  This patch adds a new test case in the ctf-front-end test suite to
to test for alias symbols support.

	* tests/data/test-read-ctf/test-alias.o: New binary test input file.
	* tests/data/test-read-ctf/test-alias.o.abi: New exported abixml file.
	* tests/data/Makefile.am: Add the new test input above
	* tests/test-read-ctf.cc: Add the new test input above to the test
	harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
---
 tests/data/Makefile.am                    |   1 +
 tests/data/test-read-ctf/test-alias.o     | Bin 0 -> 1664 bytes
 tests/data/test-read-ctf/test-alias.o.abi |  16 ++++++++--------
 tests/test-read-ctf.cc                    |   8 ++++++++
 4 files changed, 17 insertions(+), 8 deletions(-)
 create mode 100644 tests/data/test-read-ctf/test-alias.o

index 1fe61b8f..b5fd92ad 100644
  

Comments

Dodji Seketeli Dec. 22, 2022, 10 a.m. UTC | #1
Hello Guillermo,

"Guillermo E. Martinez via Libabigail" <libabigail@sourceware.org> a
écrit:

> This patch adds a new test case in the ctf-front-end test suite to
> to test for alias symbols support.
>
> 	* tests/data/test-read-ctf/test-alias.o: New binary test input file.
> 	* tests/data/test-read-ctf/test-alias.o.abi: New exported abixml file.
> 	* tests/data/Makefile.am: Add the new test input above
> 	* tests/test-read-ctf.cc: Add the new test input above to the test
> 	harness.
>
> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
> Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com>

Applied to master, thanks!

[...]

Cheers,
  

Patch

diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am
index e994aff3..0f1f4e26 100644
--- a/tests/data/Makefile.am
+++ b/tests/data/Makefile.am
@@ -643,6 +643,7 @@  test-read-ctf/test9.c		\
 test-read-ctf/test9.o		\
 test-read-ctf/test9.o.abi	\
 test-read-ctf/test-alias.c	\
+test-read-ctf/test-alias.o	\
 test-read-ctf/test-alias.o.abi	\
 test-read-ctf/test-ambiguous-struct-A.c	\
 test-read-ctf/test-ambiguous-struct-A.o	\
diff --git a/tests/data/test-read-ctf/test-alias.o b/tests/data/test-read-ctf/test-alias.o
new file mode 100644
index 0000000000000000000000000000000000000000..18549b793a81754d6bc319eaa0f46179a4686b49
GIT binary patch
literal 1664
zcmbtUv2GJV5S??36TpcQgb-3da-fJK@SbfX1SycgfFpz`5GkW*@4SvrobRl=O|WU8
zLZZtjQ1S_sNc;dL9Tgt{H4@CMcfekZC>UvOX5Y-4_3hj9i+d067d#KxJh%nFSBwI*
z7N&BOwqO~`u)Fj6%kka^`1ZM2;EqjBFfO5&(a)lvN3WtkLD%TC4>^rKfxd!%(MG}v
z;~q>)MSN5cqB&@#NdS*HXy?oih!PD0872EiG6NY$GB?>#8g(al?=T6$@23Oh2jgJu
zr<n|6<>y)G$59}I=s-qsEm6;W;cJ!a-0w;)O<K#8?AAivo2<-q5dw7D?d?jn^JsUg
z(zqt-qF!m%o6Sa}ezQ_lqoK;8fl9QDw*c%rn0G@06u^5=7@KF;^xkB2Ze-r`$KZ`t
zz4h|q(lHh<AVyBMNRQhqtFH>}<<cE&p!Hvj<`&`Wk9p+<bK0{N(&Wq(ZuUZqG`KVe
zzl`{rQ4|w2ez&WbZ_L4gj=07rX@oNZO_Vd~95u~7F!M?CUl)%Mk&g#j1{ifViG9wr
z8fg%uCWs)<L7<ZONC%`2h$PiYpeD6k%kZgPA0&rjn5C$p9)rkKEQRXt_cA$9X8-?v
ztm6REgfBDCYuSX)n{mDuyxzcsu&K|}lseqtM3=vbb-FJuf5-AzKOW<*Nmq9!^)mlE
z6K!;R8;BEDclz$y#w!lae2&|e@3cY64Nk#@A7Gu%c;*h_dT1Nn-{pQ=0rpa>%YS3}
zH?THsE`JY;bf&H8Cd}X2f%d-+P9a8I<}*HTZyNQ<?*En+Xs6LhW0!x@;uvP^rQQGf
U4Em?mYgl*h4pBZ@e*6#qPtYBU=>Px#

literal 0
HcmV?d00001

diff --git a/tests/data/test-read-ctf/test-alias.o.abi b/tests/data/test-read-ctf/test-alias.o.abi
--- a/tests/data/test-read-ctf/test-alias.o.abi
+++ b/tests/data/test-read-ctf/test-alias.o.abi
@@ -1,19 +1,19 @@ 
 <abi-corpus version='2.1' 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-symbol name='main_func' type='func-type' binding='global-binding' visibility='default-visibility' alias='alias_func' 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-symbol name='main_var' size='4' type='object-type' binding='global-binding' visibility='default-visibility' alias='alias_var' 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'/>
+    <type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='type-id-1'/>
+    <function-decl name='main_func' visibility='default' binding='global' size-in-bits='64' alignment-in-bits='8' elf-symbol-id='main_func'>
+      <return type-id='type-id-2'/>
     </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'/>
+    <var-decl name='alias_var' type-id='type-id-1' mangled-name='alias_var' visibility='default' elf-symbol-id='alias_var'/>
+    <var-decl name='main_var' type-id='type-id-1' mangled-name='main_var' visibility='default' elf-symbol-id='main_var'/>
+    <type-decl name='void' id='type-id-2'/>
   </abi-instr>
 </abi-corpus>
diff --git a/tests/test-read-ctf.cc b/tests/test-read-ctf.cc
index 236ccbf2..f618e0fd 100644
--- a/tests/test-read-ctf.cc
+++ b/tests/test-read-ctf.cc
@@ -335,6 +335,14 @@  static InOutSpec in_out_specs[] =
     "output/test-read-ctf/test-linux-module.abi",
     "--ctf"
   },
+  {
+    "data/test-read-ctf/test-alias.o",
+    "",
+    "",
+    SEQUENCE_TYPE_ID_STYLE,
+    "data/test-read-ctf/test-alias.o.abi",
+    "output/test-read-ctf/test-alias.o.abi",
+  },
   // CTF fallback feature.
   {
     "data/test-read-ctf/test-fallback.o",