From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39373 invoked by alias); 6 Jan 2020 16:10:27 -0000 Mailing-List: contact dwz-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: dwz-owner@sourceware.org Received: (qmail 39354 invoked by uid 89); 6 Jan 2020 16:10:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy= X-Spam-Status: No, score=-25.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: mx2.suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Date: Wed, 01 Jan 2020 00:00:00 -0000 From: Tom de Vries To: dwz@sourceware.org, jakub@redhat.com Subject: [committed 11/13][odr, testsuite] Add odr-def-decl.sh Message-ID: <20200106161017.GA20092@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2020-q1/txt/msg00011.txt Hi, Add a test-case to trigger reorder_dups. Committed to trunk. Thanks, - Tom [odr, testsuite] Add odr-def-decl.sh 2020-01-06 Tom de Vries * Makefile (def-decl): New target. (TEST_EXECS): Add def-decl. * testsuite/dwz.tests/decl.c: New test. * testsuite/dwz.tests/def.c: New test. * testsuite/dwz.tests/def.h: New test. * testsuite/dwz.tests/def2.c: New test. * testsuite/dwz.tests/odr-def-decl.sh: New test. --- Makefile | 6 +++++- testsuite/dwz.tests/decl.c | 3 +++ testsuite/dwz.tests/def.c | 11 +++++++++++ testsuite/dwz.tests/def.h | 10 ++++++++++ testsuite/dwz.tests/def2.c | 3 +++ testsuite/dwz.tests/odr-def-decl.sh | 19 +++++++++++++++++++ 6 files changed, 51 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d6bf2a8..340569a 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ TEST_EXECS_x86_64 = py-section-script dw2-skip-prologue \ TEST_EXECS = hello dwz-for-test min two-typedef start hello-gold-gdb-index \ start-gold hello-gnu-pubnames $(TEST_EXECS_DWARF_ASM) \ $(TEST_EXECS_$(UNAME)) odr-struct odr-class odr-union odr-struct-ns \ - odr-class-ns odr-union-ns odr-loc + odr-class-ns odr-union-ns odr-loc def-decl UNAME:=$(shell uname -p) @@ -127,6 +127,10 @@ odr-loc: -o $@ -g +def-decl: + $(CXX) $(TEST_SRC)/decl.c $(TEST_SRC)/def.c $(TEST_SRC)/def2.c -I$(TEST_SRC) \ + -o $@ -g + # On some systems we need to set and export DEJAGNU to suppress # WARNING: Couldn't find the global config file. DEJAGNU ?= /dev/null diff --git a/testsuite/dwz.tests/decl.c b/testsuite/dwz.tests/decl.c new file mode 100644 index 0000000..4953853 --- /dev/null +++ b/testsuite/dwz.tests/decl.c @@ -0,0 +1,3 @@ +class ao_ref; + +ao_ref *p3; diff --git a/testsuite/dwz.tests/def.c b/testsuite/dwz.tests/def.c new file mode 100644 index 0000000..8645b9c --- /dev/null +++ b/testsuite/dwz.tests/def.c @@ -0,0 +1,11 @@ +#include "def.h" + +ao_ref *p1; + +int +main (void) +{ + ao_ref *p1 = new ao_ref; + return 0; +} + diff --git a/testsuite/dwz.tests/def.h b/testsuite/dwz.tests/def.h new file mode 100644 index 0000000..dc3a602 --- /dev/null +++ b/testsuite/dwz.tests/def.h @@ -0,0 +1,10 @@ +class bla { + int a; + public: + bla() { a = 1; } +}; + +class ao_ref +{ + bla a; +}; diff --git a/testsuite/dwz.tests/def2.c b/testsuite/dwz.tests/def2.c new file mode 100644 index 0000000..c1eacf3 --- /dev/null +++ b/testsuite/dwz.tests/def2.c @@ -0,0 +1,3 @@ +#include "def.h" + +ao_ref *p2; diff --git a/testsuite/dwz.tests/odr-def-decl.sh b/testsuite/dwz.tests/odr-def-decl.sh new file mode 100644 index 0000000..943f05e --- /dev/null +++ b/testsuite/dwz.tests/odr-def-decl.sh @@ -0,0 +1,19 @@ +if ! $execs/dwz-for-test --odr -v 2>/dev/null; then + exit 77 +fi + +cp $execs/def-decl 1 + +verify-dwarf.sh 1 + +cnt=$(readelf -wi 1 | grep -c "DW_AT_name.*:.*ao_ref" || true) +[ $cnt -eq 4 ] + +$execs/dwz-for-test --odr 1 --devel-ignore-size + +verify-dwarf.sh 1 + +cnt=$(readelf -wi 1 | grep -c "DW_AT_name.*:.*ao_ref" || true) +[ $cnt -eq 3 ] + +rm -f 1