AM_CONDITIONAL(BUILD_ARMV82_TESTS, test x$ac_have_armv82_feature = xyes)
-# Does the C compiler support the armv82-a+dotprod flag and assembler dotprod instructions
+# Does the compiler and CPU support the armv82-a+dotprod flag and assembler dotprod instructions
# Note, this doesn't generate a C-level symbol. It generates a
# automake-level symbol (BUILD_ARMV82_DOTPROD_TESTS), used in test Makefile.am's
-AC_MSG_CHECKING([if gcc supports the armv82-a+dotprod feature flag and assembler supports dotprod instructions])
+AC_MSG_CHECKING([if armv82-a+dotprod is supported for tests])
save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -march=armv8.2-a+dotprod -Werror"
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
-int main()
+CFLAGS="$CFLAGS -march=armv8.2-a+dotprod"
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+int main(void)
{
__asm__ __volatile__("sdot v1.4s, v2.16b, v3.16b");
return 0;