]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Re: [PATCH 2/2] Corrected pr25521.c target matching.
authorCupertino Miranda <cupertino.miranda@oracle.com>
Sat, 11 Mar 2023 16:22:36 +0000 (09:22 -0700)
committerJeff Law <jlaw@ventanamicro>
Sat, 11 Mar 2023 16:22:36 +0000 (09:22 -0700)
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

gcc/testsuite/gcc.dg/pr25521.c
gcc/testsuite/lib/target-supports.exp

index 63363a03b9ff6c53e4c8f631090de1ea779f3c23..82b4cd88ec05870860358ea583c19d2f624ff582 100644 (file)
@@ -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-*-*" } } } } */
index 84ac737152313fb8004762a7fb89ea021fc2adde..5e4a73af0de3350888d66239c5d59a452afa9fa4 100644 (file)
@@ -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
+}