From: Eric Christopher Date: Sat, 25 Mar 2017 19:26:04 +0000 (+0000) Subject: _CALL_LINUX is only defined on 64-bit ppc linux platforms, not 32-bit. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ff19b51066a4384368e28ef5df06f9bd94d3adec;p=clang _CALL_LINUX is only defined on 64-bit ppc linux platforms, not 32-bit. Adjust and add a test for the 32-bit side. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298778 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index a43fb91d44..23ef9f8dd6 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -1238,9 +1238,9 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts, Builder.defineMacro("_CALL_ELF", "2"); // This typically is only for a new enough linker (bfd >= 2.16.2 or gold), but - // our suppport post-dates this and it should work on all linux platforms. It - // is guaranteed to work on all elfv2 platforms. - if (getTriple().getOS() == llvm::Triple::Linux) + // our suppport post-dates this and it should work on all 64-bit ppc linux + // platforms. It is guaranteed to work on all elfv2 platforms. + if (getTriple().getOS() == llvm::Triple::Linux && PointerWidth == 64) Builder.defineMacro("_CALL_LINUX", "1"); // Subtarget options. diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c index 2de3230a6b..d48d476d70 100644 --- a/test/Preprocessor/init.c +++ b/test/Preprocessor/init.c @@ -6747,6 +6747,10 @@ // PPC-LINUX:#define __powerpc__ 1 // PPC-LINUX:#define __ppc__ 1 // +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-unknown-linux-gnu -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC32-LINUX %s +// +// PPC32-LINUX-NOT: _CALL_LINUX +// // RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-apple-darwin8 < /dev/null | FileCheck -match-full-lines -check-prefix PPC-DARWIN %s // // PPC-DARWIN:#define _ARCH_PPC 1