[clang] 98286b5 - [Headers] Fix compatibility between arm_acle.h and intrin.h
Eli Friedman via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 29 15:02:37 PDT 2019
Author: Eli Friedman
Date: 2019-10-29T14:52:56-07:00
New Revision: 98286b569d01a461d75c9fd133cbf52c0c92e32a
URL: https://github.com/llvm/llvm-project/commit/98286b569d01a461d75c9fd133cbf52c0c92e32a
DIFF: https://github.com/llvm/llvm-project/commit/98286b569d01a461d75c9fd133cbf52c0c92e32a.diff
LOG: [Headers] Fix compatibility between arm_acle.h and intrin.h
Make sure they don't both define __nop.
Differential Revision: https://reviews.llvm.org/D69012
Added:
Modified:
clang/lib/Headers/arm_acle.h
clang/test/Headers/arm-acle-header.c
Removed:
################################################################################
diff --git a/clang/lib/Headers/arm_acle.h b/clang/lib/Headers/arm_acle.h
index 137092fb9d76..596ea03cff2f 100644
--- a/clang/lib/Headers/arm_acle.h
+++ b/clang/lib/Headers/arm_acle.h
@@ -90,9 +90,11 @@ __swp(uint32_t __x, volatile uint32_t *__p) {
#endif
/* 8.7 NOP */
+#if !defined(_MSC_VER) || !defined(__aarch64__)
static __inline__ void __attribute__((__always_inline__, __nodebug__)) __nop(void) {
__builtin_arm_nop();
}
+#endif
/* 9 DATA-PROCESSING INTRINSICS */
/* 9.2 Miscellaneous data-processing intrinsics */
diff --git a/clang/test/Headers/arm-acle-header.c b/clang/test/Headers/arm-acle-header.c
index d9d2e04c945c..932c59da3d96 100644
--- a/clang/test/Headers/arm-acle-header.c
+++ b/clang/test/Headers/arm-acle-header.c
@@ -4,6 +4,12 @@
// RUN: %clang_cc1 -x c++ -triple armv7-eabi -target-cpu cortex-a15 -fsyntax-only -ffreestanding %s
// RUN: %clang_cc1 -x c++ -triple aarch64-eabi -target-cpu cortex-a57 -fsyntax-only -ffreestanding %s
// RUN: %clang_cc1 -x c++ -triple thumbv7-windows -target-cpu cortex-a15 -fsyntax-only -ffreestanding %s
+// RUN: %clang_cc1 -x c++ -triple thumbv7-windows -target-cpu cortex-a15 -fsyntax-only -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=19.11 %s
+// RUN: %clang_cc1 -x c++ -triple aarch64-windows -target-cpu cortex-a53 -fsyntax-only -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=19.11 %s
// expected-no-diagnostics
#include <arm_acle.h>
+#ifdef _MSC_VER
+#include <intrin.h>
+#endif
+void f() { __nop(); __dmb(0); __wfi(); }
More information about the cfe-commits
mailing list