]> granicus.if.org Git - clang/commitdiff
Add predefined macros to identify x86_64h architectures.
authorBob Wilson <bob.wilson@apple.com>
Fri, 8 Aug 2014 23:46:28 +0000 (23:46 +0000)
committerBob Wilson <bob.wilson@apple.com>
Fri, 8 Aug 2014 23:46:28 +0000 (23:46 +0000)
Patch by Jim Grosbach.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215260 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp
test/Preprocessor/init.c

index 227fefe174c26eb737cdec400e5a1a51bf4fafa8..2b8de8aae971da9a4d590523665b9b618d1aa214 100644 (file)
@@ -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);
   }
index edf6537700d17461ef58ff7f7a3eff7f5a81b8ef..67ed838e4af38a6e1778dd4014c9c8efb9ad7f81 100644 (file)
 // 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