[cfe-commits] r138607 - in /cfe/trunk: lib/Basic/Targets.cpp test/Driver/le32-unknown-nacl.cpp
Ivan Krasin
krasin at chromium.org
Thu Aug 25 16:49:20 PDT 2011
Author: krasin
Date: Thu Aug 25 18:49:20 2011
New Revision: 138607
URL: http://llvm.org/viewvc/llvm-project?rev=138607&view=rev
Log:
PNaClTargetInfo: add __ELF__, _REENTRANT and _GNU_SOURCE defines and update the test
Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/Driver/le32-unknown-nacl.cpp
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=138607&r1=138606&r2=138607&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Thu Aug 25 18:49:20 2011
@@ -2870,6 +2870,13 @@
}
virtual void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const {
+ DefineStd(Builder, "unix", Opts);
+ Builder.defineMacro("__ELF__");
+ if (Opts.POSIXThreads)
+ Builder.defineMacro("_REENTRANT");
+ if (Opts.CPlusPlus)
+ Builder.defineMacro("_GNU_SOURCE");
+
Builder.defineMacro("__native_client__");
getArchDefines(Opts, Builder);
}
Modified: cfe/trunk/test/Driver/le32-unknown-nacl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/le32-unknown-nacl.cpp?rev=138607&r1=138606&r2=138607&view=diff
==============================================================================
--- cfe/trunk/test/Driver/le32-unknown-nacl.cpp (original)
+++ cfe/trunk/test/Driver/le32-unknown-nacl.cpp Thu Aug 25 18:49:20 2011
@@ -26,6 +26,25 @@
}
#endif
+#ifdef unix
+void unixdefined() {
+ // CHECK: unixdefined
+}
+#endif
+
+#ifdef __ELF__
+void __ELF__defined() {
+ // CHECK: __ELF__defined
+}
+#endif
+
+#ifdef _GNU_SOURCE
+void _GNU_SOURCEdefined() {
+ // CHECK: _GNU_SOURCEdefined
+}
+#endif
+
+
// Check types
// CHECK: signext i8 @check_char()
More information about the cfe-commits
mailing list