From da85304aee5402f49d4ba36603a40153e989bd18 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Wed, 12 Mar 2014 21:09:03 +0000 Subject: [PATCH] MS intrinsics: don't declare __readeflags and __writeeflags in Intrin.h They're already defined in ia32intrin.h, and this would cause including Intrin.h in 64-bit mode to fail because of conflicting types. Update ms-intrin.cpp to also run in 64-bit mode to catch things like this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203714 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Headers/Intrin.h | 2 -- test/Headers/ms-intrin.cpp | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Headers/Intrin.h b/lib/Headers/Intrin.h index f5843cfab0..54e0899350 100644 --- a/lib/Headers/Intrin.h +++ b/lib/Headers/Intrin.h @@ -106,7 +106,6 @@ unsigned long __readcr3(void); unsigned long __readcr4(void); unsigned long __readcr8(void); unsigned int __readdr(unsigned int); -unsigned int __readeflags(void); #ifdef __i386__ static __inline__ unsigned char __readfsbyte(unsigned long); @@ -142,7 +141,6 @@ void __writecr3(unsigned int); void __writecr4(unsigned int); void __writecr8(unsigned int); void __writedr(unsigned int, unsigned int); -void __writeeflags(unsigned int); void __writefsbyte(unsigned long, unsigned char); void __writefsdword(unsigned long, unsigned long); void __writefsqword(unsigned long, unsigned __int64); diff --git a/test/Headers/ms-intrin.cpp b/test/Headers/ms-intrin.cpp index 4583915f44..03f57a5955 100644 --- a/test/Headers/ms-intrin.cpp +++ b/test/Headers/ms-intrin.cpp @@ -3,6 +3,11 @@ // RUN: -ffreestanding -fsyntax-only -Werror \ // RUN: -isystem %S/Inputs/include %s +// RUN: %clang_cc1 -triple x86_64-pc-win32 \ +// RUN: -fms-extensions -fms-compatibility -fmsc-version=1700 \ +// RUN: -ffreestanding -fsyntax-only -Werror \ +// RUN: -isystem %S/Inputs/include %s + // Intrin.h needs size_t, but -ffreestanding prevents us from getting it from // stddef.h. Work around it with this typedef. typedef __SIZE_TYPE__ size_t; -- 2.40.0