From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::222]) by sourceware.org (Postfix) with ESMTPS id 622133858C53 for ; Tue, 29 Nov 2022 13:59:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 622133858C53 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=seketeli.org Received: (Authenticated sender: dodji@seketeli.org) by mail.gandi.net (Postfix) with ESMTPSA id 4E07440010; Tue, 29 Nov 2022 13:59:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seketeli.org; s=gm1; t=1669730349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CmTwufn0JW0/8UNvbusqaC9deL6kvVpj8jVBKlAQvuw=; b=HC8vLG0E3Zz7VEyrq8K9IPcpz74NRkgjo9ykB+Wqwwb66QcWaYIvEk4fANDtmETgfvrJCv +QS2yi1i+EBbuH2ZGN8SJxMVqRzyEceT95FivzzakaZzV0C6eXZqQLaj013fNDDRv432Ff G5nB4IGu19D7fPMmaGNWKr2FD/xWf/Kd9RCd7opwESzVLN2KfEHcIJUgzqR8pWiIAbymYi UN8pULrQnVBxccEvTAwzUyBPfOflKIRul4BJL0Ly9My0s53oJQt8FAV/PRoYNfPw0Hz9K+ RDcO/8+4qGS8a5+OhXQT9IfbI2c1b2n7sp63zGwToRqwgZeMlCwkZd+pklA1MQ== Received: by localhost (Postfix, from userid 1000) id 7CE32581C59; Tue, 29 Nov 2022 14:59:07 +0100 (CET) From: Dodji Seketeli To: "Guillermo E. Martinez" Cc: "Guillermo E. Martinez via Libabigail" Subject: Re: [PATCH 2/5] ctf-front-end: Fix size and name for underlying types Organization: Me, myself and I References: <20221117034305.184864-1-guillermo.e.martinez@oracle.com> <20221117034305.184864-3-guillermo.e.martinez@oracle.com> <871qpmou3k.fsf@seketeli.org> X-Operating-System: Fedora 38 X-URL: http://www.seketeli.net/~dodji Date: Tue, 29 Nov 2022 14:59:07 +0100 In-Reply-To: <871qpmou3k.fsf@seketeli.org> (Dodji Seketeli's message of "Tue, 29 Nov 2022 12:53:03 +0100") Message-ID: <87v8mxoo9g.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_LOTSOFHASH,RCVD_IN_DNSWL_LOW,SCC_10_SHORT_WORD_LINES,SCC_5_SHORT_WORD_LINES,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello Guillermo, When applying the patch "ctf-front-end: Fix size and name for underlying types", the patch wouldn't apply cleanly, so I had to edit it. I screwed up and forgot to apply the tests part of the patch. Please find below the testing part that I forgot to apply. Could you please review it and sign it off? Thank you and sorry for my mistake. Cheers, >From 454c88e6b5381e4376a6062e18dbe888d0eb5e72 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Tue, 29 Nov 2022 13:42:43 +0100 Subject: [PATCH] test-read-ctf: Update tests for fixing size and name for underlying types When applying the previous commit the testing bit felt through the crack. Oops. Fixed thus. Here is the link to the initial post: https://inbox.sourceware.org/libabigail/871qpmou3k.fsf@seketeli.org/T/#m5f37b419e580a2a4ea9d91a9394382d886358809 * src/abg-ctf-reader.cc (process_ctf_{base_type,enum_type}): Look at ctf refence type to build the underlying type if present. * tests/data/Makefile.am: New test cases. * tests/data/test-read-ctf/PR27700/test-PR27700.abi: New test input. * tests/data/test-read-ctf/test-bitfield-enum.abi: Likewise. * tests/data/test-read-ctf/test-bitfield-enum.c: Likewise. * tests/data/test-read-ctf/test-bitfield-enum.o: Likewise. * tests/data/test-read-ctf/test-bitfield.abi: Likewise. * tests/data/test-read-ctf/test-bitfield.c: Likewise. * tests/data/test-read-ctf/test-bitfield.o: Likewise. * tests/data/test-read-ctf/test-enum-many.o.hash.abi: Adjust. * tests/data/test-read-ctf/test-enum-symbol.o.hash.abi: Likewise. * tests/data/test-read-ctf/test-enum.o.abi: Likewise: * tests/data/test-read-ctf/test0.abi: Likewise. * tests/data/test-read-ctf/test0.hash.abi: Likewise. * tests/data/test-read-ctf/test1.so.abi: Likewise. * tests/data/test-read-ctf/test1.so.hash.abi: Likewise. * tests/data/test-read-ctf/test5.o.abi: Likewise. * tests/test-read-ctf.cc: Update test suite. Signed-off-by: Dodji Seketeli --- tests/data/Makefile.am | 6 +++ .../test-read-ctf/PR27700/test-PR27700.abi | 4 +- .../data/test-read-ctf/test-bitfield-enum.abi | 18 +++++++ tests/data/test-read-ctf/test-bitfield-enum.c | 12 +++++ tests/data/test-read-ctf/test-bitfield-enum.o | Bin 0 -> 1336 bytes tests/data/test-read-ctf/test-bitfield.abi | 28 ++++++++++ tests/data/test-read-ctf/test-bitfield.c | 15 ++++++ tests/data/test-read-ctf/test-bitfield.o | Bin 0 -> 1488 bytes .../test-read-ctf/test-enum-many.o.hash.abi | 6 +-- .../test-read-ctf/test-enum-symbol.o.hash.abi | 4 +- tests/data/test-read-ctf/test-enum.o.abi | 10 ++-- tests/data/test-read-ctf/test0.abi | 48 +++++++++--------- tests/data/test-read-ctf/test0.hash.abi | 10 ++-- tests/data/test-read-ctf/test1.so.abi | 8 +-- tests/data/test-read-ctf/test1.so.hash.abi | 4 +- tests/data/test-read-ctf/test5.o.abi | 12 ++--- tests/test-read-ctf.cc | 18 +++++++ 17 files changed, 150 insertions(+), 53 deletions(-) create mode 100644 tests/data/test-read-ctf/test-bitfield-enum.abi create mode 100644 tests/data/test-read-ctf/test-bitfield-enum.c create mode 100644 tests/data/test-read-ctf/test-bitfield-enum.o create mode 100644 tests/data/test-read-ctf/test-bitfield.abi create mode 100644 tests/data/test-read-ctf/test-bitfield.c create mode 100644 tests/data/test-read-ctf/test-bitfield.o diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 4b6e9305..b89a4dd8 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -704,6 +704,12 @@ test-read-ctf/test-linux-module.ko \ test-read-ctf/test-fallback.abi \ test-read-ctf/test-fallback.c \ test-read-ctf/test-fallback.o \ +test-read-ctf/test-bitfield.abi \ +test-read-ctf/test-bitfield.c \ +test-read-ctf/test-bitfield.o \ +test-read-ctf/test-bitfield-enum.abi \ +test-read-ctf/test-bitfield-enum.c \ +test-read-ctf/test-bitfield-enum.o \ \ test-annotate/test0.abi \ test-annotate/test1.abi \ diff --git a/tests/data/test-read-ctf/PR27700/test-PR27700.abi b/tests/data/test-read-ctf/PR27700/test-PR27700.abi index 4f34eb8a..1a7c229e 100644 --- a/tests/data/test-read-ctf/PR27700/test-PR27700.abi +++ b/tests/data/test-read-ctf/PR27700/test-PR27700.abi @@ -3,14 +3,14 @@ - - + + diff --git a/tests/data/test-read-ctf/test-bitfield-enum.abi b/tests/data/test-read-ctf/test-bitfield-enum.abi new file mode 100644 index 00000000..b95f1781 --- /dev/null +++ b/tests/data/test-read-ctf/test-bitfield-enum.abi @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/tests/data/test-read-ctf/test-bitfield-enum.c b/tests/data/test-read-ctf/test-bitfield-enum.c new file mode 100644 index 00000000..502ec06a --- /dev/null +++ b/tests/data/test-read-ctf/test-bitfield-enum.c @@ -0,0 +1,12 @@ +/* gcc -gctf -c test-bitfield-enum.c -o test-bitfield-enum.o */ +enum event_kind +{ + NO_EVENT, +}; + +struct input +{ + enum event_kind kind : 16; +}; + +struct input e; diff --git a/tests/data/test-read-ctf/test-bitfield-enum.o b/tests/data/test-read-ctf/test-bitfield-enum.o new file mode 100644 index 0000000000000000000000000000000000000000..2c532f50c724f7bf4327b7c36699a432ca08eab1 GIT binary patch literal 1336 zcmbVL&2G~`5T1lkeh>7}s)CE@g;e0R6E4sLvQ&j4gu(@SLuGAm(^c(tWN#ojAvp0! z9C;I-0bT%R?A>IwlnWz$p1CWILVPqFR91M(XDu?Oo)5*zX`UV!NkuxRoKq?JV%@-P4f`I6}Dn*p8(p6N|JS#-h)LB%> zl&5mWWf3azG18*ZO_X!Z+c2yJ&%;cgby+I)nG{7H3biO%25@|IbQlber*98}(PI{~ zI2gy{@n{r34TfSl7qu+$io7^zuZ#~n=T(eR27Ty#cjm*{y1bjws{Z!WAHdJwerFd8 z+wJDN&iZT`EcEX$09dmsHBZs&y7T8Y(qgHB(Jp|cO#=+~fRC!AnSiNE3x+dXW>y>}E|H<#6h-TgL#EF;N)Zg2EY*3B9Ki3jBabjQp0DJUp|4YB#uQ|id zA7R};lc)(j(00A1m%<1+REvr1*oh%NbZQh@z4eDq&82>}1h;qz_a)Y@A?Uwz?W@uI y_o7|7Ml@eb{clG9!jNwmp4IO;b$|D5%N%NXhQ6NP=Gz!trr$IAca~_pzm`9z|8lDU literal 0 HcmV?d00001 diff --git a/tests/data/test-read-ctf/test-bitfield.abi b/tests/data/test-read-ctf/test-bitfield.abi new file mode 100644 index 00000000..4231ba3e --- /dev/null +++ b/tests/data/test-read-ctf/test-bitfield.abi @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/data/test-read-ctf/test-bitfield.c b/tests/data/test-read-ctf/test-bitfield.c new file mode 100644 index 00000000..7d76d2f4 --- /dev/null +++ b/tests/data/test-read-ctf/test-bitfield.c @@ -0,0 +1,15 @@ +/* gcc -gctf -c test-bitfield.c -o test-bitfield.o */ +struct foo +{ + unsigned bar : 2; + unsigned baz : 1; +}; + +struct foobar +{ + unsigned char bar : 2; + unsigned char baz : 1; +}; + +struct foo f; +struct foobar fb; diff --git a/tests/data/test-read-ctf/test-bitfield.o b/tests/data/test-read-ctf/test-bitfield.o new file mode 100644 index 0000000000000000000000000000000000000000..c23c8188d880587f2ba78b8b852cdb067607e4b6 GIT binary patch literal 1488 zcmbVM&2G~`5FVEh3S3$$Arvm|iB=FhNe{FYLXj${gb+85NZ8IMu}JL7-in3`cOC%o z6g&e@fw=Ju@B%QOcgITo!uG)6&AoRG-bD`2A&r_o-G&p09E`K4Wl85nozDt2 z3G+fznpCWBK)`LeY~B!-q-jd=yj-d{U8SqItdeY@;=0P>MV=;UK1=dNzfiAZt!iDz zlSC(t+pknI>1TRsqBPgjTrDP1Ms#{|avbiRK6}0&4iBP1Gzdq7(P%gv9EE%8;!IWf zQWZK`?3+=|PD2i`S1#kBgHPD4NMK{^Ex?a#H?BG57>6;et?}c5t yf_wP2;14bM5&_FqRzOmJ3m^+{fA_#Y*n0dAb4BJB4DaMm^&f5h3rV!rum1@|M0T$L literal 0 HcmV?d00001 diff --git a/tests/data/test-read-ctf/test-enum-many.o.hash.abi b/tests/data/test-read-ctf/test-enum-many.o.hash.abi index 116325f9..9119525b 100644 --- a/tests/data/test-read-ctf/test-enum-many.o.hash.abi +++ b/tests/data/test-read-ctf/test-enum-many.o.hash.abi @@ -4,14 +4,13 @@ - - + - + @@ -61,6 +60,7 @@ + diff --git a/tests/data/test-read-ctf/test-enum-symbol.o.hash.abi b/tests/data/test-read-ctf/test-enum-symbol.o.hash.abi index f4911bc4..da68828c 100644 --- a/tests/data/test-read-ctf/test-enum-symbol.o.hash.abi +++ b/tests/data/test-read-ctf/test-enum-symbol.o.hash.abi @@ -3,13 +3,13 @@ - - + + diff --git a/tests/data/test-read-ctf/test-enum.o.abi b/tests/data/test-read-ctf/test-enum.o.abi index bd3a55be..e13ebdd0 100644 --- a/tests/data/test-read-ctf/test-enum.o.abi +++ b/tests/data/test-read-ctf/test-enum.o.abi @@ -4,19 +4,19 @@ - - - + + - + - + + diff --git a/tests/data/test-read-ctf/test0.abi b/tests/data/test-read-ctf/test0.abi index 05430067..60d3cf1e 100644 --- a/tests/data/test-read-ctf/test0.abi +++ b/tests/data/test-read-ctf/test0.abi @@ -20,47 +20,47 @@ - - - - - - + + + + + - - - + + + - + - + - + - + - - - - - + + + + + + - - + + - + - + - + - + diff --git a/tests/data/test-read-ctf/test0.hash.abi b/tests/data/test-read-ctf/test0.hash.abi index 4aa9a93c..76dd581e 100644 --- a/tests/data/test-read-ctf/test0.hash.abi +++ b/tests/data/test-read-ctf/test0.hash.abi @@ -20,7 +20,6 @@ - @@ -34,14 +33,15 @@ - + - + - + + @@ -49,7 +49,7 @@ - + diff --git a/tests/data/test-read-ctf/test1.so.abi b/tests/data/test-read-ctf/test1.so.abi index 822b57a5..2ecd5826 100644 --- a/tests/data/test-read-ctf/test1.so.abi +++ b/tests/data/test-read-ctf/test1.so.abi @@ -6,9 +6,8 @@ - - - + + @@ -17,8 +16,9 @@ - + + diff --git a/tests/data/test-read-ctf/test1.so.hash.abi b/tests/data/test-read-ctf/test1.so.hash.abi index b3ace158..4f8633dd 100644 --- a/tests/data/test-read-ctf/test1.so.hash.abi +++ b/tests/data/test-read-ctf/test1.so.hash.abi @@ -6,9 +6,8 @@ - - + @@ -19,6 +18,7 @@ + diff --git a/tests/data/test-read-ctf/test5.o.abi b/tests/data/test-read-ctf/test5.o.abi index 6d72d7ab..814aff7f 100644 --- a/tests/data/test-read-ctf/test5.o.abi +++ b/tests/data/test-read-ctf/test5.o.abi @@ -7,10 +7,9 @@ - - - - + + + @@ -18,7 +17,8 @@ - + + @@ -37,7 +37,7 @@ - + diff --git a/tests/test-read-ctf.cc b/tests/test-read-ctf.cc index 043032ff..a0b399fc 100644 --- a/tests/test-read-ctf.cc +++ b/tests/test-read-ctf.cc @@ -345,6 +345,24 @@ static InOutSpec in_out_specs[] = "output/test-read-ctf/test-fallback.abi", NULL, }, + { + "data/test-read-ctf/test-bitfield.o", + "", + "", + SEQUENCE_TYPE_ID_STYLE, + "data/test-read-ctf/test-bitfield.abi", + "output/test-read-ctf/test-bitfield.abi", + "--ctf", + }, + { + "data/test-read-ctf/test-bitfield-enum.o", + "", + "", + SEQUENCE_TYPE_ID_STYLE, + "data/test-read-ctf/test-bitfield-enum.abi", + "output/test-read-ctf/test-bitfield-enum.abi", + "--ctf", + }, // This should be the last entry. {NULL, NULL, NULL, SEQUENCE_TYPE_ID_STYLE, NULL, NULL, NULL} }; -- 2.38.1 -- Dodji