[AArch64] Error out of arm_neon.h if nofp/nosimd
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Wed, 14 Jan 2015 12:03:22 +0000 (12:03 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Wed, 14 Jan 2015 12:03:22 +0000 (12:03 +0000)
* config/aarch64/arm_neon.h: Error out if AdvancedSIMD
is not available.

* gcc.target/aarch64/arm_neon-nosimd-error.c: New test.

From-SVN: r219594

gcc/ChangeLog
gcc/config/aarch64/arm_neon.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/arm_neon-nosimd-error.c [new file with mode: 0644]

index dcf97dda44560b513306f51dc072b3ccce912928..857531f0c63840ee8d83c80f858e70b4eadba589 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-14  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       * config/aarch64/arm_neon.h: Error out if AdvancedSIMD
+       is not available.
+
 2015-01-14  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * doc/invoke.texi (mapcs): Mention deprecation.
index 3d1bcd5dc77e19456ca302c23863389a6363b5cf..c679802e9e58244b50ec6c05961701b9b3f5d7f4 100644 (file)
 #ifndef _AARCH64_NEON_H_
 #define _AARCH64_NEON_H_
 
+#ifndef __ARM_NEON
+#error You must enable AdvancedSIMD instructions to use arm_neon.h
+#else
+
 #include <stdint.h>
 
 #define __AARCH64_UINT64_C(__C) ((uint64_t) __C)
@@ -25209,3 +25213,5 @@ __INTERLEAVE_LIST (zip)
 #undef __aarch64_vdupq_laneq_u64
 
 #endif
+
+#endif
index 6429922d59f0bf852fb62a252ae8a7e5e8f9691b..6bb356cdba1615c31ae4131a60ab01df855c1d84 100644 (file)
@@ -1,3 +1,7 @@
+2015-01-14  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       * gcc.target/aarch64/arm_neon-nosimd-error.c: New test.
+
 2015-01-14  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        PR target/64453
diff --git a/gcc/testsuite/gcc.target/aarch64/arm_neon-nosimd-error.c b/gcc/testsuite/gcc.target/aarch64/arm_neon-nosimd-error.c
new file mode 100644 (file)
index 0000000..6c508ec
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-mgeneral-regs-only" } */
+/* { dg-excess-errors "You must enable" } */
+
+#include "arm_neon.h"
+
+int
+foo ()
+{
+  return 0;
+}