[gcc r17-3371] [PATCH 3/7] testsuite: require stack protector support in no-stack-protector-attr.C

Jeff Law via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:6dad587cb3342289387b454ee3d8e230066dbf80

commit r17-3371-g6dad587cb3342289387b454ee3d8e230066dbf80
Author: Matt Turner <[email protected]>
Date:   Tue Aug 18 08:32:06 2026 -0600

    [PATCH 3/7] testsuite: require stack protector support in no-stack-protector-attr.C
    
    The test carried two dg-do compile directives: one restricting it to x86
    and, added later, one excluding only hppa.  DejaGnu honors the last one, so
    the x86 restriction never had any effect and the test has run everywhere
    since it was added, which is why hppa needed excluding at all.
    
    Require fstack_protector instead, so the test runs wherever the feature
    exists.  This fixes it on alpha, which does not support -fstack-protector
    and warns that the option is unsupported.  The hppa exclusion becomes
    redundant, as check_effective_target_fstack_protector already returns 0
    there.
    
    gcc/testsuite/ChangeLog:
    
            * g++.dg/no-stack-protector-attr.C: Remove the dead dg-do directive
            and the hppa exclusion, and require fstack_protector.

Diff:
---
 gcc/testsuite/g++.dg/no-stack-protector-attr.C | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/g++.dg/no-stack-protector-attr.C b/gcc/testsuite/g++.dg/no-stack-protector-attr.C
index 3314a94bd7bc..a285c5517951 100644
--- a/gcc/testsuite/g++.dg/no-stack-protector-attr.C
+++ b/gcc/testsuite/g++.dg/no-stack-protector-attr.C
@@ -1,11 +1,10 @@
 /* PR c/94722 */
 /* Test that stack protection is disabled via no_stack_protector attribute. */
 
-/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target fstack_protector } */
 /* { dg-options "-O2 -fstack-protector-all" } */
 
-/* { dg-do compile { target { ! hppa*-*-* } } } */
-
 int __attribute__((no_stack_protector)) c()
 {
   int a;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.