]> granicus.if.org Git - clang/commitdiff
_CALL_LINUX is only defined on 64-bit ppc linux platforms, not 32-bit.
authorEric Christopher <echristo@gmail.com>
Sat, 25 Mar 2017 19:26:04 +0000 (19:26 +0000)
committerEric Christopher <echristo@gmail.com>
Sat, 25 Mar 2017 19:26:04 +0000 (19:26 +0000)
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

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

index a43fb91d4459483a631c483c682d220677cd64dd..23ef9f8dd6bdf27e0887b4e22a4b148bda4f572d 100644 (file)
@@ -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.
index 2de3230a6b60c8630c74f4a75d58242b69918c64..d48d476d700995570fa56601ec4c670c86efa8ce 100644 (file)
 // 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