This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][GCC][ARM] Fix failing testcase pragma_fpu_attribute.c


Hi All,

My previous patch had two issues with the new test cases.
It seems that depending on which DejaGnu version you have 
dg-additional-options will add the options before or after the
ones added by the test suite. Which means I can't use it to override
the default options.

For this I use a pragma now and place the pragma before GCC needs to emit
any code. Which in turn means it doesn't emit the .fpu directive for the first
switching of fpus.

Secondly, because of the usage of neon I also need to guard against arm_neon_ok.

Regtested on arm-none-eabi and no regressions.

Ok for trunk?


gcc/testsuite/
2017-12-08  Tamar Christina  <tamar.christina@arm.com>

	PR target/82641
	* gcc.target/arm/pragma_fpu_attribute.c: New.
	* gcc.target/arm/pragma_fpu_attribute_2.c: New.

-- 
diff --git a/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute.c b/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute.c
index f47c745855e4acc099afd554838dcf7d031f798c..5f039d9bfb2b14f9134f138527fc395b8e273bbb 100644
--- a/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute.c
+++ b/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute.c
@@ -1,11 +1,14 @@
 /* Test for target attribute assembly extension generations.  */
 /* { dg-do compile } */
 /* { dg-require-effective-target arm_arch_v8a_ok } */
-/* { dg-additional-options "-std=gnu99 -mfpu=vfpv3-d16" } */
+/* { dg-require-effective-target arm_neon_ok } */
+/* { dg-additional-options "-std=gnu99" } */
 
 #include <stdint.h>
 #include <arm_neon.h>
 
+#pragma GCC target("fpu=vfpv3-d16")
+
 extern uint32_t bar();
 
 __attribute__((target("fpu=crypto-neon-fp-armv8"))) poly64x1_t vsricw(poly64x1_t crc, uint32_t val)
diff --git a/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute_2.c b/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute_2.c
index f23fd83779e57e48c0035b6688a21850d12cb4ab..b710de38612707b9109966f7bbc694a913121cb6 100644
--- a/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute_2.c
+++ b/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute_2.c
@@ -1,11 +1,14 @@
 /* Test for #pragma assembly extension generations.  */
 /* { dg-do compile } */
 /* { dg-require-effective-target arm_arch_v8a_ok } */
-/* { dg-additional-options "-std=gnu99 -mfpu=vfpv3-d16" } */
+/* { dg-require-effective-target arm_neon_ok } */
+/* { dg-additional-options "-std=gnu99" } */
 
 #include <stdint.h>
 #include <arm_neon.h>
 
+#pragma GCC target("fpu=vfpv3-d16")
+
 extern uint32_t bar();
 
 #pragma GCC push_options


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]