aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/class-layout.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-11-22 19:13:51 +0000
committerAnders Carlsson <andersca@mac.com>2009-11-22 19:13:51 +0000
commite4fc0d97420e13d13c9664a3c27c17aa7c1e47b9 (patch)
tree60beeb21c2402d1e0ccab1db42b00b4df82ba6df /test/SemaCXX/class-layout.cpp
parenta7601999342df118f9b9f1acdcf96c0478239638 (diff)
When laying out bitfields, make sure that the data size is always aligned to a byte. This fixes PR5580.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89611 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/class-layout.cpp')
-rw-r--r--test/SemaCXX/class-layout.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/SemaCXX/class-layout.cpp b/test/SemaCXX/class-layout.cpp
index 56f41bfbdb..b5971723a7 100644
--- a/test/SemaCXX/class-layout.cpp
+++ b/test/SemaCXX/class-layout.cpp
@@ -47,3 +47,20 @@ struct G { G(); };
struct H : G { };
SA(6, sizeof(H) == 1);
+
+// PR5580
+namespace PR5580 {
+
+class A { bool iv0 : 1; };
+SA(7, sizeof(A) == 1);
+
+class B : A { bool iv0 : 1; };
+SA(8, sizeof(B) == 2);
+
+struct C { bool iv0 : 1; };
+SA(9, sizeof(C) == 1);
+
+struct D : C { bool iv0 : 1; };
+SA(10, sizeof(D) == 2);
+
+}