On 11/19/24 18:08, Richard Earnshaw (lists) wrote:
On 19/11/2024 10:24, Torbjörn SVENSSON wrote:
Update test cases to use -mcpu=unset/-march=unset feature introduced in
r15-3606-g7d6c6a0d15c.
gcc/testsuite/ChangeLog:
* g++.dg/other/pr56184.C: Use effective-target
arm_arch_v7a_neon and arm_arch_v7a_thumb.
* g++.dg/other/pr59985.C: Use effective-target
arm_arch_v7a_neon and arm_arch_v7a_arm.
* lib/target-supports.exp: Define effective-target
arm_arch_v7a_thumb.
Signed-off-by: Torbjörn SVENSSON <torbjorn.svens...@foss.st.com>
---
gcc/testsuite/g++.dg/other/pr56184.C | 8 ++++++--
gcc/testsuite/g++.dg/other/pr59985.C | 7 +++++--
gcc/testsuite/lib/target-supports.exp | 1 +
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/gcc/testsuite/g++.dg/other/pr56184.C
b/gcc/testsuite/g++.dg/other/pr56184.C
index dc949283c98..f4a4300c385 100644
--- a/gcc/testsuite/g++.dg/other/pr56184.C
+++ b/gcc/testsuite/g++.dg/other/pr56184.C
@@ -1,6 +1,10 @@
/* { dg-do compile { target arm*-*-* } } */
-/* { dg-skip-if "incompatible options" { ! { arm_thumb1_ok || arm_thumb2_ok }
} } */
-/* { dg-options "-fno-short-enums -O2 -mthumb -march=armv7-a -mfpu=neon
-mfloat-abi=softfp -mtune=cortex-a9 -fno-section-anchors -Wno-return-type" } */
+/* { dg-require-effective-target arm_arch_v7a_neon_ok } */
+/* { dg-require-effective-target arm_arch_v7a_thumb_ok } */
+/* { dg-options "-fno-short-enums -O2 -fno-section-anchors -Wno-return-type" }
*/
+/* { dg-add-options arm_arch_v7a_neon } */
+/* { dg-additional-options "-mthumb -mtune=cortex-a9" } */
+
I'd add a new entry for v7a_neon_thumb for this, then we only need one dg-r-e-t
rule here.
typedef unsigned int size_t;
__extension__ typedef int __intptr_t;
diff --git a/gcc/testsuite/g++.dg/other/pr59985.C
b/gcc/testsuite/g++.dg/other/pr59985.C
index 7c9bfab35f1..a0f5e184b43 100644
--- a/gcc/testsuite/g++.dg/other/pr59985.C
+++ b/gcc/testsuite/g++.dg/other/pr59985.C
@@ -1,7 +1,10 @@
/* { dg-do compile { target arm*-*-* } } */
-/* { dg-skip-if "incompatible options" { arm_thumb1 } } */
-/* { dg-options "-g -fcompare-debug -O2 -march=armv7-a -mtune=cortex-a9
-mfpu=vfpv3-d16 -mfloat-abi=hard" } */
/* { dg-skip-if "need hardfp abi" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
+/* { dg-require-effective-target arm_arch_v7a_arm_ok } */
+/* { dg-require-effective-target arm_arch_v7a_neon_ok } */
+/* { dg-options "-g -fcompare-debug -O2" } */
+/* { dg-add-options arm_arch_v7a_neon } */
+/* { dg-additional-options "-marm -mtune=cortex-a9 -mfloat-abi=hard
-mfpu=vfpv3-d16" } */
I don't follow this change, the original test never looks at neon, nor needs it
AFAICT.
I am trying to use the existing effective-targets to verify that -marm
and -mfloat-abi=hard is supported for the armv7-a target.
Would you like me to define an arm_arch_v7a_arm_hard effective-target
and override with -mfpu=vfpv3-d16 or do you want a dedicated
effective-target that will contain also the -mfpu=vfpv3-d16 in the check?
Kind regards,
Torbjörn
extern void *f1 (unsigned long, unsigned long);
extern const struct line_map *f2 (void *, int, unsigned int, const char *,
unsigned int);
diff --git a/gcc/testsuite/lib/target-supports.exp
b/gcc/testsuite/lib/target-supports.exp
index 30e453a578a..6241c00a752 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -5778,6 +5778,7 @@ foreach { armfunc armflag armdefs } {
v7a "-march=armv7-a+fp" __ARM_ARCH_7A__
v7a_arm "-march=armv7-a+fp -marm" "__ARM_ARCH_7A__ && !__thumb__"
v7a_neon "-march=armv7-a+simd -mfpu=auto -mfloat-abi=softfp" "__ARM_ARCH_7A__
&& __ARM_NEON__"
+ v7a_thumb "-march=armv7-a+fp -mthumb" "__ARM_ARCH_7A__ && __thumb__"
I think you want -mfpu=auto here as well.
v7r "-march=armv7-r+fp" __ARM_ARCH_7R__
v7m "-march=armv7-m -mthumb -mfloat-abi=soft" __ARM_ARCH_7M__
v7em "-march=armv7e-m+fp -mthumb" __ARM_ARCH_7EM__
R.