[cfe-commits] r155632 - in /cfe/trunk: lib/Basic/Targets.cpp test/Preprocessor/init.c
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Thu Apr 26 05:08:09 PDT 2012
Author: eugenis
Date: Thu Apr 26 07:08:09 2012
New Revision: 155632
URL: http://llvm.org/viewvc/llvm-project?rev=155632&view=rev
Log:
Define __ANDROID__ macro on -androideabi targets.
Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/Preprocessor/init.c
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=155632&r1=155631&r2=155632&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Thu Apr 26 07:08:09 2012
@@ -316,6 +316,8 @@
DefineStd(Builder, "linux", Opts);
Builder.defineMacro("__gnu_linux__");
Builder.defineMacro("__ELF__");
+ if (Triple.getEnvironment() == llvm::Triple::ANDROIDEABI)
+ Builder.defineMacro("__ANDROID__", "1");
if (Opts.POSIXThreads)
Builder.defineMacro("_REENTRANT");
if (Opts.CPlusPlus)
Modified: cfe/trunk/test/Preprocessor/init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/init.c?rev=155632&r1=155631&r2=155632&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/init.c (original)
+++ cfe/trunk/test/Preprocessor/init.c Thu Apr 26 07:08:09 2012
@@ -1762,3 +1762,6 @@
// NORTTI: __GXX_ABI_VERSION
// NORTTI-NOT:#define __GXX_RTTI
// NORTTI: __STDC__
+//
+// RUN: %clang_cc1 -triple arm-linux-androideabi -E -dM < /dev/null | FileCheck -check-prefix ANDROID %s
+// ANDROID: __ANDROID__ 1
More information about the cfe-commits
mailing list