From: Bob Wilson Date: Fri, 8 Aug 2014 23:46:28 +0000 (+0000) Subject: Add predefined macros to identify x86_64h architectures. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=253b9b69661f160d1c09759a16e2ac04a0335e44;p=clang Add predefined macros to identify x86_64h architectures. Patch by Jim Grosbach. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215260 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 227fefe174..2b8de8aae9 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -2668,6 +2668,10 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts, Builder.defineMacro("__amd64"); Builder.defineMacro("__x86_64"); Builder.defineMacro("__x86_64__"); + if (getTriple().getArchName() == "x86_64h") { + Builder.defineMacro("__x86_64h"); + Builder.defineMacro("__x86_64h__"); + } } else { DefineStd(Builder, "i386", Opts); } diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c index edf6537700..67ed838e4a 100644 --- a/test/Preprocessor/init.c +++ b/test/Preprocessor/init.c @@ -6230,6 +6230,13 @@ // X86_64:#define __x86_64 1 // X86_64:#define __x86_64__ 1 // +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=x86_64h-none-none < /dev/null | FileCheck -check-prefix X86_64H %s +// +// X86_64H:#define __x86_64 1 +// X86_64H:#define __x86_64__ 1 +// X86_64H:#define __x86_64h 1 +// X86_64H:#define __x86_64h__ 1 + // RUN: %clang_cc1 -E -dM -ffreestanding -triple=x86_64-none-none-gnux32 < /dev/null | FileCheck -check-prefix X32 %s // // X32:#define _ILP32 1