On 2024-10-09 12:18, Richard Earnshaw (lists) wrote:
On 07/10/2024 20:04, Torbjorn SVENSSON wrote:
Hi Richard,

On 2024-10-07 12:45, Richard Earnshaw (lists) wrote:
On 07/10/2024 09:03, Torbjörn SVENSSON wrote:
Ok for trunk?

--

Update test cases to use -mcpu=unset/-march=unset feature introduced in
r15-3606-g7d6c6a0d15c.

The acronym ET isn't one I recognize - I'm guessing you intend it to be Effective Target, rather than Extra Terrestrial, or Elf Target or some other expansion?  I think perhaps it would be better to avoid this in the commit log.  Your summary line is also a little imprecise as I suspect we will have more patches of a similar nature for some other patches soon.  Something like:

testsuite: arm: use effective-target for vsel* and mod* tests

would be closer

I'm fairly certain that I've seen the abbr ET for effective-target somewhere, but I could be wrong. Anyway, I've used your suggestion and will push it as soon as I get a comment on my questions below.



gcc/testsuite/ChangeLog

    * gcc.target/arm/pr65647.c: Use ET arm_arch_v6m.
    * gcc.target/arm/mod_2.c: Use ET arm_cpu_cortex_a57.
    * gcc.target/arm/mod_256.c: Likewise.
    * gcc.target/arm/vseleqdf.c: Likewise.
    * gcc.target/arm/vseleqsf.c: Likewise.
    * gcc.target/arm/vselgedf.c: Likewise.
    * gcc.target/arm/vselgesf.c: Likewise.
    * gcc.target/arm/vselgtdf.c: Likewise.
    * gcc.target/arm/vselgtsf.c: Likewise.
    * gcc.target/arm/vselledf.c: Likewise.
    * gcc.target/arm/vsellesf.c: Likewise.
    * gcc.target/arm/vselltdf.c: Likewise.
    * gcc.target/arm/vselltsf.c: Likewise.
    * gcc.target/arm/vselnedf.c: Likewise.
    * gcc.target/arm/vselnesf.c: Likewise.
    * gcc.target/arm/vselvcdf.c: Likewise.
    * gcc.target/arm/vselvcsf.c: Likewise.
    * gcc.target/arm/vselvsdf.c: Likewise.
    * gcc.target/arm/vselvssf.c: Likewise.
    * lib/target-supports.exp: Define EF arm_cpu_cortex_a57.  Update ET
                                           ^^
Typo for ET?

Yes :S


The body of the patch is OK with an updated commit message.

Thanks.
R.


    arm_v8_1_lob_ok to use -mcpu=unset.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svens...@foss.st.com>
---
  gcc/testsuite/gcc.target/arm/mod_2.c    | 4 +++-
  gcc/testsuite/gcc.target/arm/mod_256.c  | 4 +++-
  gcc/testsuite/gcc.target/arm/pr65647.c  | 3 ++-
  gcc/testsuite/gcc.target/arm/vseleqdf.c | 5 +++--
  gcc/testsuite/gcc.target/arm/vseleqsf.c | 5 +++--
  gcc/testsuite/gcc.target/arm/vselgedf.c | 5 +++--
  gcc/testsuite/gcc.target/arm/vselgesf.c | 5 +++--
  gcc/testsuite/gcc.target/arm/vselgtdf.c | 5 +++--
  gcc/testsuite/gcc.target/arm/vselgtsf.c | 5 +++--
  gcc/testsuite/gcc.target/arm/vselledf.c | 5 +++--
  gcc/testsuite/gcc.target/arm/vsellesf.c | 5 +++--
  gcc/testsuite/gcc.target/arm/vselltdf.c | 5 +++--
  gcc/testsuite/gcc.target/arm/vselltsf.c | 5 +++--
  gcc/testsuite/gcc.target/arm/vselnedf.c | 5 +++--
  gcc/testsuite/gcc.target/arm/vselnesf.c | 5 +++--
  gcc/testsuite/gcc.target/arm/vselvcdf.c | 5 +++--
  gcc/testsuite/gcc.target/arm/vselvcsf.c | 5 +++--
  gcc/testsuite/gcc.target/arm/vselvsdf.c | 5 +++--
  gcc/testsuite/gcc.target/arm/vselvssf.c | 5 +++--
  gcc/testsuite/lib/target-supports.exp   | 3 ++-
  20 files changed, 58 insertions(+), 36 deletions(-)

