From 9eb8a68c1b6fd88d3895d963bef304f0f77d816a Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 8 Jul 2014 05:46:04 +0000 Subject: [PATCH] Headers: conditionalise more declarations Protect MMX specific declarations under a __MMX__ guard. This header can be included on non-x86 architectures (e.g. ARM) which do not support the MMX ISA. Use the preprocessor to prevent these declarations from being processed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212512 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Headers/Intrin.h | 2 ++ test/Headers/arm-intrin.c | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 test/Headers/arm-intrin.c diff --git a/lib/Headers/Intrin.h b/lib/Headers/Intrin.h index cad3a3a0bd..d8dc0a4831 100644 --- a/lib/Headers/Intrin.h +++ b/lib/Headers/Intrin.h @@ -41,12 +41,14 @@ extern "C" { #endif +#if defined(__MMX__) /* And the random ones that aren't in those files. */ __m64 _m_from_float(float); __m64 _m_from_int(int _l); void _m_prefetch(void *); float _m_to_float(__m64); int _m_to_int(__m64 _M); +#endif /* Other assorted instruction intrinsics. */ void __addfsbyte(unsigned long, unsigned char); diff --git a/test/Headers/arm-intrin.c b/test/Headers/arm-intrin.c new file mode 100644 index 0000000000..294bc33298 --- /dev/null +++ b/test/Headers/arm-intrin.c @@ -0,0 +1,6 @@ +// RUN: %clang -target armv7-windows -I %S/Inputs/include -Xclang -verify -E %s +// expected-no-diagnostics + +typedef __SIZE_TYPE__ size_t; +#include + -- 2.50.1