[llvm-commits] [llvm] r106611 - in /llvm/trunk/test/FrontendC++: 2010-06-22-BitfieldInit.cpp 2010-06-22-ZeroBitfield.cpp

Stuart Hastings stuart at apple.com
Tue Jun 22 17:31:14 PDT 2010


Author: stuart
Date: Tue Jun 22 19:31:14 2010
New Revision: 106611

URL: http://llvm.org/viewvc/llvm-project?rev=106611&view=rev
Log:
Less incorrect handling of zero-length bitfields.  Radars 7992077 and 8093043.

Added:
    llvm/trunk/test/FrontendC++/2010-06-22-BitfieldInit.cpp
    llvm/trunk/test/FrontendC++/2010-06-22-ZeroBitfield.cpp

Added: llvm/trunk/test/FrontendC++/2010-06-22-BitfieldInit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2010-06-22-BitfieldInit.cpp?rev=106611&view=auto
==============================================================================
--- llvm/trunk/test/FrontendC++/2010-06-22-BitfieldInit.cpp (added)
+++ llvm/trunk/test/FrontendC++/2010-06-22-BitfieldInit.cpp Tue Jun 22 19:31:14 2010
@@ -0,0 +1,20 @@
+// RUN: %llvmgxx -g -c %s
+struct TEST2
+{
+  int subid:32;
+  int :0;
+};
+
+typedef struct _TEST3
+{
+  TEST2 foo;
+  TEST2 foo2;
+} TEST3;
+
+TEST3 test =
+  {
+    {0},
+    {0}
+  };
+
+int main() { return 0; }

Added: llvm/trunk/test/FrontendC++/2010-06-22-ZeroBitfield.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2010-06-22-ZeroBitfield.cpp?rev=106611&view=auto
==============================================================================
--- llvm/trunk/test/FrontendC++/2010-06-22-ZeroBitfield.cpp (added)
+++ llvm/trunk/test/FrontendC++/2010-06-22-ZeroBitfield.cpp Tue Jun 22 19:31:14 2010
@@ -0,0 +1,5 @@
+// RUN: %llvmgxx -g -c %s
+struct s8_0 { unsigned : 0; };
+struct s8_1 { double x; };
+struct s8 { s8_0 a; s8_1 b; };
+s8 f8() { return s8(); }





More information about the llvm-commits mailing list