commit 3c3d56e01ec55f8387bf447e57cdc7f94b0e119b Author: Kyrylo Tkachov Date: Thu Dec 11 15:09:56 2014 +0000 [AArch64] Error out of arm_neon.h if nofp/nosimd diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h index 319cd8c..22dfb0b 100644 --- a/gcc/config/aarch64/arm_neon.h +++ b/gcc/config/aarch64/arm_neon.h @@ -27,6 +27,10 @@ #ifndef _AARCH64_NEON_H_ #define _AARCH64_NEON_H_ +#ifndef __ARM_NEON +#error You must enable AdvancedSIMD instructions to use arm_neon.h +#else + #include #define __AARCH64_UINT64_C(__C) ((uint64_t) __C) @@ -25209,3 +25213,5 @@ __INTERLEAVE_LIST (zip) #undef __aarch64_vdupq_laneq_u64 #endif + +#endif 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 index 0000000..6c508ec --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/arm_neon-nosimd-error.c @@ -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; +}