]> granicus.if.org Git - clang/commitdiff
Define __LITTLE_ENDIAN__ for le32, since "le" stands for little endian.
authorJan Wen Voung <jvoung@google.com>
Thu, 29 Mar 2012 00:05:59 +0000 (00:05 +0000)
committerJan Wen Voung <jvoung@google.com>
Thu, 29 Mar 2012 00:05:59 +0000 (00:05 +0000)
Add a test for this too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153616 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp
test/Driver/le32-unknown-nacl.cpp

index 73bd2b6789bcc902c7d403ce9e6fd2ee62c0e49f..f05b9c105aa5d5693b49bddddc088c32b47c308e 100644 (file)
@@ -3847,6 +3847,7 @@ public:
     if (Opts.CPlusPlus)
       Builder.defineMacro("_GNU_SOURCE");
 
+    Builder.defineMacro("__LITTLE_ENDIAN__");
     Builder.defineMacro("__native_client__");
     getArchDefines(Opts, Builder);
   }
index 803fac1e2d06b75715b94143fa588eb78f0c9ed4..f68b2206f209d4adfc119f7faf7afeb0b6925560 100644 (file)
@@ -40,6 +40,11 @@ int align_ld = __alignof(long double);
 // CHECK: @align_vl = global i32 4
 int align_vl = __alignof(va_list);
 
+// CHECK: __LITTLE_ENDIAN__defined
+#ifdef __LITTLE_ENDIAN__
+void __LITTLE_ENDIAN__defined() {}
+#endif
+
 // CHECK: __native_client__defined
 #ifdef __native_client__
 void __native_client__defined() {}