From 0055f80b3f5d6eb89da621dee01c398e01451297 Mon Sep 17 00:00:00 2001 From: Mandeep Singh Grang Date: Mon, 14 Jan 2019 23:26:01 +0000 Subject: [PATCH] [COFF, ARM64] Add __nop intrinsic 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 | 3 +++ clang/test/Headers/ms-arm64-intrin.cpp | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 clang/test/Headers/ms-arm64-intrin.cpp diff --git a/clang/lib/Headers/intrin.h b/clang/lib/Headers/intrin.h index b2028ff..1a33af7 100644 --- a/clang/lib/Headers/intrin.h +++ b/clang/lib/Headers/intrin.h @@ -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 index 0000000..0b337aa --- /dev/null +++ b/clang/test/Headers/ms-arm64-intrin.cpp @@ -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 + +void f() { +// CHECK: nop + __nop(); +} -- 2.7.4