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
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-*-*" } } } } */
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
+}