[gcc r16-9444] testsuite, c++: Account for missing stong symbol aliases.

Iain D Sandoe via Gcc-cvs <[email protected]> Wed, 29 Jul 2026 21:45:10 +0000 (GMT)
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:c63f1eba20a5f598c0230b04b46bf4857e157bfd

commit r16-9444-gc63f1eba20a5f598c0230b04b46bf4857e157bfd
Author: Iain Sandoe <[email protected]>
Date:   Thu Jun 11 20:40:51 2026 +0100

    testsuite, c++: Account for missing stong symbol aliases.
    
    Darwin does not have strong symbol aliases and therefore must emit complete
    constructors (which might, or might not call others).  Several tests assume
    that a base constructor is emitted (which is fine for targets with strong
    symbol aliases that emit the complete constructor symbol as an alias to the
    base etc.).
    
    Handle the two cases with separate matches.
    
    gcc/testsuite/ChangeLog:
    
            * g++.dg/modules/clone-4_b.C: Account for missing strong symbol
            aliases.
            * g++.dg/template/explicit-instantiation8.C: Likewise.
    
    Signed-off-by: Iain Sandoe <[email protected]>
    (cherry picked from commit bef4f0f92a9ffe624ab3f7fbf565a8587926c4d4)

Diff:
---
 gcc/testsuite/g++.dg/modules/clone-4_b.C                | 5 +++--
 gcc/testsuite/g++.dg/template/explicit-instantiation8.C | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/g++.dg/modules/clone-4_b.C b/gcc/testsuite/g++.dg/modules/clone-4_b.C
index 1b36cb477c60..2b811b7537f4 100644
--- a/gcc/testsuite/g++.dg/modules/clone-4_b.C
+++ b/gcc/testsuite/g++.dg/modules/clone-4_b.C
@@ -8,5 +8,6 @@ int main() {
   __shared_ptr<double> s2;
 }
 
-// { dg-final { scan-assembler-not {_ZNW1M12__shared_ptrIiEC[1-4]Ev:} } }
-// { dg-final { scan-assembler {_ZNW1M12__shared_ptrIdEC2Ev:} } }
+// { dg-final { scan-assembler-not {_?_ZNW1M12__shared_ptrIiEC[1-4]Ev:} } }
+// { dg-final { scan-assembler {_?_ZNW1M12__shared_ptrIdEC2Ev:} { target alias } } }
+// { dg-final { scan-assembler {_?_ZNW1M12__shared_ptrIdEC1Ev:} { target { ! alias } } } }
diff --git a/gcc/testsuite/g++.dg/template/explicit-instantiation8.C b/gcc/testsuite/g++.dg/template/explicit-instantiation8.C
index 92152a2992e9..21c6c7940f0c 100644
--- a/gcc/testsuite/g++.dg/template/explicit-instantiation8.C
+++ b/gcc/testsuite/g++.dg/template/explicit-instantiation8.C
@@ -21,4 +21,5 @@ extern template struct use_shallow<char>;
 template struct shallow<char>;
 template struct use_shallow<char>;
 
-// { dg-final { scan-assembler "_ZN7shallowIcEC2Ev" } }
+// { dg-final { scan-assembler "_?_ZN7shallowIcEC2Ev" { target alias } } }
+// { dg-final { scan-assembler "_?_ZN7shallowIcEC1Ev" { target { ! alias } } } }