arm: testsuite: fix some more architecture tests

This fixes a bunch more tests that try to override the default architecture;
some partially used the framework for doing this, others just blindly
added a -march option, which was doomed to cause problems.  In most cases
we can now run these tests regardless of the users testing options and
the base compiler configuration.

gcc/testsuite:

	* lib/target-supports.exp (check_effective_target_arm_arch_FUNC_ok):
	Add test for v7a_arm.
	* gcc.target/arm/pr60650-2.c: Use require-effective-target and
	add-options.
	* gcc.target/arm/pr60657.c: Likewise.
	* gcc.target/arm/pr60663.c: Likewise.
	* gcc.target/arm/pr81863.c: Likewise.
	* gcc.target/arm/pr97969.c: Likewise.
	* gcc.target/arm/pr98931.c: Likewise.
	* gcc.target/arm/tail-long-call.c: Likewise.
This commit is contained in:
Richard Earnshaw 2023-11-07 10:52:23 +00:00
parent fa3fa735db
commit 1fb7440150
8 changed files with 23 additions and 9 deletions

View file

@ -1,6 +1,8 @@
/* { dg-do compile } */
/* { dg-require-effective-target arm_arch_v7a_ok } */
/* { dg-skip-if "-mpure-code supports M-profile only" { *-*-* } { "-mpure-code" } } */
/* { dg-options "-O2 -fno-omit-frame-pointer -march=armv7-a" } */
/* { dg-options "-O2 -fno-omit-frame-pointer" } */
/* { dg-add-options arm_arch_v7a } */
int a, h, j;
long long d, e, i;

View file

@ -1,6 +1,8 @@
/* { dg-do compile } */
/* { dg-require-effective-target arm_arch_v7a_ok } */
/* { dg-skip-if "-mpure-code supports M-profile only" { *-*-* } { "-mpure-code" } } */
/* { dg-options "-O2 -march=armv7-a" } */
/* { dg-options "-O2" } */
/* { dg-add-options arm_arch_v7a } */
void foo (void);

View file

@ -1,7 +1,9 @@
/* PR rtl-optimization/60663 */
/* { dg-do compile } */
/* { dg-require-effective-target arm_arch_v7a_ok } */
/* { dg-skip-if "-mpure-code supports M-profile only" { *-*-* } { "-mpure-code" } } */
/* { dg-options "-O2 -march=armv7-a" } */
/* { dg-options "-O2" } */
/* { dg-add-options arm_arch_v7a } */
int
foo (void)

View file

@ -1,8 +1,10 @@
/* testsuite/gcc.target/arm/pr48183.c */
/* { dg-do compile } */
/* { dg-require-effective-target arm_arch_v7a_arm_ok } */
/* { dg-skip-if "-mslow-flash-data and -mword-relocations incompatible" { *-*-* } { "-mslow-flash-data" } } */
/* { dg-skip-if "-mpure-code and -mword-relocations incompatible" { *-*-* } { "-mpure-code" } } */
/* { dg-options "-O2 -mword-relocations -march=armv7-a -marm" } */
/* { dg-options "-O2 -mword-relocations" } */
/* { dg-add-options arm_arch_v7a_arm } */
/* { dg-final { scan-assembler-not "\[\\t \]+movw" } } */
int a, d, f;

View file

@ -1,5 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-std=c99 -fno-omit-frame-pointer -mthumb -w -Os" } */
/* { dg-require-effective-target arm_arch_v6m_ok } */
/* { dg-options "-std=c99 -fno-omit-frame-pointer -w -Os" } */
/* { dg-add-options arm_arch_v6m } */
typedef a[23];
enum { b };

View file

@ -1,6 +1,7 @@
/* { dg-do assemble } */
/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
/* { dg-options "-march=armv8.1-m.main -O3 --param=max-completely-peeled-insns=1300 --save-temps -mthumb" } */
/* { dg-require-effective-target arm_arch_v8_1m_main_ok } */
/* { dg-options "-O3 --param=max-completely-peeled-insns=1300 --save-temps" } */
/* { dg-add-options arm_arch_v8_1m_main } */
extern long long a[][20][26][26][22];

View file

@ -1,6 +1,8 @@
/* { dg-skip-if "need at least armv5te" { *-*-* } { "-march=armv[234]*" "-mthumb" } { "" } } */
/* { dg-do compile } */
/* { dg-require-effective-target arm_arch_v5te_arm_ok } */
/* { dg-skip-if "FDPIC does not support tailcall optimization" { arm*-*-uclinuxfdpiceabi } "*" "" } */
/* { dg-options "-O2 -march=armv5te -marm" } */
/* { dg-options "-O2" } */
/* { dg-add-options arm_arch_v5te_arm } */
/* { dg-final { scan-assembler "bx" } } */
/* { dg-final { scan-assembler-not "blx" } } */

View file

@ -5424,6 +5424,7 @@ foreach { armfunc armflag armdefs } {
v6z_thumb "-march=armv6z+fp -mthumb -mfloat-abi=softfp" "__ARM_ARCH_6Z__ && __thumb__"
v6m "-march=armv6-m -mthumb -mfloat-abi=soft" __ARM_ARCH_6M__
v7a "-march=armv7-a+fp" __ARM_ARCH_7A__
v7a_arm "-march=armv7-a+fp -marm" "__ARM_ARCH_7A__ && !__thumb__"
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__