From: Mark Wielaard Date: Mon, 7 May 2012 11:29:52 +0000 (+0200) Subject: tests/low_high_pc.c: Allow highpc == lowpc for CU DIEs for buggy GCC. X-Git-Tag: elfutils-0.154~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d9bc75fc20f0ce5064cac192a518af3c7192e96d;p=thirdparty%2Felfutils.git tests/low_high_pc.c: Allow highpc == lowpc for CU DIEs for buggy GCC. GCC < 4.7 had a bug where no code CUs got a highpc == lowpc. Allow that, because it is not the main purpose of this test. --- diff --git a/tests/ChangeLog b/tests/ChangeLog index abc73400b..4c6e9f7f8 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2012-05-07 Mark Wielaard + + * low_high_pc.c: Allow highpc == lowpc for CU DIEs for buggy GCC. + 2012-04-27 Mark Wielaard * Makefile.am (TESTS): Add run-low_high_pc.sh diff --git a/tests/low_high_pc.c b/tests/low_high_pc.c index 3054046b4..6fc8b1544 100644 --- a/tests/low_high_pc.c +++ b/tests/low_high_pc.c @@ -72,9 +72,12 @@ handle_die (Dwarf_Die *die, void *arg) if (dwarf_highpc (die, &highpc) != 0 && dwarf_hasattr (die, DW_AT_high_pc)) fail (off, name, "has DW_AT_high_pc but dwarf_highpc fails"); + /* GCC < 4.7 had a bug where no code CUs got a highpc == lowpc. + Allow that, because it is not the main purpose of this test. */ if (dwarf_hasattr (die, DW_AT_low_pc) && dwarf_hasattr (die, DW_AT_high_pc) - && highpc <= lowpc) + && highpc <= lowpc + && ! (dwarf_tag (die) == DW_TAG_compile_unit && highpc == lowpc)) { printf("lowpc: %lx, highpc: %lx\n", lowpc, highpc); fail (off, name, "highpc <= lowpc");