From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/g++.dg/debug/dwarf2/nested-2.C | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 gcc/testsuite/g++.dg/debug/dwarf2/nested-2.C (limited to 'gcc/testsuite/g++.dg/debug/dwarf2/nested-2.C') diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/nested-2.C b/gcc/testsuite/g++.dg/debug/dwarf2/nested-2.C new file mode 100644 index 000000000..3e6f6b591 --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/dwarf2/nested-2.C @@ -0,0 +1,37 @@ +/* + Origin: PR debug/45024 + { dg-options "-g -dA -fno-merge-debug-strings" } + { dg-do compile } +*/ + +struct S { + template struct T { }; +}; + +S::T tval; + +/* +We want to express that the DIE of S::T must be a child of the DIE of S, like in assembly this output: + + .uleb128 0x2 # (DIE (0x9e) DW_TAG_structure_type) + .ascii "S\0" # DW_AT_name + .byte 0x1 # DW_AT_byte_size + .byte 0x1 # DW_AT_decl_file (../../prtests/test-PR45024.cc) + .byte 0x1 # DW_AT_decl_line + .long 0xbc # DW_AT_sibling + .uleb128 0x3 # (DIE (0xa8) DW_TAG_structure_type) + .ascii "T\0" # DW_AT_name + .byte 0x1 # DW_AT_byte_size + .byte 0x1 # DW_AT_decl_file (../../prtests/test-PR45024.cc) + .byte 0x2 # DW_AT_decl_line + .uleb128 0x4 # (DIE (0xb3) DW_TAG_template_type_param) + .ascii "Z\0" # DW_AT_name + .long 0xbc # DW_AT_type + .byte 0 # end of children of DIE 0xa8 + .byte 0 # end of children of DIE 0x9e + +Hence the slightly odd regexp: + + { dg-final { scan-assembler "\[^\n\r\]*\\(DIE\[^\n\r\]*DW_TAG_structure_type\\)\[\n\r\]+\[^\n\r\]*\"S\\\\0\"\[ \t\]+\(\[@|#;!\]|//?\)\[ \t\]+DW_AT_name\[\n\r\]+\(.*\)?\\(DIE\[^\n\r\]*DW_TAG_structure_type\\)\[\n\r\]+\[^\n\r\]*\"T\\\\0\"\[ \t\]+\(.*\)?\\(DIE\[^\n\r\]*DW_TAG_template_type_param\\)\[\n\r\]+\[^\n\r\]*\[\n\r\]+\[^\n\r\]*\[\n\r\]+\[^\n\r\]*\(\[@|#;!\]|//?\)\[ \t\]+end of children of DIE\[^\n\r\]*\[\n\r\]+\[^\n\r\]*end of children of DIE\[^\n\r\]*" } } + + */ -- cgit v1.2.3