summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/debug
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/debug')
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/const2b.C1
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/lineno-simple1.C13
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/nested-2.C37
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/pr44641.C41
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/pubnames-1.C2
5 files changed, 93 insertions, 1 deletions
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/const2b.C b/gcc/testsuite/g++.dg/debug/dwarf2/const2b.C
index 593e080ac69..81360c2439f 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/const2b.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/const2b.C
@@ -1,5 +1,6 @@
/* { dg-do compile { target i386*-*-* } } */
/* { dg-options "-O -gdwarf-2 -dA -msse" } */
+/* { dg-require-effective-target sse } */
/* { dg-final { scan-assembler "DW_AT_const_value" } } */
typedef float FloatVect __attribute__((__vector_size__(16)));
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/lineno-simple1.C b/gcc/testsuite/g++.dg/debug/dwarf2/lineno-simple1.C
new file mode 100644
index 00000000000..e0ef7f71ca3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/lineno-simple1.C
@@ -0,0 +1,13 @@
+// { dg-do compile }
+// { dg-options "-g -O0 -dA" }
+
+struct C { // { dg-function-on-line {_ZN1CC[12]Ev} }
+ virtual void
+ foo() {} // { dg-function-on-line _ZN1C3fooEv }
+};
+static C dummy;
+
+int
+main (void)
+{ // { dg-function-on-line main }
+}
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 00000000000..2386baaacb9
--- /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\]*" } }
+
+ */
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/pr44641.C b/gcc/testsuite/g++.dg/debug/dwarf2/pr44641.C
new file mode 100644
index 00000000000..2df002f6b00
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/pr44641.C
@@ -0,0 +1,41 @@
+// Origin: PR 44641
+// { dg-do compile }
+// { dg-options "-g -O0 -dA" }
+
+template <class A> struct MisplacedDbg;
+template<class T> struct MisplacedDbg<T*>;
+struct Full;
+template<> struct MisplacedDbg<Full>;
+
+struct Arg;
+typedef MisplacedDbg<Arg> Typedef1;
+typedef MisplacedDbg<Arg*> Typedef2;
+typedef MisplacedDbg<Full> Typedef3;
+
+template<typename T> struct Base {
+ virtual ~Base() {
+ }
+};
+
+template <>
+struct MisplacedDbg<Full> // { dg-function-on-line {_ZN12MisplacedDbgI4FullEC[12]Ev} }
+ // { dg-function-on-line {_ZN12MisplacedDbgI4FullED0Ev} { target *-*-* } 21 }
+
+ : public Base<int> {
+};
+
+template <class T>
+struct MisplacedDbg<T*> // { dg-function-on-line {_ZN12MisplacedDbgIP3ArgEC[12]Ev} }
+ // { dg-function-on-line {_ZN12MisplacedDbgIP3ArgED0Ev} { target *-*-* } 28 }
+ : public Base<int> {
+};
+
+template <class A>
+struct MisplacedDbg // { dg-function-on-line {_ZN12MisplacedDbgI3ArgEC[12]Ev} }
+ // { dg-function-on-line {_ZN12MisplacedDbgI3ArgED0Ev} { target *-*-* } 34 }
+ : public Base<int> {
+};
+
+static MisplacedDbg<Arg> static_var1;
+static MisplacedDbg<Arg*> static_var2;
+static MisplacedDbg<Full> static_var3;
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/pubnames-1.C b/gcc/testsuite/g++.dg/debug/dwarf2/pubnames-1.C
index 543439da323..18d1df0d952 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/pubnames-1.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/pubnames-1.C
@@ -1,7 +1,7 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR debug/39706
+// { dg-do compile { target *-*-darwin* } }
// { dg-options "-g -dA -fno-merge-debug-strings" }
-// { dg-do compile }
//
// There should be one debug_pubnames section generated.
// On Darwin though, there is also a label pointing at the begining of the