This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][AArch64] Skip gcc.target/aarch64/assembler_arch_1.c if assembler does not support it
- From: Kyrill Tkachov <kyrylo dot tkachov at foss dot arm dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Marcus Shawcroft <marcus dot shawcroft at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, James Greenhalgh <james dot greenhalgh at arm dot com>
- Date: Tue, 16 Feb 2016 09:27:00 +0000
- Subject: [PATCH][AArch64] Skip gcc.target/aarch64/assembler_arch_1.c if assembler does not support it
- Authentication-results: sourceware.org; auth=none
Hi all,
As Christophe reported at:
https://gcc.gnu.org/ml/gcc-patches/2016-02/msg00784.html
The test gcc.target/aarch64/assembler_arch_1.c fails to assemble on older assemblers that
don't support the LSE architecture extension.
I'd really like to keep the test an assemble test rather than just a compile one since
it is extracted from a real error when building the Linux kernel, so this patch is
the simplest way I can think of skipping the test for older assemblers.
I've tested that the test appears UNSUPPORTED when used with a binutils that doesn't
support LSE and PASSes normally on latest binutils.
Do we want to have such a specialised check for assembler capabilities?
Or do we want to just let this test FAIL on older assemblers and see this failure go away
in the future as users/testers migrate to later binutils releases?
If such a check is desired, here's a patch that does it.
Thanks,
Kyrill
2016-02-16 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* lib/target-supports.exp
(check_effective_target_aarch64_lse_assembler): New effective target
check.
* gcc.target/aarch64/assembler_arch_1.c: Add arch64_lse_assembler
effective target check.
diff --git a/gcc/testsuite/gcc.target/aarch64/assembler_arch_1.c b/gcc/testsuite/gcc.target/aarch64/assembler_arch_1.c
index 901e50a178d7a4a443a5ad0abe63f624688db268..ef34e76cef9c3076a3c32e76aa7a7f658774f786 100644
--- a/gcc/testsuite/gcc.target/aarch64/assembler_arch_1.c
+++ b/gcc/testsuite/gcc.target/aarch64/assembler_arch_1.c
@@ -1,4 +1,5 @@
/* { dg-do assemble } */
+/* { dg-require-effective-target aarch64_lse_assembler } */
/* { dg-options "-march=armv8-a" } */
/* Make sure that the function header in assembly doesn't override
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 645981a8733b68a7c37919a53b324841d2c125aa..08b4eacc26f44506d00fda58f99c203a4199856b 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -6718,6 +6718,18 @@ proc check_effective_target_aarch64_tiny { } {
}
}
+# Return 1 if the target AArch64 assembler supports the LSE extensions.
+
+proc check_effective_target_aarch64_lse_assembler { } {
+ if { [istarget aarch64*-*-*] } {
+ return [check_no_compiler_messages aarch64_lse_assembler object {
+ __asm__ (".arch_extension lse");
+ } "-march=armv8-a+lse"]
+ } else {
+ return 0
+ }
+}
+
proc check_effective_target_aarch64_small { } {
if { [istarget aarch64*-*-*] } {
return [check_no_compiler_messages aarch64_small object {