diff --git a/gcc/testsuite/gcc.target/arm/mod_2.c b/gcc/testsuite/ gcc.target/arm/mod_2.c
index 1143725d59a..3a203b67d73 100644
--- a/gcc/testsuite/gcc.target/arm/mod_2.c
+++ b/gcc/testsuite/gcc.target/arm/mod_2.c
@@ -1,7 +1,9 @@
  /* { dg-do compile } */
  /* { dg-skip-if "-mpure-code supports M-profile only" { *-*-* } { "-mpure-code" } } */
  /* { dg-require-effective-target arm32 } */
-/* { dg-options "-O2 -mcpu=cortex-a57 -save-temps" } */
+/* { dg-require-effective-target arm_cpu_cortex_a57 } */
+/* { dg-options "-O2 -save-temps" } */
+/* { dg-add-options arm_cpu_cortex_a57 } */
  #include "../aarch64/mod_2.x"
diff --git a/gcc/testsuite/gcc.target/arm/mod_256.c b/gcc/testsuite/ gcc.target/arm/mod_256.c
index d8dca0fe7d5..3521d7a05f3 100644
--- a/gcc/testsuite/gcc.target/arm/mod_256.c
+++ b/gcc/testsuite/gcc.target/arm/mod_256.c
@@ -1,7 +1,9 @@
  /* { dg-do compile } */
  /* { dg-skip-if "-mpure-code supports M-profile only" { *-*-* } { "-mpure-code" } } */
  /* { dg-require-effective-target arm32 } */
-/* { dg-options "-O2 -mcpu=cortex-a57 -save-temps" } */
+/* { dg-require-effective-target arm_cpu_cortex_a57 } */
+/* { dg-options "-O2 -save-temps" } */
+/* { dg-add-options arm_cpu_cortex_a57 } */
  #include "../aarch64/mod_256.x"
diff --git a/gcc/testsuite/gcc.target/arm/pr65647.c b/gcc/testsuite/ gcc.target/arm/pr65647.c
index 26b4e399f6b..dc3a3ca1184 100644
--- a/gcc/testsuite/gcc.target/arm/pr65647.c
+++ b/gcc/testsuite/gcc.target/arm/pr65647.c
@@ -1,7 +1,8 @@
  /* { dg-do compile } */
  /* { dg-require-effective-target arm_arch_v6m_ok } */
  /* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "- mfloat-abi=*" } {"-mfloat-abi=soft" } } */
-/* { dg-options "-march=armv6-m -mthumb -O3 -w -mfloat-abi=soft" } */
+/* { dg-options "-mthumb -O3 -w -mfloat-abi=soft" } */
+/* { dg-add-options arm_arch_v6m } */

When I rebased this patch, I got a minor conflict here. The conflict was easy to resolve, but it got me thinking.

Should -mthumb and -mfloat-abi=soft be removed from dg-options as they are now added by the dg-add-options directive?

I think the answer to that is "it depends"!  If the dg-add-options add an explicit flag, then there's no need to repeat it elsewhere; but there are some caveats to that, in particular completely removing dg-options may cause the test to be run in a different manner (it depend on the controlling .exp file) and we probably don't want to do that.

As the arm_arch_v6m adds the options, I removed the duplicated options so that dg-options now only contains "-O3 -w -fpermissive". The "-fpermissive" was added in the conflicting change that got me thinking.


Also, should the dg-skip-if line be dropped as it should be fine to do a "compile" test, regardless if there were some other -mfloat-abi option passed somewhere?

I think they can now.  Most of those directives were added back in the days of an older version of dejagnu which placed the options in a different order (putting the -mfloat-abi option from the test before the option supplied from the run configuration; resulting in the wrong flag taking precedence).  But that was fixed probably over 10 years ago now, so I don't think we need to worry about that anymore.

I removed the dg-skip-if line.

Pushed as r15-4200-gcf08dd297ca.

Kind regards,
Torbjörn



I can split out the change to gcc.target/arm/pr65647.c if you want more time to think about it. Based on your answer, I will use that as guidance for other similar cases that I will likely stumble up on when trying to figure out the rest of the test cases that needs the - march=unset/-mcpu=unset.

I think it's fine as is; let's not make too much extra work for ourselves :)

R.


Kind regards,
Torbjörn



Reply via email to