public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-6606] Re: [PATCH 2/2] Corrected pr25521.c target matching.
@ 2023-03-11 16:24 Jeff Law
  0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2023-03-11 16:24 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:23ff46459a4a3bbb0a2420f2bbb84d0247303e2f

commit r13-6606-g23ff46459a4a3bbb0a2420f2bbb84d0247303e2f
Author: Cupertino Miranda <cupertino.miranda@oracle.com>
Date:   Sat Mar 11 09:22:36 2023 -0700

    Re: [PATCH 2/2] Corrected pr25521.c target matching.
    
    gcc/testsuite:
            * gcc.dg/pr25521.c: Skip for !const_volatile_readonly_section
            targets.  Adjust expected output.
    
            * lib/target-supports.exp
            (check_effective_target_const_volatile_readonly_section): New

Diff:
---
 gcc/testsuite/gcc.dg/pr25521.c        |  7 ++++---
 gcc/testsuite/lib/target-supports.exp | 10 ++++++++++
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/pr25521.c b/gcc/testsuite/gcc.dg/pr25521.c
index 63363a03b9f..82b4cd88ec0 100644
--- a/gcc/testsuite/gcc.dg/pr25521.c
+++ b/gcc/testsuite/gcc.dg/pr25521.c
@@ -2,9 +2,10 @@
    sections.
 
    { dg-require-effective-target elf }
-   { dg-do compile } */
+   { dg-do compile }
+   { dg-skip-if "" { ! const_volatile_readonly_section } } */
 
 const volatile int foo = 30;
 
-
-/* { dg-final { scan-assembler "\\.s\?rodata" } } */
+/* { dg-final { scan-assembler {.section C,} { target { rx-*-* } } } } */
+/* { dg-final { scan-assembler-symbol-section {^_?foo$} {^\.(const|s?rodata)} { target { ! "rx-*-*" } } } } */
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 84ac7371523..5e4a73af0de 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -12320,3 +12320,13 @@ proc check_is_prog_name_available { prog } {
 
     return 1
 }
+
+# returns 1 if target does selects a readonly section for const volatile variables.
+proc check_effective_target_const_volatile_readonly_section { } {
+
+    if { [istarget powerpc-*-*]
+    	  || [check-flags { "" { powerpc64-*-* } { -m32 } }] } {
+	return 0
+    }
+  return 1
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-11 16:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-11 16:24 [gcc r13-6606] Re: [PATCH 2/2] Corrected pr25521.c target matching Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).