[cfe-commits] r138489 - in /cfe/trunk: lib/Basic/Targets.cpp test/Driver/le32-unknown-nacl.cpp

Ivan Krasin krasin at chromium.org
Wed Aug 24 14:22:25 PDT 2011


Author: krasin
Date: Wed Aug 24 16:22:25 2011
New Revision: 138489

URL: http://llvm.org/viewvc/llvm-project?rev=138489&view=rev
Log:
Follow up to r138470 (Add PNaCl TargetInfo). I've occasionally submitted wrong patch.


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=138489&r1=138488&r2=138489&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Aug 24 16:22:25 2011
@@ -2877,7 +2877,12 @@
                                  unsigned &NumRecords) const {
   }
   virtual const char *getVAListDeclaration() const {
-    return "typedef void* __builtin_va_list;";
+    return "typedef struct __va_list_tag {"
+           "  void* ptr;"
+           "  void* padding1;"
+           "  void* padding2;"
+           "  void* padding3;"
+           "} __builtin_va_list[1];";
   }
   virtual void getGCCRegNames(const char * const *&Names,
                               unsigned &NumNames) const;

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=138489&r1=138488&r2=138489&view=diff
==============================================================================
--- cfe/trunk/test/Driver/le32-unknown-nacl.cpp (original)
+++ cfe/trunk/test/Driver/le32-unknown-nacl.cpp Wed Aug 24 16:22:25 2011
@@ -1,9 +1,7 @@
-// RUN: %clang -ccc-host-triple le32-unknown-nacl -ccc-echo %s -emit-llvm -c -o /tmp/OUTPUTNAME 2> %t.log
+// RUN: %clang -ccc-host-triple le32-unknown-nacl -ccc-echo %s -emit-llvm -c 2>&1 | FileCheck %s -check-prefix=ECHO
+// RUN: %clang -ccc-host-triple le32-unknown-nacl %s -emit-llvm -S -c -o - | FileCheck %s
 
-// Make sure we used clang.
-// RUN: grep 'clang\(-[0-9.]\+\)\?\(\.[Ee][Xx][Ee]\)\?" -cc1 .*le32-unknown-nacl.c' %t.log
-
-// RUN: llvm-dis < /tmp/OUTPUTNAME | FileCheck %s
+// ECHO: clang{{.*}} -cc1 {{.*}}le32-unknown-nacl.c
 
 // Check platform defines
 #include <stddef.h>
@@ -69,13 +67,17 @@
 // CHECK: double @check_double()
 double check_double() { return 0; }
 
+// CHECK: double @check_longdouble()
+long double check_longdouble() { return 0; }
+
 }
 
-// Check that pointers are 32-bit.
+#include <stdarg.h>
 
 template<int> void Switch();
 template<> void Switch<4>();
 template<> void Switch<8>();
+template<> void Switch<16>();
 
 void check_pointer_size() {
   // CHECK: SwitchILi4
@@ -83,4 +85,7 @@
 
   // CHECK: SwitchILi8
   Switch<sizeof(long long)>();
+
+  // CHECK: SwitchILi16
+  Switch<sizeof(va_list)>();
 }





More information about the cfe-commits mailing list