Add a missing check in CodeGen of packed classes with vtables. <rdar://problem/11324125>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155689 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/class-layout.cpp b/test/CodeGenCXX/class-layout.cpp
index dac0a0a..21e1a2b 100644
--- a/test/CodeGenCXX/class-layout.cpp
+++ b/test/CodeGenCXX/class-layout.cpp
@@ -77,3 +77,17 @@
class E : public B {};
E *e;
}
+
+// <rdar://problem/11324125>: Make sure this doesn't crash. (It's okay
+// if we start rejecting it at some point.)
+namespace Test7 {
+ #pragma pack (1)
+ class A {};
+ // CHECK: %"class.Test7::B" = type <{ i32 (...)**, %"class.Test7::A" }>
+ class B {
+ virtual ~B();
+ A a;
+ };
+ B* b;
+ #pragma pack ()
+}