summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@comstyle.com>2017-04-28 00:36:13 +0000
committerBrad Smith <brad@comstyle.com>2017-04-28 00:36:13 +0000
commit6269fe423728bd1397b717842ad9f343f4567bc9 (patch)
treef0b90f8e021ee8633c463e0308df59e41b57a729
parentba8e6140c330f8304eef8bdb209f2fc4c6041475 (diff)
downloadllvm-6269fe423728bd1397b717842ad9f343f4567bc9.tar.gz
Merging r297098:llvmorg-4.0.1-rc1
------------------------------------------------------------------------ r297098 | brad | 2017-03-06 18:48:31 -0500 (Mon, 06 Mar 2017) | 2 lines Set the Int64Type / IntMaxType types correctly for OpenBSD/mips64 ------------------------------------------------------------------------ llvm-svn: 301605
-rw-r--r--clang/lib/Basic/Targets.cpp6
-rw-r--r--clang/test/Preprocessor/init.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index a8890b7ef869..445b4120ef4d 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -7540,7 +7540,11 @@ public:
void setN64ABITypes() {
setN32N64ABITypes();
- Int64Type = SignedLong;
+ if (getTriple().getOS() == llvm::Triple::OpenBSD) {
+ Int64Type = SignedLongLong;
+ } else {
+ Int64Type = SignedLong;
+ }
IntMaxType = Int64Type;
LongWidth = LongAlign = 64;
PointerWidth = PointerAlign = 64;
diff --git a/clang/test/Preprocessor/init.c b/clang/test/Preprocessor/init.c
index bb545b2e8fdd..df7a8a8548cb 100644
--- a/clang/test/Preprocessor/init.c
+++ b/clang/test/Preprocessor/init.c
@@ -8718,6 +8718,8 @@
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=aarch64-unknown-openbsd6.1 < /dev/null | FileCheck -match-full-lines -check-prefix OPENBSD %s
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm-unknown-openbsd6.1-gnueabi < /dev/null | FileCheck -match-full-lines -check-prefix OPENBSD %s
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-unknown-openbsd6.1 < /dev/null | FileCheck -match-full-lines -check-prefix OPENBSD %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips64-unknown-openbsd6.1 < /dev/null | FileCheck -match-full-lines -check-prefix OPENBSD %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips64el-unknown-openbsd6.1 < /dev/null | FileCheck -match-full-lines -check-prefix OPENBSD %s
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=sparc64-unknown-openbsd6.1 < /dev/null | FileCheck -match-full-lines -check-prefix OPENBSD %s
// OPENBSD:#define __ELF__ 1
// OPENBSD:#define __INT16_TYPE__ short