Skip to content

Commit

Permalink
_CALL_LINUX is only defined on 64-bit ppc linux platforms, not 32-bit.
Browse files Browse the repository at this point in the history
Adjust and add a test for the 32-bit side.

llvm-svn: 298778
  • Loading branch information
echristo committed Mar 25, 2017
1 parent c4e42d2 commit 1e6fedb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clang/lib/Basic/Targets.cpp
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions clang/test/Preprocessor/init.c
Expand Up @@ -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
Expand Down

0 comments on commit 1e6fedb

Please sign in to comment.