Several uses of the gas effective target in the testsuite are actually
about if Solaris as is in use. This patch uses the new framework to
generate effective targets from auto-host.h to introduce a solaris_as
effective target and adjusts affected tests accordingly.
The existing gas effective target remains, however, because other uses
are about using gas features in particular.
Bootstrapped without regressions on i386-pc-solaris2.11,
sparc-sun-solaris2.11, x86_64-pc-linux-gnu, and
sparc64-unknown-linux-gnu.
To be committed to trunk once the et-static framework has seen some soak
time.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2026-05-10 Rainer Orth <[email protected]>
gcc/testsuite:
* lib/et-static.def (solaris_as): New effective target.
* g++.dg/abi/lambda-static-1.C: Check solaris_as instead of !gas.
* g++.dg/debug/dwarf2/nested-4.C: Likewise.
* g++.dg/eh/pr119507.C: Likewise.
* gcc.c-torture/compile/pr61159.c: Likewise.
* gcc.dg/attr-weakref-1.c: Likewise.
* gcc.dg/tree-ssa/cswtch-6.c: Likewise.
* gcc.dg/tree-ssa/cswtch-7.c: Likewise.
* gcc.target/i386/avx512cd-vpbroadcastmb2q-2.c: Likewise.
* gcc.target/i386/avx512cd-vpbroadcastmw2d-2.c: Likewise.
* gcc.target/i386/pr91298-1.c: Likewise.
* gcc.target/i386/pr91298-2.c: Likewise.
* lib/target-supports.exp (check_effective_target_avx512dq):
Likewise.
(check_effective_target_avx512bw): Likewise.
gcc:
* doc/sourcebuild.texi (Effective-Target Keywords, Other
attributes): Document solaris_as.
# HG changeset patch
# Parent bf0ff2482ab311e29402b1995770e6167ba51b7d
testsuite: Use solaris_as effective target
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -3177,6 +3177,9 @@ Target supports section anchors.
@item short_enums
Target defaults to short enums.
+@item solaris_as
+Target uses the Solaris @command{as}.
+
@item stack_size
@anchor{stack_size_et}
Target has limited stack size. The stack size limit can be obtained using the
diff --git a/gcc/testsuite/g++.dg/abi/lambda-static-1.C b/gcc/testsuite/g++.dg/abi/lambda-static-1.C
--- a/gcc/testsuite/g++.dg/abi/lambda-static-1.C
+++ b/gcc/testsuite/g++.dg/abi/lambda-static-1.C
@@ -23,5 +23,5 @@ void indirect ()
// { dg-final { scan-assembler ".section\[\t ]*.text._ZZ5lambyvENKUlvE_clEv,\[^\n\r]*,_ZZ5lambyvENKUlvE_clEv,comdat" { target { { ! *-*-solaris2.* } || { gas } } } } }
// { dg-final { scan-assembler ".section\[\t ]*.text._ZZ5lambyvENUlvE_4_FUNEv,\[^\n\r]*,_ZZ5lambyvENUlvE_4_FUNEv,comdat" { target { { ! *-*-solaris2.* } || { gas } } } } }
-// { dg-final { scan-assembler ".group\[\t \]*_ZZ5lambyvENKUlvE_clEv,\[^\n\r\]*,#comdat" { target { *-*-solaris2.* && { ! gas } } } } }
-// { dg-final { scan-assembler ".group\[\t \]*_ZZ5lambyvENUlvE_4_FUNEv,\[^\n\r\]*,#comdat" { target { *-*-solaris2.* && { ! gas } } } } }
+// { dg-final { scan-assembler ".group\[\t \]*_ZZ5lambyvENKUlvE_clEv,\[^\n\r\]*,#comdat" { target solaris_as } } }
+// { dg-final { scan-assembler ".group\[\t \]*_ZZ5lambyvENUlvE_4_FUNEv,\[^\n\r\]*,#comdat" { target solaris_as } } }
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/nested-4.C b/gcc/testsuite/g++.dg/debug/dwarf2/nested-4.C
--- a/gcc/testsuite/g++.dg/debug/dwarf2/nested-4.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/nested-4.C
@@ -1,6 +1,6 @@
// PR debug/53235
// { dg-options "-gdwarf-4 -fdebug-types-section" }
-// { dg-final { scan-assembler-times "debug_types" 2 { xfail { powerpc-ibm-aix* || { *-*-darwin* || { *-*-solaris2.* && { comdat_group && { ! gas } } } } } } } }
+// { dg-final { scan-assembler-times "debug_types" 2 { xfail { powerpc-ibm-aix* || { *-*-darwin* || solaris_as } } } } }
namespace E {
class O {};
diff --git a/gcc/testsuite/g++.dg/eh/pr119507.C b/gcc/testsuite/g++.dg/eh/pr119507.C
--- a/gcc/testsuite/g++.dg/eh/pr119507.C
+++ b/gcc/testsuite/g++.dg/eh/pr119507.C
@@ -2,7 +2,7 @@
// ARM EABI has its own exception handling data handling and does not use gcc_except_table
// { dg-skip-if "!TARGET_EXCEPTION_DATA" { arm_eabi } }
// Solaris/SPARC as uses a widely different COMDAT section syntax.
-// { dg-skip-if "Solaris/SPARC as syntax" { sparc*-*-solaris2* && { ! gas } } }
+// { dg-skip-if "Solaris/SPARC as syntax" { sparc*-*-* && solaris_as } }
// Force off function sections
// Force on exceptions
// { dg-options "-fno-function-sections -fexceptions" }
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr61159.c b/gcc/testsuite/gcc.c-torture/compile/pr61159.c
--- a/gcc/testsuite/gcc.c-torture/compile/pr61159.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr61159.c
@@ -1,6 +1,6 @@
/* { dg-require-alias "" } */
/* { dg-require-weak "" } */
-/* { dg-xfail-if "weak alias" { powerpc-ibm-aix* || { *86*-*-solaris* && { ! gas } } } } */
+/* { dg-xfail-if "weak alias" { powerpc-ibm-aix* || { x86 && solaris_as } } } */
static int dummy = 0;
extern int foo __attribute__((__weak__, __alias__("dummy")));
diff --git a/gcc/testsuite/gcc.dg/attr-weakref-1.c b/gcc/testsuite/gcc.dg/attr-weakref-1.c
--- a/gcc/testsuite/gcc.dg/attr-weakref-1.c
+++ b/gcc/testsuite/gcc.dg/attr-weakref-1.c
@@ -16,7 +16,7 @@
// { dg-additional-options "-Wl,-undefined,dynamic_lookup" { target *-*-darwin* } }
// { dg-additional-options "-Wl,-flat_namespace" { target *-*-darwin[89]* } }
// One subtest doesn't assemble with the Solaris/x86 as (PR ipa/70582)
-// { dg-additional-options "-DSOLARIS_X86_AS" { target { *86*-*-solaris2* && { ! gas } } } }
+// { dg-additional-options "-DSOLARIS_X86_AS" { target { x86 && solaris_as } } }
// { dg-additional-sources "attr-weakref-1a.c" }
// Copyright 2005 Free Software Foundation, Inc.
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/cswtch-6.c b/gcc/testsuite/gcc.dg/tree-ssa/cswtch-6.c
--- a/gcc/testsuite/gcc.dg/tree-ssa/cswtch-6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/cswtch-6.c
@@ -40,4 +40,4 @@ f1 (int v, int w)
foo (i, j);
}
-/* { dg-final { scan-assembler ".rodata.cst16" { xfail { sparc*-*-solaris2* && { ! gas } } } } } */
+/* { dg-final { scan-assembler ".rodata.cst16" { xfail { sparc*-*-* && solaris_as } } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/cswtch-7.c b/gcc/testsuite/gcc.dg/tree-ssa/cswtch-7.c
--- a/gcc/testsuite/gcc.dg/tree-ssa/cswtch-7.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/cswtch-7.c
@@ -45,4 +45,4 @@ f1 (int v, int w)
foo (i, j);
}
-/* { dg-final { scan-assembler ".rodata.cst32" { xfail { sparc*-*-solaris2* && { ! gas } } } } } */
+/* { dg-final { scan-assembler ".rodata.cst32" { xfail { sparc*-*-* && solaris_as } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx512cd-vpbroadcastmb2q-2.c b/gcc/testsuite/gcc.target/i386/avx512cd-vpbroadcastmb2q-2.c
--- a/gcc/testsuite/gcc.target/i386/avx512cd-vpbroadcastmb2q-2.c
+++ b/gcc/testsuite/gcc.target/i386/avx512cd-vpbroadcastmb2q-2.c
@@ -1,7 +1,7 @@
/* { dg-do run } */
/* { dg-options "-O2 -mavx512cd" } */
/* { dg-require-effective-target avx512cd } */
-/* { dg-skip-if "PR target/114150" { *-*-solaris2.* && { ! gas } } } */
+/* { dg-skip-if "PR target/114150" { solaris_as } } */
#define HAVE_512
#define AVX512CD
diff --git a/gcc/testsuite/gcc.target/i386/avx512cd-vpbroadcastmw2d-2.c b/gcc/testsuite/gcc.target/i386/avx512cd-vpbroadcastmw2d-2.c
--- a/gcc/testsuite/gcc.target/i386/avx512cd-vpbroadcastmw2d-2.c
+++ b/gcc/testsuite/gcc.target/i386/avx512cd-vpbroadcastmw2d-2.c
@@ -1,7 +1,7 @@
/* { dg-do run } */
/* { dg-options "-O2 -mavx512cd" } */
/* { dg-require-effective-target avx512cd } */
-/* { dg-skip-if "PR target/114150" { *-*-solaris2.* && { ! gas } } } */
+/* { dg-skip-if "PR target/114150" { solaris_as } } */
#define HAVE_512
#define AVX512CD
diff --git a/gcc/testsuite/gcc.target/i386/pr91298-1.c b/gcc/testsuite/gcc.target/i386/pr91298-1.c
--- a/gcc/testsuite/gcc.target/i386/pr91298-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr91298-1.c
@@ -1,7 +1,7 @@
/* PR target/91298 */
/* { dg-do assemble } */
/* { dg-options "-O2 -g -fdollars-in-identifiers" } */
-/* { dg-xfail-if "No support for $ in identifiers" { *-*-solaris2.* && { ! gas } } } */
+/* { dg-xfail-if "No support for $ in identifiers" { solaris_as } } */
int $a[18];
int *foo (void) { return &$a[0]; }
diff --git a/gcc/testsuite/gcc.target/i386/pr91298-2.c b/gcc/testsuite/gcc.target/i386/pr91298-2.c
--- a/gcc/testsuite/gcc.target/i386/pr91298-2.c
+++ b/gcc/testsuite/gcc.target/i386/pr91298-2.c
@@ -1,6 +1,6 @@
/* PR target/91298 */
/* { dg-do assemble { target fpic } } */
/* { dg-options "-O2 -g -fdollars-in-identifiers -fpic" } */
-/* { dg-xfail-if "No support for $ in identifiers" { *-*-solaris2.* && { ! gas } } } */
+/* { dg-xfail-if "No support for $ in identifiers" { solaris_as } } */
#include "pr91298-1.c"
diff --git a/gcc/testsuite/lib/et-static.def b/gcc/testsuite/lib/et-static.def
--- a/gcc/testsuite/lib/et-static.def
+++ b/gcc/testsuite/lib/et-static.def
@@ -27,3 +27,7 @@
ld_at_file
HAVE_LD_AT_FILE
your linker supports GNU style response files
+
+solaris_as
+HAVE_SOLARIS_AS
+using the Solaris assembler
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -11800,7 +11800,7 @@ proc check_effective_target_sha { } {
proc check_effective_target_avx512dq { } {
# PR target/123415: In addition to the %k0 issue also affecting avx512bw,
# Solaris/x86 as doesn't accept {sae} syntax.
- if { [istarget *-*-solaris2*] && ![check_effective_target_gas] } {
+ if { [check_effective_target_solaris_as] } {
return 0;
}
return [check_no_compiler_messages avx512dq object {
@@ -11820,7 +11820,7 @@ proc check_effective_target_avx512dq { }
proc check_effective_target_avx512bw { } {
# PR target/123415: Solaris/x86 doesn't accept %k0 as source/destination
# in some cases.
- if { [istarget *-*-solaris2*] && ![check_effective_target_gas] } {
+ if { [check_effective_target_solaris_as] } {
return 0;
}
return [check_no_compiler_messages avx512bw object {