diff options
author | Cupertino Miranda <cupertino.miranda@oracle.com> | 2023-03-11 09:22:36 -0700 |
---|---|---|
committer | Jeff Law <jlaw@ventanamicro> | 2023-03-11 09:22:36 -0700 |
commit | 23ff46459a4a3bbb0a2420f2bbb84d0247303e2f (patch) | |
tree | 5c8d22e222625fdaf4bc1a1c119a02f8d88af8e8 /gcc | |
parent | 2cf5f485e0351bb1faf46196a99e524688f3966e (diff) | |
download | gcc-23ff46459a4a3bbb0a2420f2bbb84d0247303e2f.zip gcc-23ff46459a4a3bbb0a2420f2bbb84d0247303e2f.tar.gz gcc-23ff46459a4a3bbb0a2420f2bbb84d0247303e2f.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr25521.c | 7 | ||||
-rw-r--r-- | 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 63363a0..82b4cd8 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 84ac737..5e4a73a 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 +} |