From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3Q7WgXggKCiwOXZWKQLIOWWOTM.KWUTQJIJQOIQTaWcZKMeIZM.WZO@flex--gprocida.bounces.google.com> Received: from mail-wr1-x449.google.com (mail-wr1-x449.google.com [IPv6:2a00:1450:4864:20::449]) by sourceware.org (Postfix) with ESMTPS id 992E2385DC1F for ; Wed, 22 Apr 2020 21:21:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 992E2385DC1F Received: by mail-wr1-x449.google.com with SMTP id r11so1700639wrx.21 for ; Wed, 22 Apr 2020 14:21:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=YdquSekIZSMfSJNzKJ2h3aeG1Hp37ZFb/LlAL27I800=; b=eIQPblx0XCIoiJzkr9O0EPaqglG1zbg/lskNaC4nW45o4JagiordatT9zNnY0wiGO6 tPajIiSrlpYv6dN6+RAfa3RS5w5npB6geVl7EbaBGukoo4OiJivtoowzQs5MXceZnQea jVyyH5q60qhGwm7+3lxc02qVU1rIF7DvZQR9RPxd15lSYX7iRc5rWwIkRxPSUazU3uTl jhQvWzjs86kcpswRW2Hy5PJD5zoWZD/q1W9vO2Z7IuyO5xtL59Sj5cqPE3sYhSDlMWQT qU5hOpuYblu32AwlNr30JexCCfSmvUBgDWbRPKc+YumMx2JLL/gO8BoSY8HnlFFQe9YD WC0Q== X-Gm-Message-State: AGi0Pua/r//NC9AFuqxQmu1QYPGiMrJMQxxE3GfsX4/gBGP8EHGRI3kU WXwsKCIEybUAjt+K6loj+mcJ+kxlZGERRaLzkap1nM1+mh+kcvuTFk89amy5B0zaUAj91Ad0cv9 ljDvSS5GfdfeRAosiyk5QKM8y9vauqozRoZ5RSLTdSQoawRsO1StTuEWCgRMi0JCADydP92w= X-Google-Smtp-Source: APiQypLExLRRnZnw8siNtfHYU48I9nRFzYbdMvuhzEmkHBha2YZgQO3QfShhl8WfUivXpcI+nUYlFdkqPj3jUQ== X-Received: by 2002:a5d:6850:: with SMTP id o16mr1038904wrw.309.1587590467419; Wed, 22 Apr 2020 14:21:07 -0700 (PDT) Date: Wed, 22 Apr 2020 22:20:57 +0100 Message-Id: <20200422212059.258602-1-gprocida@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.26.1.301.g55bc3eb7cb9-goog Subject: [PATCH 1/3] Add tests for declaration-only struct diffs. From: Giuliano Procida To: libabigail@sourceware.org Cc: dodji@seketeli.org, kernel-team@android.com, gprocida@google.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-33.9 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libabigail mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Apr 2020 21:21:11 -0000 There were no tests exercising this reporting path. The new test is run with --harmless as these changes are considered harmless. * tests/data/Makefile.am: Add new test case files. * tests/data/test-abidiff-exit/test-decl-struct-report.txt: New test case generating "declaration-only" output. * tests/data/test-abidiff-exit/test-decl-struct-v0.c: Ditto. * tests/data/test-abidiff-exit/test-decl-struct-v0.o: Ditto. * tests/data/test-abidiff-exit/test-decl-struct-v1.c: Ditto. * tests/data/test-abidiff-exit/test-decl-struct-v1.o: Ditto. * tests/test-abidiff-exit.cc: Run new test case. Signed-off-by: Giuliano Procida --- tests/data/Makefile.am | 5 +++++ .../test-decl-struct-report.txt | 17 +++++++++++++++++ .../test-abidiff-exit/test-decl-struct-v0.c | 5 +++++ .../test-abidiff-exit/test-decl-struct-v0.o | Bin 0 -> 3016 bytes .../test-abidiff-exit/test-decl-struct-v1.c | 5 +++++ .../test-abidiff-exit/test-decl-struct-v1.o | Bin 0 -> 3016 bytes tests/test-abidiff-exit.cc | 9 +++++++++ 7 files changed, 41 insertions(+) create mode 100644 tests/data/test-abidiff-exit/test-decl-struct-report.txt create mode 100644 tests/data/test-abidiff-exit/test-decl-struct-v0.c create mode 100644 tests/data/test-abidiff-exit/test-decl-struct-v0.o create mode 100644 tests/data/test-abidiff-exit/test-decl-struct-v1.c create mode 100644 tests/data/test-abidiff-exit/test-decl-struct-v1.o diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 6e926ebd..a1b9bf64 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -146,6 +146,11 @@ test-abidiff-exit/test-member-size-v1.cc \ test-abidiff-exit/test-member-size-v1.o \ test-abidiff-exit/test-member-size-report0.txt \ test-abidiff-exit/test-member-size-report1.txt \ +test-abidiff-exit/test-decl-struct-v0.c \ +test-abidiff-exit/test-decl-struct-v0.o \ +test-abidiff-exit/test-decl-struct-v1.c \ +test-abidiff-exit/test-decl-struct-v1.o \ +test-abidiff-exit/test-decl-struct-report.txt \ \ test-diff-dwarf/test0-v0.cc \ test-diff-dwarf/test0-v0.o \ diff --git a/tests/data/test-abidiff-exit/test-decl-struct-report.txt b/tests/data/test-abidiff-exit/test-decl-struct-report.txt new file mode 100644 index 00000000..aa5dedae --- /dev/null +++ b/tests/data/test-abidiff-exit/test-decl-struct-report.txt @@ -0,0 +1,17 @@ +Functions changes summary: 0 Removed, 2 Changed, 0 Added functions +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable + +2 functions with some indirect sub-type change: + + [C] 'function void reg1(const embodied*)' at test-decl-struct-v1.c:4:1 has some indirect sub-type changes: + parameter 1 of type 'const embodied*' has sub-type changes: + in pointed to type 'const embodied': + in unqualified underlying type 'struct embodied' at test-decl-struct-v1.c:1:1: + type size changed from 0 to 32 (in bits) + type struct embodied was a declaration-only type and is now a defined type + [C] 'function void reg2(const disembodied*)' at test-decl-struct-v1.c:5:1 has some indirect sub-type changes: + parameter 1 of type 'const disembodied*' has sub-type changes: + in pointed to type 'const disembodied': + in unqualified underlying type 'struct disembodied': + type size changed from 32 to 0 (in bits) + type struct disembodied was a defined type and is now a declaration-only type diff --git a/tests/data/test-abidiff-exit/test-decl-struct-v0.c b/tests/data/test-abidiff-exit/test-decl-struct-v0.c new file mode 100644 index 00000000..2aca0211 --- /dev/null +++ b/tests/data/test-abidiff-exit/test-decl-struct-v0.c @@ -0,0 +1,5 @@ +struct embodied; +struct disembodied { int x; }; + +void reg1(const struct embodied * foo) { (void)foo; } +void reg2(const struct disembodied * foo) { (void)foo; } diff --git a/tests/data/test-abidiff-exit/test-decl-struct-v0.o b/tests/data/test-abidiff-exit/test-decl-struct-v0.o new file mode 100644 index 0000000000000000000000000000000000000000..030f443128d0e318695a7f8b4301c747741f34d7 GIT binary patch literal 3016 zcmbVO&2Jk;6o2EjV~1_FNlhUk99&WQA=t$mp%S-EF$B_9MHMP4LP#jA?TKv>udCg4 zNkNDT@u6N&k&qA)2L%5Cf&&*MgpfFM>x~N%S8hlg;Jw*-&SbK=^hut1@Auws=Iz^g zvwr`@mo`d50E>VNuxl|2P^<3hZKbxM4oBenr8|FKy7S&Yci;HMP=CgVvWlvy#SSUm z7#=e866s}8s%_xx?0_geaz(kzK2DW#Wf*5LLx`xTiBy*c6!Fz<9IIR7F?vssUixeR zHMLgGDHm|QpK{8N{iHdwI768{wc3xQiv{txS9cw6*;^1ts`C%y+I8W0u6x!!=eAr? z$8_hwspaP7`YI+>J^_~zuN(*0z2G`EfSEu%yX1Iz(8(oQs=fHd^GigpRt$P+5w|{! zJX&D34vu$z3DbBIf2u@)iy2~;(17788jfNK@vk=r0tF%b3CLuc`90a)_R}nxbTj{E zGw3REvCXjFQ6?4yaVukeGk|~cx&v|f%};1O*q>; zAABxCP=`bB%uW6P+N_g{Ga#Ivc7Z??o*9=p3`h0M_-$=dCz4R+(>_7{G=V4-Z}w-P z&>W|IE82d=!r#^Q>w4z(`T0Mw;`A#&|CX*=HkS27H-W9chJU;MTa zL+Wq&-vDT60-ZO4xL5F-r(_LBdrfjIYmoau1sBA=T!2yRH=5rh!w`F~E9fiA|1aGv z%%}Y6HnsEbA!e_M5d5yeYh)N=$8MspX#Yihptw%7Kiwzx{x=Y#H91dIl^oYi%J&81 zyg$!$4;Ash(|kH#rZA7^57EiG8F$aTBn*cg`=#dF;eTl0HG@kkKR?5tqf%7Armi2? zh3ZFNE9P@uDIa@pgkV)S)IcXp-wpZ-+I)H^cJCnsUsF;j$MR`9+Rsnx7V+QI`F}fQ I=8Db#AFEN&ivR!s literal 0 HcmV?d00001 diff --git a/tests/data/test-abidiff-exit/test-decl-struct-v1.c b/tests/data/test-abidiff-exit/test-decl-struct-v1.c new file mode 100644 index 00000000..c069fa5e --- /dev/null +++ b/tests/data/test-abidiff-exit/test-decl-struct-v1.c @@ -0,0 +1,5 @@ +struct embodied { int y; }; +struct disembodied; + +void reg1(const struct embodied * foo) { (void)foo; } +void reg2(const struct disembodied * foo) { (void)foo; } diff --git a/tests/data/test-abidiff-exit/test-decl-struct-v1.o b/tests/data/test-abidiff-exit/test-decl-struct-v1.o new file mode 100644 index 0000000000000000000000000000000000000000..ee0b463b7052f715fad177dd718d6464f8f0790e GIT binary patch literal 3016 zcmbVO-ESL35TEtgvBNb-Qd62JJh-Btf;(~%DskHsLm+KcRH0U_DkK!n_Qtk|&(+-uhCBSKg3#fSJ7=d%JO7I+Ay0e>1<`xw)M^ zfAsnr>jfczMZkF&&lm-$l*e{MnGLAILAZYL&clm$KK$qI+rJv-FBnl&Q5Ch=0c9J* z(}rCjyC_6u9ksIqLL9!V+(jQ%saWd88B7r(N=lLG(tskq-^H=KIT)b#_?KuG?scJp z8j8C(Ojka`F=rPiu<|<=CRCG zaJ+L1nD>*o0IdYiQ&#vxry6-MOUM}MEBJF1ONf8H87!xIz4#skWHQbCwrp+rX_gFI znSVPBT8dmc3Dfy5I6YLF|D^QXDvkvQ`HAd=(C($O-yF1ivJDrmT(7N#FV*V7auC** zm%@4&F4b#(KO4q!wIgGh^jbKLl2&(hd*!r$`o)^xsrj2xx)Zm$$sisKQ-2u0*NfYJ z7B#nIx=(7j^)kGW^>4vwbGWd!cBXdnHQDS%ah`%7)=yc%e_X z^(LI>toJ_`A*jQlcjnf90_SX#i!&gco_3Bv6xNK(9EL+$Grp_m*pf;p^HHCmeJY26 z;?4dH44n3*TZrUZu2ekXAL#j8TJ!q+{2yEKB|X1q;d%<+YJ=BdoNGdP@*3ou)d6<= z*?sVu#;FEo9U2zS`9qNI^s&WJXGyNRY-MsggPhzQP7snVP~TkZw}C> z?5NpHB9Usyb>?*%+OThHiZ$g3P6)F*{)QQ3*f#$J`sn;UE#IERhk%L$8Ml+(*E=MKyjUDf4Vp9{cj;gYjU1w zDmki~^eYCm=KWdIJv52`v*y$JGKG1pKSd|oX563VC1E)1*zYvo4u7D5n+BImetw3( zMq^U_mUR8NE>u7IS}~vNO8MA(BLpkDp}IO@`fkuy(B{)Sv3n08_<@o_Ig+c