aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/debug
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/debug')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/cdtor-1.C2
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-nested.C55
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C2
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/imported-decl-2.C32
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C23
5 files changed, 112 insertions, 2 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/cdtor-1.C b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/cdtor-1.C
index e3bddab0e..bfa5d9292 100644
--- a/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/cdtor-1.C
+++ b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/cdtor-1.C
@@ -14,4 +14,4 @@ main()
K k;
}
-// { dg-final {scan-assembler-times " DW_AT_\[MIPS_\]*linkage_name" 2 } }
+// { dg-final {scan-assembler-times " DW_AT_\[MIPS_\]*linkage_name" 4 } }
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-nested.C b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-nested.C
new file mode 100644
index 000000000..160694c3c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-nested.C
@@ -0,0 +1,55 @@
+// { dg-do compile }
+// { dg-options "--std=c++11 -dA -gdwarf-4 -fdebug-types-section -fno-merge-debug-strings" }
+
+// Check that -fdebug-types-sections does not copy a full referenced type
+// into a type unit.
+
+// Checks that at least one type unit is generated.
+//
+// { dg-final { scan-assembler "DIE \\(\[^\n\]*\\) DW_TAG_type_unit" } }
+//
+// Check that func is declared exactly once in the debug info (in the
+// compile unit).
+//
+// { dg-final { scan-assembler-times "\\.ascii \"func\\\\0\"\[^\n\]*DW_AT_name" 1 } }
+//
+// Check to make sure that no type unit contains a DIE with DW_AT_low_pc
+// or DW_AT_ranges. These patterns assume that the compile unit is always
+// emitted after all type units.
+//
+// { dg-final { scan-assembler-not "\\.quad\[^\n\]*DW_AT_low_pc.*DIE \\(\[^\n\]*\\) DW_TAG_compile_unit" } }
+// { dg-final { scan-assembler-not "\\.quad\[^\n\]*DW_AT_ranges.*DIE \\(\[^\n\]*\\) DW_TAG_compile_unit" } }
+
+struct A {
+ A();
+ virtual ~A();
+ virtual void foo();
+ private:
+ int data;
+};
+
+struct B {
+ B();
+ virtual ~B();
+};
+
+extern B* table[];
+
+struct D {
+ template <typename T>
+ T* get(int i)
+ {
+ B*& cell = table[i];
+ if (cell == 0)
+ cell = new T();
+ return static_cast<T*>(cell);
+ }
+};
+
+void func(D* d)
+{
+ struct C : B {
+ A a;
+ };
+ d->get<C>(0)->a.foo();
+}
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C
index c5520fa72..89a6bb44e 100644
--- a/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C
+++ b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-gdwarf-4" } */
+/* { dg-options "-gdwarf-4 -fdebug-types-section" } */
/* Regression test for an ICE in output_die when using -gdwarf-4. */
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/imported-decl-2.C b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/imported-decl-2.C
new file mode 100644
index 000000000..ce01f7238
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/imported-decl-2.C
@@ -0,0 +1,32 @@
+// { dg-do compile }
+// { dg-options "-gdwarf-2 -dA -O0 -fno-merge-debug-strings" }
+
+class AAAA
+{
+ public:
+ int method (void);
+ int a;
+};
+
+int
+AAAA::method (void)
+{
+ return a;
+}
+
+class BBBB : public AAAA
+{
+ public:
+ using AAAA::method;
+
+ int method (int b);
+};
+
+int
+BBBB::method (int b)
+{
+ return a + b;
+}
+
+// { dg-final { scan-assembler-not "ascii \"BBBB\\\\0\".*ascii \"AAAA\\\\0\".*DW_TAG_imported_declaration" } }
+// { dg-final { scan-assembler-times "ascii \"AAAA\\\\0\".*ascii \"BBBB\\\\0\".*DIE .0x\[0-9a-f\]*. DW_TAG_imported_declaration" 1 } }
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C
new file mode 100644
index 000000000..a63b8a9ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C
@@ -0,0 +1,23 @@
+// PR c++/61433
+// { dg-do compile { target c++11 } }
+// { dg-options "-O -fcompare-debug -fno-inline -fno-ipa-pure-const -fipa-sra" }
+
+template <class T>
+struct A
+{
+ template <class V>
+ struct B
+ {
+ int MEM;
+ };
+};
+struct D {};
+struct C: public A<int>::B<D>
+{};
+template <class T, class U, class V>
+auto k(T t, U u, V v) -> decltype (t.U::template B<V>::MEM)
+{}
+int main()
+{
+ k( C(), A<int>(), D() );
+}