r194739 - Makes A Microsoft Layout CodeGen Test Explicit

Warren Hunt whunt at google.com
Thu Nov 14 14:35:00 PST 2013


Author: whunt
Date: Thu Nov 14 16:34:59 2013
New Revision: 194739

URL: http://llvm.org/viewvc/llvm-project?rev=194739&view=rev
Log:
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


Added:
    cfe/trunk/test/CodeGenCXX/microsoft-abi-alignment-fail.cpp
Modified:
    cfe/trunk/test/Layout/ms-x86-size-alignment-fail.cpp

Added: cfe/trunk/test/CodeGenCXX/microsoft-abi-alignment-fail.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-alignment-fail.cpp?rev=194739&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-alignment-fail.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-alignment-fail.cpp Thu Nov 14 16:34:59 2013
@@ -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 }

Modified: cfe/trunk/test/Layout/ms-x86-size-alignment-fail.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Layout/ms-x86-size-alignment-fail.cpp?rev=194739&r1=194738&r2=194739&view=diff
==============================================================================
--- cfe/trunk/test/Layout/ms-x86-size-alignment-fail.cpp (original)
+++ cfe/trunk/test/Layout/ms-x86-size-alignment-fail.cpp Thu Nov 14 16:34:59 2013
@@ -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





More information about the cfe-commits mailing list