aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2016-01-27 15:44:07 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2016-01-27 08:44:07 -0700
commit60214d0d65c94912906108d2a1e6d04423528afc (patch)
treeb79e1c27ec85ef299e88b28597203fa04eda2af9 /gcc/testsuite
parent960cbfd21556b61a48a7dca672e71650eb3f8f87 (diff)
downloadgcc-60214d0d65c94912906108d2a1e6d04423528afc.zip
gcc-60214d0d65c94912906108d2a1e6d04423528afc.tar.gz
gcc-60214d0d65c94912906108d2a1e6d04423528afc.tar.bz2
PR c++/69317 - [6 regression] wrong ABI version in -Wabi warnings
gcc/cp/ChangeLog: 2016-01-27 Martin Sebor <msebor@redhat.com> PR c++/69317 * mangle.c (mangle_decl): Reference the correct (saved) version of the ABI in -Wabi diagnostics. gcc/testsuite/ChangeLog: 2016-01-27 Martin Sebor <msebor@redhat.com> PR c++/69317 * g++.dg/abi/Wabi-2-2.C: New test. * g++.dg/abi/Wabi-2-3.C: New test. * g++.dg/abi/Wabi-3-2.C: New test. * g++.dg/abi/Wabi-3-3.C: New test. From-SVN: r232881
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog8
-rw-r--r--gcc/testsuite/g++.dg/abi/Wabi-2-2.C14
-rw-r--r--gcc/testsuite/g++.dg/abi/Wabi-2-3.C16
-rw-r--r--gcc/testsuite/g++.dg/abi/Wabi-3-2.C16
-rw-r--r--gcc/testsuite/g++.dg/abi/Wabi-3-3.C14
5 files changed, 68 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8c7f4dd..ad97714 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2016-01-27 Martin Sebor <msebor@redhat.com>
+
+ PR c++/69317
+ * g++.dg/abi/Wabi-2-2.C: New test.
+ * g++.dg/abi/Wabi-2-3.C: New test.
+ * g++.dg/abi/Wabi-3-2.C: New test.
+ * g++.dg/abi/Wabi-3-3.C: New test.
+
2016-01-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/69166
diff --git a/gcc/testsuite/g++.dg/abi/Wabi-2-2.C b/gcc/testsuite/g++.dg/abi/Wabi-2-2.C
new file mode 100644
index 0000000..d3a644b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/Wabi-2-2.C
@@ -0,0 +1,14 @@
+// Verify that no diagnostic is issued when the version specified
+// via -Wabi= matches the version specified by -fabi-version=.
+
+// { dg-options "-Werror -Wabi=2 -fabi-version=2" }
+// { dg-do compile }
+
+// The mangling of templates with a non-type template parameter
+// of reference type changed in ABI version 3:
+extern int N;
+template <int &> struct S { };
+
+// Expect no diagnostic.
+void foo (S<N>) { }
+
diff --git a/gcc/testsuite/g++.dg/abi/Wabi-2-3.C b/gcc/testsuite/g++.dg/abi/Wabi-2-3.C
new file mode 100644
index 0000000..5aadf5d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/Wabi-2-3.C
@@ -0,0 +1,16 @@
+// PR c++/69317 - [6 regression] wrong ABI version in -Wabi warnings
+// Exercise that the correct ABI versions are referenced in the -Wabi
+// diagnostic. See also the equivalent Wabi-3-2.C test.
+
+// { dg-options "-Wabi=2 -fabi-version=3" }
+// { dg-do compile }
+
+// The mangling of templates with a non-type template parameter
+// of reference type changed in ABI version 3:
+extern int N;
+template <int &> struct S { };
+
+// Expect the diagnostic to reference the ABI version specified via
+// -fabi-version=3 and the ABI version specified via -Wabi=2.
+void foo (S<N>) { } // { dg-warning "the mangled name of .void foo\\(S<N>\\). changed between -fabi-version=3 \\(_Z3foo1SILZ1NEE\\) and -fabi-version=2 \\(_Z3foo1SIL_Z1NEE\\)" }
+
diff --git a/gcc/testsuite/g++.dg/abi/Wabi-3-2.C b/gcc/testsuite/g++.dg/abi/Wabi-3-2.C
new file mode 100644
index 0000000..c65e3b6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/Wabi-3-2.C
@@ -0,0 +1,16 @@
+// PR c++/69317 - [6 regression] wrong ABI version in -Wabi warnings
+// Exercise that the correct ABI versions are referenced in the -Wabi
+// diagnostic. See also the equivalent Wabi-2-3.C test.
+
+// { dg-options "-Wabi=3 -fabi-version=2" }
+// { dg-do compile }
+
+// The mangling of templates with a non-type template parameter
+// of reference type changed in ABI version 3:
+extern int N;
+template <int &> struct S { };
+
+// Expect the diagnostic to reference the ABI version specified via
+// -fabi-version=2 and the ABI version specified via -Wabi=3.
+void foo (S<N>) { } // { dg-warning "the mangled name of .void foo\\(S<N>\\). changed between -fabi-version=2 \\(_Z3foo1SIL_Z1NEE\\) and -fabi-version=3 \\(_Z3foo1SILZ1NEE\\)" }
+
diff --git a/gcc/testsuite/g++.dg/abi/Wabi-3-3.C b/gcc/testsuite/g++.dg/abi/Wabi-3-3.C
new file mode 100644
index 0000000..4434971
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/Wabi-3-3.C
@@ -0,0 +1,14 @@
+// Verify that no diagnostic is issued when the version specified
+// via -Wabi= matches the version specified by -fabi-version=.
+
+// { dg-options "-Werror -Wabi=3 -fabi-version=3" }
+// { dg-do compile }
+
+// The mangling of templates with a non-type template parameter
+// of reference type changed in ABI version 3:
+extern int N;
+template <int &> struct S { };
+
+// Expect no diagnostic.
+void foo (S<N>) { }
+