diff options
author | dodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-01 18:54:30 +0000 |
---|---|---|
committer | dodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-01 18:54:30 +0000 |
commit | 9be1353919ef0b9c7319e44fb1e80aad908b3fea (patch) | |
tree | b6732222ccf4fafc095cadf5cc496e8153d3b0ab /gcc/testsuite/c-c++-common/dwarf2 | |
parent | 10aa67fa1ecf734c95a808ddce16721944867a06 (diff) | |
download | ppe42-gcc-9be1353919ef0b9c7319e44fb1e80aad908b3fea.tar.gz ppe42-gcc-9be1353919ef0b9c7319e44fb1e80aad908b3fea.zip |
Fix for PR debug/43325
gcc/ChangeLog:
PR debug/43325
* dwarf2out.c (gen_variable_die): Allow debug info for variable
re-declaration when it happens in a function.
gcc/testsuite/ChangeLog:
PR debug/43325
* c-c++-common/dwarf2/redeclaration-1.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157928 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/c-c++-common/dwarf2')
-rw-r--r-- | gcc/testsuite/c-c++-common/dwarf2/redeclaration-1.C | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/dwarf2/redeclaration-1.C b/gcc/testsuite/c-c++-common/dwarf2/redeclaration-1.C new file mode 100644 index 00000000000..8aaff8ef2ea --- /dev/null +++ b/gcc/testsuite/c-c++-common/dwarf2/redeclaration-1.C @@ -0,0 +1,18 @@ +// Origin: PR debug/43325 +// { dg-options "-g -dA" } +// { dg-do compile } + +// { dg-final { scan-assembler-times "\[^\n\r\]*\\(DIE \[^\n\r\]*DW_TAG_lexical_block\\)\[\n\r\]{1,2}\[^\n\r\]*DW_AT_low_pc\[\n\r\]{1,2}\[^\n\r\]*DW_AT_high_pc\[\n\r\]{1,2}\[^\n\r\]*\\(DIE \[^\n\r\]*DW_TAG_variable\\)\[\n\r\]{1,2}\[^\n\r\]*DW_AT_name" 2 } } + +namespace S +{ + int + f() + { + int i = 42; + { + extern int i; + return i; + } + } +} |