From d9bc75fc20f0ce5064cac192a518af3c7192e96d Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 7 May 2012 13:29:52 +0200 Subject: [PATCH] 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. --- tests/ChangeLog | 4 ++++ tests/low_high_pc.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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"); -- 2.47.2