[COFF, ARM64] Add __nop intrinsic
authorMandeep Singh Grang <mgrang@codeaurora.org>
Mon, 14 Jan 2019 23:26:01 +0000 (23:26 +0000)
committerMandeep Singh Grang <mgrang@codeaurora.org>
Mon, 14 Jan 2019 23:26:01 +0000 (23:26 +0000)
Reviewers: rnk, efriedma, TomTan, haripul, ssijaric

Reviewed By: rnk, efriedma

Subscribers: javed.absar, kristof.beyls, cfe-commits

Differential Revision: https://reviews.llvm.org/D56671

llvm-svn: 351135

clang/lib/Headers/intrin.h
clang/test/Headers/ms-arm64-intrin.cpp [new file with mode: 0644]

index b2028ff..1a33af7 100644 (file)
@@ -549,6 +549,9 @@ static __inline__ void __DEFAULT_FN_ATTRS
 __halt(void) {
   __asm__ volatile ("hlt");
 }
+#endif
+
+#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)
 static __inline__ void __DEFAULT_FN_ATTRS
 __nop(void) {
   __asm__ volatile ("nop");
diff --git a/clang/test/Headers/ms-arm64-intrin.cpp b/clang/test/Headers/ms-arm64-intrin.cpp
new file mode 100644 (file)
index 0000000..0b337aa
--- /dev/null
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -triple arm64-windows \
+// RUN: -fms-compatibility -fms-compatibility-version=17.00 \
+// RUN: -ffreestanding -fsyntax-only -Werror \
+// RUN: -isystem %S/Inputs/include %s -S -o - 2>&1 | FileCheck %s
+
+// REQUIRES: aarch64-registered-target
+
+#include <intrin.h>
+
+void f() {
+// CHECK: nop
+  __nop();
+}