https://gcc.gnu.org/g:51d591d8f15b50c6966b3871b572775a236d433a

commit 51d591d8f15b50c6966b3871b572775a236d433a
Author: Thomas Schwinge <tschwi...@baylibre.com>
Date:   Wed Jul 17 18:02:50 2024 +0200

    Add 'g++.target/nvptx/alias-g++.dg_init_dtor2-1.C'
    
    ... as one minimized example for the issue that with nvptx '-malias' enabled
    (as implemented in commit f8b15e177155960017ac0c5daef8780d1127f91c
    "[nvptx] Use .alias directive for mptx >= 6.3"), there are hundreds of
    instances of link-time 'unresolved symbol [alias]' across the C++ test 
suite,
    which are regressions compared to a test run with (default) '-mno-alias'.
    
            PR target/104957
            gcc/testsuite/
            * g++.target/nvptx/alias-g++.dg_init_dtor2-1.C: Add.
    
    (cherry picked from commit a1865fd33897bc6c6e0109df0a12ee73ce386315)

Diff:
---
 gcc/testsuite/ChangeLog.omp                        |  6 ++++
 .../g++.target/nvptx/alias-g++.dg_init_dtor2-1.C   | 33 ++++++++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/gcc/testsuite/ChangeLog.omp b/gcc/testsuite/ChangeLog.omp
index 5b3fa9876d73..f7ece2d01e00 100644
--- a/gcc/testsuite/ChangeLog.omp
+++ b/gcc/testsuite/ChangeLog.omp
@@ -3,6 +3,12 @@
        Backported from trunk:
        2024-09-05  Thomas Schwinge  <tschwi...@baylibre.com>
 
+       PR target/104957
+       * g++.target/nvptx/alias-g++.dg_init_dtor2-1.C: Add.
+
+       Backported from trunk:
+       2024-09-05  Thomas Schwinge  <tschwi...@baylibre.com>
+
        PR target/104957
        * gcc.target/nvptx/alias-1.c: Enhance assembler scanning.
        * gcc.target/nvptx/alias-2.c: Likewise.
diff --git a/gcc/testsuite/g++.target/nvptx/alias-g++.dg_init_dtor2-1.C 
b/gcc/testsuite/g++.target/nvptx/alias-g++.dg_init_dtor2-1.C
new file mode 100644
index 000000000000..747656d51d66
--- /dev/null
+++ b/gcc/testsuite/g++.target/nvptx/alias-g++.dg_init_dtor2-1.C
@@ -0,0 +1,33 @@
+/* Reduced from 'g++.dg/init/dtor2.C'.  */
+
+/* { dg-do compile } */
+/* { dg-add-options nvptx_alias_ptx } */
+/* { dg-additional-options -save-temps } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ 
standard is sufficient.  */
+
+struct B
+{
+  ~B();
+};
+
+B::~B () {
+}
+
+int main()
+{
+  B b;
+  return 0;
+}
+
+/* { dg-final { scan-assembler-times {(?n)^// BEGIN GLOBAL FUNCTION DECL: 
_ZN1BD2Ev$} 1 } }
+   { dg-final { scan-assembler-times {(?n)^\.visible \.func _ZN1BD2Ev 
\(\.param\.u64 %in_ar0\);$} 1 } }
+   { dg-final { scan-assembler-times {(?n)^// BEGIN GLOBAL FUNCTION DEF: 
_ZN1BD2Ev$} 1 } }
+   { dg-final { scan-assembler-times {(?n)^\.visible \.func _ZN1BD2Ev 
\(\.param\.u64 %in_ar0\)$} 1 } } */
+
+/* { dg-final { scan-assembler-times {(?n)^// BEGIN GLOBAL FUNCTION DECL: 
_ZN1BD1Ev$} 1 } }
+   { dg-final { scan-assembler-times {(?n)^\.visible \.func _ZN1BD1Ev 
\(\.param\.u64 %in_ar0\);$} 1 } }
+   { dg-final { scan-assembler-times {(?n)^// BEGIN GLOBAL FUNCTION DEF: 
_ZN1BD1Ev$} 1 { xfail *-*-* } } }
+   { dg-final { scan-assembler-times {(?n)^\.alias _ZN1BD1Ev,_ZN1BD2Ev;$} 1 } 
} */
+
+/* { dg-final { scan-assembler-times {(?n)\tcall _ZN1BD1Ev, \(} 1 } }
+   { dg-final { scan-assembler-times {(?n)\tcall _ZN1BD2Ev, \(} 0 } } */

Reply via email to