efriedma created this revision.
efriedma added reviewers: rnk, chill.
Herald added a subscriber: kristof.beyls.
Herald added a project: clang.

Make sure they don't both define __nop.  We use a similar pattern for other 
functions in arm_acle.h.


Repository:
  rC Clang

https://reviews.llvm.org/D69012

Files:
  lib/Headers/arm_acle.h
  test/Headers/arm-acle-header.c


Index: test/Headers/arm-acle-header.c
===================================================================
--- test/Headers/arm-acle-header.c
+++ 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(); }
Index: lib/Headers/arm_acle.h
===================================================================
--- lib/Headers/arm_acle.h
+++ lib/Headers/arm_acle.h
@@ -90,9 +90,11 @@
 #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 */


Index: test/Headers/arm-acle-header.c
===================================================================
--- test/Headers/arm-acle-header.c
+++ 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(); }
Index: lib/Headers/arm_acle.h
===================================================================
--- lib/Headers/arm_acle.h
+++ lib/Headers/arm_acle.h
@@ -90,9 +90,11 @@
 #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 */
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to