diff options
author | Mark Wielaard <mjw@redhat.com> | 2012-05-07 13:29:52 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2012-05-07 13:29:52 +0200 |
commit | d9bc75fc20f0ce5064cac192a518af3c7192e96d (patch) | |
tree | c384502a3a64faaea35ef9c1479cb23cebd1b492 /tests | |
parent | 547972539ecbe8668e89d891d86cef10f0302fd5 (diff) | |
download | elfutils-d9bc75fc20f0ce5064cac192a518af3c7192e96d.tar.gz |
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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ChangeLog | 4 | ||||
-rw-r--r-- | tests/low_high_pc.c | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog index abc73400..4c6e9f7f 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2012-05-07 Mark Wielaard <mjw@redhat.com> + + * low_high_pc.c: Allow highpc == lowpc for CU DIEs for buggy GCC. + 2012-04-27 Mark Wielaard <mjw@redhat.com> * Makefile.am (TESTS): Add run-low_high_pc.sh diff --git a/tests/low_high_pc.c b/tests/low_high_pc.c index 3054046b..6fc8b154 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"); |