From c00fe58d8437748041793279abcadbcd3660fa5c Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 30 Jun 2022 16:21:58 +0200 Subject: [PATCH] testsuite: verify directly merged DW_AT_declarations Do not rely on number of DW_AT_declaration and check symbols instead. --- testsuite/dwz.tests/odr-struct-ns.sh | 11 +++++------ testsuite/dwz.tests/odr-struct.sh | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/testsuite/dwz.tests/odr-struct-ns.sh b/testsuite/dwz.tests/odr-struct-ns.sh index 4fd00af..7ace534 100644 --- a/testsuite/dwz.tests/odr-struct-ns.sh +++ b/testsuite/dwz.tests/odr-struct-ns.sh @@ -21,8 +21,6 @@ for name in member_one member_two member_three member_four; do esac done -decl_cnt=$(readelf -wi 1 | grep -c "DW_AT_declaration" || true) - $execs/dwz-for-test --odr 1 verify-dwarf.sh 1 @@ -38,8 +36,9 @@ for name in member_one member_two member_three member_four; do done # We expect two decls to be removed, for bbb and ccc. -expected_decl_cnt=$(($decl_cnt - 2)) -decl_cnt=$(readelf -wi 1 | grep -c "DW_AT_declaration" || true) -[ $expected_decl_cnt -eq $decl_cnt ] +readelf -wi 1 | grep -3 DW_AT_declaration > decls + +if grep bbb decls >/dev/null ; then exit 1; fi +if grep ccc decls >/dev/null ; then exit 2; fi -rm -f 1 +rm -f 1 decls diff --git a/testsuite/dwz.tests/odr-struct.sh b/testsuite/dwz.tests/odr-struct.sh index d0fddf9..7060c63 100644 --- a/testsuite/dwz.tests/odr-struct.sh +++ b/testsuite/dwz.tests/odr-struct.sh @@ -21,8 +21,6 @@ for name in member_one member_two member_three member_four; do esac done -decl_cnt=$(readelf -wi 1 | grep -c "DW_AT_declaration" || true) - $execs/dwz-for-test --odr 1 verify-dwarf.sh 1 @@ -38,8 +36,9 @@ for name in member_one member_two member_three member_four; do done # We expect two decls to be removed, for bbb and ccc. -expected_decl_cnt=$(($decl_cnt - 2)) -decl_cnt=$(readelf -wi 1 | grep -c "DW_AT_declaration" || true) -[ $expected_decl_cnt -eq $decl_cnt ] +readelf -wi 1 | grep -3 DW_AT_declaration > decls + +if grep bbb decls >/dev/null ; then exit 1; fi +if grep ccc decls >/dev/null ; then exit 2; fi -rm -f 1 +rm -f 1 decls -- 2.36.1