From 3ad0f67f7cc908fe8d4b5f8781c0cea4f25c12ed Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Mon, 21 Oct 2024 00:12:10 -0300 Subject: [testsuite] [arm] add effective target and options for pacbti tests arm pac and bti tests that use -march=armv8.1-m.main get an implicit -mthumb, that is incompatible with vxworks kernel mode. Declaring the requirement for a 8.1-m.main-compatible toolchain is enough to avoid those fails, because the toolchain feature test fails in kernel mode, but taking the -march options from the standardized arch tests, after testing for support for the corresponding effective target, makes it generally safer, and enables us to drop skip directives and extraneous option variants. for gcc/testsuite/ChangeLog * gcc.target/arm/bti-1.c: Require arch, use its opts, drop skip. * gcc.target/arm/bti-2.c: Likewise. * gcc.target/arm/acle/pacbti-m-predef-11.c: Likewise. * gcc.target/arm/acle/pacbti-m-predef-12.c: Likewise. * gcc.target/arm/acle/pacbti-m-predef-7.c: Likewise. * g++.target/arm/pac-1.C: Likewise. Drop +mve. --- gcc/testsuite/g++.target/arm/pac-1.C | 5 +++-- gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-11.c | 4 ++-- gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-12.c | 5 +++-- gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-7.c | 5 +++-- gcc/testsuite/gcc.target/arm/bti-1.c | 5 +++-- gcc/testsuite/gcc.target/arm/bti-2.c | 5 +++-- 6 files changed, 17 insertions(+), 12 deletions(-) (limited to 'gcc') diff --git a/gcc/testsuite/g++.target/arm/pac-1.C b/gcc/testsuite/g++.target/arm/pac-1.C index f671a27..ac15ae1 100644 --- a/gcc/testsuite/g++.target/arm/pac-1.C +++ b/gcc/testsuite/g++.target/arm/pac-1.C @@ -1,7 +1,8 @@ /* Check that GCC does .save and .cfi_offset directives with RA_AUTH_CODE pseudo hard-register. */ /* { dg-do compile } */ -/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */ -/* { dg-options "-march=armv8.1-m.main+mve+pacbti -mbranch-protection=pac-ret -mthumb -mfloat-abi=hard -g -O0" } */ +/* { dg-require-effective-target arm_arch_v8_1m_main_pacbti_ok } */ +/* { dg-add-options arm_arch_v8_1m_main_pacbti } */ +/* { dg-additional-options "-mbranch-protection=pac-ret -mfloat-abi=hard -g -O0" } */ __attribute__((noinline)) void fn1 (int a, int b, int c) diff --git a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-11.c b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-11.c index 6a5ae92..c9c40f4 100644 --- a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-11.c +++ b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-11.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" "-mfloat-abi=*" } } */ -/* { dg-options "-march=armv8.1-m.main+fp+pacbti" } */ +/* { dg-require-effective-target arm_arch_v8_1m_main_pacbti_ok } */ +/* { dg-add-options arm_arch_v8_1m_main_pacbti } */ #if (__ARM_FEATURE_BTI != 1) #error "Feature test macro __ARM_FEATURE_BTI_DEFAULT should be defined to 1." diff --git a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-12.c b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-12.c index db40b17..c260513 100644 --- a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-12.c +++ b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-12.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ -/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */ -/* { dg-options "-march=armv8-m.main+fp -mfloat-abi=softfp" } */ +/* { dg-require-effective-target arm_arch_v8_1m_main_ok } */ +/* { dg-add-options arm_arch_v8_1m_main } */ +/* { dg-additional-options "-mfloat-abi=softfp" } */ #if defined (__ARM_FEATURE_BTI) #error "Feature test macro __ARM_FEATURE_BTI should not be defined." diff --git a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-7.c b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-7.c index 1b25907..92f500c 100644 --- a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-7.c +++ b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-7.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ -/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */ -/* { dg-additional-options "-march=armv8.1-m.main+pacbti+fp --save-temps -mfloat-abi=hard" } */ +/* { dg-require-effective-target arm_arch_v8_1m_main_pacbti_ok } */ +/* { dg-add-options arm_arch_v8_1m_main_pacbti } */ +/* { dg-additional-options "--save-temps -mfloat-abi=hard" } */ #if defined (__ARM_FEATURE_BTI_DEFAULT) #error "Feature test macro __ARM_FEATURE_BTI_DEFAULT should be undefined." diff --git a/gcc/testsuite/gcc.target/arm/bti-1.c b/gcc/testsuite/gcc.target/arm/bti-1.c index 79dd801..a34bb08 100644 --- a/gcc/testsuite/gcc.target/arm/bti-1.c +++ b/gcc/testsuite/gcc.target/arm/bti-1.c @@ -1,7 +1,8 @@ /* Check that GCC does bti instruction. */ /* { dg-do compile } */ -/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */ -/* { dg-options "-march=armv8.1-m.main -mthumb -mfloat-abi=softfp -mbranch-protection=bti --save-temps" } */ +/* { dg-require-effective-target arm_arch_v8_1m_main_ok } */ +/* { dg-add-options arm_arch_v8_1m_main } */ +/* { dg-additional-options "-mfloat-abi=softfp -mbranch-protection=bti --save-temps" } */ int main (void) diff --git a/gcc/testsuite/gcc.target/arm/bti-2.c b/gcc/testsuite/gcc.target/arm/bti-2.c index 3391056..e5bc4d5 100644 --- a/gcc/testsuite/gcc.target/arm/bti-2.c +++ b/gcc/testsuite/gcc.target/arm/bti-2.c @@ -1,8 +1,9 @@ /* { dg-do compile } */ /* -Os to create jump table. */ /* { dg-options "-Os" } */ -/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */ -/* { dg-options "-march=armv8.1-m.main -mthumb -mfloat-abi=softfp -mbranch-protection=bti --save-temps" } */ +/* { dg-require-effective-target arm_arch_v8_1m_main_ok } */ +/* { dg-add-options arm_arch_v8_1m_main } */ +/* { dg-additional-options "-mfloat-abi=softfp -mbranch-protection=bti --save-temps" } */ extern int f1 (void); extern int f2 (void); -- cgit v1.1