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/constexpr-var-1.C2
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C27
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/ptrdmem-1.C9
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/ref-2.C4
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/ref-3.C56
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/ref-4.C11
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/refqual-1.C17
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/refqual-2.C17
8 files changed, 140 insertions, 3 deletions
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/constexpr-var-1.C b/gcc/testsuite/g++.dg/debug/dwarf2/constexpr-var-1.C
index 045d5fed744..19062e29fd5 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/constexpr-var-1.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/constexpr-var-1.C
@@ -1,6 +1,6 @@
// { dg-do compile }
// { dg-options "-O -std=c++11 -g -dA -gno-strict-dwarf" }
-// { dg-final { scan-assembler-times " DW_AT_const_expr" 2 } }
+// { dg-final { scan-assembler-times " DW_AT_const_expr" 2 { xfail *-*-aix* } } }
constexpr int a = 5;
struct S
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C b/gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C
new file mode 100644
index 00000000000..f4f4b6d77d1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C
@@ -0,0 +1,27 @@
+// { dg-do compile }
+// { dg-options "-O -std=c++1z -g -dA -gno-strict-dwarf" }
+// { dg-require-weak "" }
+// { dg-final { scan-assembler-times "0x3\[^\n\r]* DW_AT_inline" 6 { xfail *-*-aix* } } }
+// { dg-final { scan-assembler-times "0x1\[^\n\r]* DW_AT_inline" 2 { xfail *-*-aix* } } }
+// { dg-final { scan-assembler-times " DW_AT_declaration" 6 { xfail *-*-aix* } } }
+// { dg-final { scan-assembler-times " DW_AT_specification" 6 { xfail *-*-aix* } } }
+// { dg-final { scan-assembler-times " DW_AT_\[^\n\r]*linkage_name" 7 { xfail *-*-aix* } } }
+
+inline int a;
+struct S
+{
+ static inline double b = 4.0;
+ static constexpr int c = 2;
+ static constexpr inline char d = 3;
+} s;
+template <int N>
+inline int e = N;
+int &f = e<2>;
+template <int N>
+struct T
+{
+ static inline double g = 4.0;
+ static constexpr int h = 2;
+ static inline constexpr char i = 3;
+};
+T<5> t;
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/ptrdmem-1.C b/gcc/testsuite/g++.dg/debug/dwarf2/ptrdmem-1.C
new file mode 100644
index 00000000000..5d65196f7af
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/ptrdmem-1.C
@@ -0,0 +1,9 @@
+// { dg-do compile }
+// { dg-options "-O -std=c++11 -g -dA -gno-strict-dwarf" }
+// { dg-final { scan-assembler-times "DIE \\(\[^\n\]*\\) DW_TAG_ptr_to_member_type" 1 { xfail { powerpc-ibm-aix* } } } }
+// { dg-final { scan-assembler-times " DW_AT_use_location" 1 { xfail { powerpc-ibm-aix* } } } }
+// { dg-final { scan-assembler-not " DW_AT_reference" { xfail { powerpc-ibm-aix* } } } }
+
+struct S;
+typedef int S::*pdm;
+pdm pmf = 0;
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/ref-2.C b/gcc/testsuite/g++.dg/debug/dwarf2/ref-2.C
index dd1f457d3ec..43939c9d697 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/ref-2.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/ref-2.C
@@ -1,7 +1,7 @@
// { dg-do compile { target c++11 } }
// { dg-options "-g -gno-strict-dwarf -dA" }
-// { dg-final { scan-assembler-times " DW_AT_reference" 1 } }
-// { dg-final { scan-assembler-times " DW_AT_rvalue_reference" 1 } }
+// { dg-final { scan-assembler-times " DW_AT_reference" 1 { xfail *-*-aix* } } }
+// { dg-final { scan-assembler-times " DW_AT_rvalue_reference" 1 { xfail *-*-aix* } } }
struct S
{
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/ref-3.C b/gcc/testsuite/g++.dg/debug/dwarf2/ref-3.C
new file mode 100644
index 00000000000..d7932d8a237
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/ref-3.C
@@ -0,0 +1,56 @@
+// { dg-do compile { target c++11 } }
+// { dg-options "-g -gno-strict-dwarf -dA" }
+// { dg-final { scan-assembler-times " DW_AT_reference" 5 { xfail *-*-aix* } } }
+// { dg-final { scan-assembler-times " DW_AT_rvalue_reference" 5 { xfail *-*-aix* } } }
+// { dg-final { scan-assembler-times "DIE \\(\[^\n\]*\\) DW_TAG_subroutine_type" 6 { xfail *-*-aix* } } }
+// { dg-final { scan-assembler-times "DIE \\(\[^\n\]*\\) DW_TAG_ptr_to_member_type" 7 { xfail *-*-aix* } } }
+// { dg-final { scan-assembler-times " DW_AT_use_location" 1 { xfail *-*-aix* } } }
+
+struct S
+{
+ void foo1 ();
+ void bar1 () &;
+ void baz1 () &&;
+ void foo2 () const;
+ void bar2 () const &;
+ void baz2 () const &&;
+ void foo3 () const;
+ void bar3 () const &;
+ void baz3 () const &&;
+ int d;
+};
+
+void
+test ()
+{
+ S s;
+ auto o1 = &S::foo1;
+ auto r1 = &S::bar1;
+ auto z1 = &S::baz1;
+ auto o2 = &S::foo2;
+ auto r2 = &S::bar2;
+ auto z2 = &S::baz2;
+ auto o3 = &S::foo3;
+ auto r3 = &S::bar3;
+ auto z3 = &S::baz3;
+ auto d1 = &S::d;
+ void (S::*o4) () const;
+ o4 = &S::foo3;
+ void (S::*r4) () const &;
+ r4 = &S::bar3;
+ void (S::*z4) () const &&;
+ z4 = &S::baz3;
+ (s.*o1) ();
+ (s.*r1) ();
+ (S ().*z1) ();
+ (s.*o2) ();
+ (s.*r2) ();
+ (S ().*z2) ();
+ (s.*o3) ();
+ (s.*r3) ();
+ (S ().*z3) ();
+ (s.*o4) ();
+ (s.*r4) ();
+ (S ().*z4) ();
+ s.*d1 = 2;
+}
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/ref-4.C b/gcc/testsuite/g++.dg/debug/dwarf2/ref-4.C
new file mode 100644
index 00000000000..00cf81f4bcc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/ref-4.C
@@ -0,0 +1,11 @@
+// { dg-do compile { target c++11 } }
+// { dg-options "-g -gno-strict-dwarf -dA" }
+// { dg-final { scan-assembler-times "DIE \\(\[^\n\]*\\) DW_TAG_typedef" 2 { xfail *-*-aix* } } }
+// { dg-final { scan-assembler-times "DIE \\(\[^\n\]*\\) DW_TAG_ptr_to_member_type" 2 { xfail *-*-aix* } } }
+// { dg-final { scan-assembler-times "DIE \\(\[^\n\]*\\) DW_TAG_subroutine_type" 1 { xfail *-*-aix* } } }
+
+struct A { void foo (); int a; };
+typedef void (A::*PMF) ();
+typedef int A::*PMI;
+PMF pmf;
+PMI pmi;
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/refqual-1.C b/gcc/testsuite/g++.dg/debug/dwarf2/refqual-1.C
new file mode 100644
index 00000000000..221008e9981
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/refqual-1.C
@@ -0,0 +1,17 @@
+// { dg-do compile }
+// { dg-options "-O -std=c++11 -g -dA -gno-strict-dwarf" }
+// { dg-final { scan-assembler-times "DIE \\(\[^\n\]*\\) DW_TAG_ptr_to_member_type" 1 { xfail { powerpc-ibm-aix* } } } }
+// { dg-final { scan-assembler-times " DW_AT_reference" 2 { xfail { powerpc-ibm-aix* } } } }
+// { dg-final { scan-assembler-not " DW_AT_use_location" { xfail { powerpc-ibm-aix* } } } }
+/* It is not clear what if anything we should output for
+ DW_AT_use_location in a pointer to member function, so we don't
+ output it for now. */
+
+struct S {
+ void mf(void) &;
+};
+
+void S::mf() & {}
+
+typedef void (S::*pmft)(void) &;
+pmft pmf = &S::mf;
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/refqual-2.C b/gcc/testsuite/g++.dg/debug/dwarf2/refqual-2.C
new file mode 100644
index 00000000000..ddf33c1971e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/refqual-2.C
@@ -0,0 +1,17 @@
+// { dg-do compile }
+// { dg-options "-O -std=c++11 -g -dA -gno-strict-dwarf" }
+// { dg-final { scan-assembler-times "DIE \\(\[^\n\]*\\) DW_TAG_ptr_to_member_type" 1 { xfail { powerpc-ibm-aix* } } } }
+// { dg-final { scan-assembler-times " DW_AT_rvalue_reference" 2 { xfail { powerpc-ibm-aix* } } } }
+// { dg-final { scan-assembler-not " DW_AT_use_location" { xfail { powerpc-ibm-aix* } } } }
+/* It is not clear what if anything we should output for
+ DW_AT_use_location in a pointer to member function, so we don't
+ output it for now. */
+
+struct S {
+ void mf(void) &&;
+};
+
+void S::mf() && {}
+
+typedef void (S::*pmft)(void) &&;
+pmft pmf = &S::mf;