From c3ef9530ae9385b40af1ebfd70350049fb7234e9 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Mon, 6 Mar 2017 23:48:31 +0000 Subject: [PATCH] Set the Int64Type / IntMaxType types correctly for OpenBSD/mips64 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297098 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Basic/Targets.cpp | 6 +++++- test/Preprocessor/init.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 3616baf61e..95321ec381 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -7578,7 +7578,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/test/Preprocessor/init.c b/test/Preprocessor/init.c index 2ca05ae7c5..cae6aa042b 100644 --- a/test/Preprocessor/init.c +++ b/test/Preprocessor/init.c @@ -8766,6 +8766,8 @@ // 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=powerpc-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 -- 2.40.0