From 3480f0a0cbe752eef297e98f5eac63d994febc90 Mon Sep 17 00:00:00 2001 From: Stuart Hastings Date: Wed, 23 Jun 2010 00:31:14 +0000 Subject: Less incorrect handling of zero-length bitfields. Radars 7992077 and 8093043. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106611 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/FrontendC++/2010-06-22-BitfieldInit.cpp | 20 ++++++++++++++++++++ test/FrontendC++/2010-06-22-ZeroBitfield.cpp | 5 +++++ 2 files changed, 25 insertions(+) create mode 100644 test/FrontendC++/2010-06-22-BitfieldInit.cpp create mode 100644 test/FrontendC++/2010-06-22-ZeroBitfield.cpp (limited to 'test/FrontendC++') diff --git a/test/FrontendC++/2010-06-22-BitfieldInit.cpp b/test/FrontendC++/2010-06-22-BitfieldInit.cpp new file mode 100644 index 0000000..1cfe1f9 --- /dev/null +++ b/test/FrontendC++/2010-06-22-BitfieldInit.cpp @@ -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; } diff --git a/test/FrontendC++/2010-06-22-ZeroBitfield.cpp b/test/FrontendC++/2010-06-22-ZeroBitfield.cpp new file mode 100644 index 0000000..c979f8d --- /dev/null +++ b/test/FrontendC++/2010-06-22-ZeroBitfield.cpp @@ -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(); } -- cgit v1.1