This patch tests introduces a proper codegen test in place of the
"codegen no longer crashes" test introduced in r193664. The test is also
moved from layout to CodeGenCXX.
Differential Revision: http://llvm-reviews.chandlerc.com/D2174
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194739
91177308-0d34-0410-b5e6-
96231b3b80d8
--- /dev/null
+// RUN: %clang_cc1 -fno-rtti -emit-llvm -cxx-abi microsoft -triple=i686-pc-win32 -o - %s 2>/dev/null | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm -cxx-abi microsoft -triple=x86_64-pc-win32 -o - %s 2>/dev/null | FileCheck %s -check-prefix CHECK-X64
+
+struct B { char a; };
+struct A : virtual B {} a;
+
+// The <> indicate that the pointer is packed, which is required to support
+// microsoft layout in 32 bit mode, but not 64 bit mode.
+// CHECK: %struct.A = type <{ i32*, %struct.B }>\r
+// CHECK-X64: %struct.A = type { i32*, %struct.B }\r
struct B0 { char a; B0() : a(0xB0) {} };
struct __declspec(align(1)) B1 {};
-struct A : virtual B0 {} b;
+struct A : virtual B0 {};
// CHECK: *** Dumping AST Record Layout
// CHECK: 0 | struct A