summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/debug/dwarf2/nested-2.C
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/g++.dg/debug/dwarf2/nested-2.C
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
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.
Diffstat (limited to 'gcc/testsuite/g++.dg/debug/dwarf2/nested-2.C')
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/nested-2.C37
1 files changed, 37 insertions, 0 deletions
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<typename Z> struct T { };
+};
+
+S::T<int> tval;
+
+/*
+We want to express that the DIE of S::T<int> 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<int>\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<int>\\\\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\]*" } }
+
+ */