]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: fix anon6 mangling [PR112846]
authorJason Merrill <jason@redhat.com>
Tue, 30 Jan 2024 17:07:21 +0000 (12:07 -0500)
committerJason Merrill <jason@redhat.com>
Tue, 30 Jan 2024 17:09:47 +0000 (12:09 -0500)
As with r14-6796-g2fa122cae50cd8, avoid mangling compatibility aliases in
mangling tests, and test the new mangling.

PR c++/112846

gcc/testsuite/ChangeLog:

* g++.dg/abi/anon6.C: Specify ABI v18.
* g++.dg/abi/anon6a.C: New test for ABI v19.

gcc/testsuite/g++.dg/abi/anon6.C
gcc/testsuite/g++.dg/abi/anon6a.C [new file with mode: 0644]

index 7be0b0bbdb7ea83b3cc9de8881977cb31df60d07..fd766109629ef0cc42a23a92b32c249fdf7af8e1 100644 (file)
@@ -1,5 +1,6 @@
 // PR c++/108566
 // { dg-do compile { target c++20 } }
+// { dg-additional-options "-fabi-version=18 -fabi-compat-version=18" }
 
 template<typename T>
 struct wrapper1 {
diff --git a/gcc/testsuite/g++.dg/abi/anon6a.C b/gcc/testsuite/g++.dg/abi/anon6a.C
new file mode 100644 (file)
index 0000000..69c9adb
--- /dev/null
@@ -0,0 +1,20 @@
+// PR c++/108566
+// { dg-do compile { target c++20 } }
+// { dg-additional-options "-fabi-compat-version=0" }
+
+template<typename T>
+struct wrapper1 {
+  union {
+    union {
+      T RightName;
+    };
+  };
+};
+
+template<auto tparam> void dummy(){}
+
+void uses() {
+  dummy<wrapper1<double>{123.0}>();
+}
+
+// { dg-final { scan-assembler "_Z5dummyITnDaXtl8wrapper1IdEtlNS1_Ut_Edi9RightNametlNS2_Ut_Edi9RightNameLd405ec00000000000EEEEEEvv" } }