From: Warren Hunt Date: Thu, 14 Nov 2013 22:34:59 +0000 (+0000) Subject: Makes A Microsoft Layout CodeGen Test Explicit X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d2f6c28e5080c7e4a6689618ae7b4048cfbc620;p=clang Makes A Microsoft Layout CodeGen Test Explicit 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 --- diff --git a/test/CodeGenCXX/microsoft-abi-alignment-fail.cpp b/test/CodeGenCXX/microsoft-abi-alignment-fail.cpp new file mode 100644 index 0000000000..7407efed2f --- /dev/null +++ b/test/CodeGenCXX/microsoft-abi-alignment-fail.cpp @@ -0,0 +1,10 @@ +// 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 }> +// CHECK-X64: %struct.A = type { i32*, %struct.B } diff --git a/test/Layout/ms-x86-size-alignment-fail.cpp b/test/Layout/ms-x86-size-alignment-fail.cpp index 5ff440fb9b..f998ee12c8 100644 --- a/test/Layout/ms-x86-size-alignment-fail.cpp +++ b/test/Layout/ms-x86-size-alignment-fail.cpp @@ -8,7 +8,7 @@ extern "C" int printf(const char *fmt, ...); 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