diff options
author | Warren Hunt <whunt@google.com> | 2013-10-23 23:53:07 +0000 |
---|---|---|
committer | Warren Hunt <whunt@google.com> | 2013-10-23 23:53:07 +0000 |
commit | 55d8e82f861c4b183eed1593aac8bb29a3c1e621 (patch) | |
tree | 84f99803be4c467176c26baa512b99f8fca288bb /clang/test/Layout/ms-x86-size-alignment-fail.cpp | |
parent | 79bb2663462da06e8ed5ed482238b9416cf81880 (diff) | |
download | llvm-55d8e82f861c4b183eed1593aac8bb29a3c1e621.tar.gz |
Implements 64 bit microsoft record layout and adds lit tests to cover
it. Also removes all of the microsoft C++ ABI related code from the
itanium layout builder.
Differential Revision: http://llvm-reviews.chandlerc.com/D2003
llvm-svn: 193290
Diffstat (limited to 'clang/test/Layout/ms-x86-size-alignment-fail.cpp')
-rw-r--r-- | clang/test/Layout/ms-x86-size-alignment-fail.cpp | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/clang/test/Layout/ms-x86-size-alignment-fail.cpp b/clang/test/Layout/ms-x86-size-alignment-fail.cpp index 6ce8a4b7203a..bb0baa41dc49 100644 --- a/clang/test/Layout/ms-x86-size-alignment-fail.cpp +++ b/clang/test/Layout/ms-x86-size-alignment-fail.cpp @@ -1,5 +1,7 @@ -// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>&1 \ +// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \ // RUN: | FileCheck %s +// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \ +// RUN: | FileCheck %s -check-prefix CHECK-X64 extern "C" int printf(const char *fmt, ...); @@ -15,6 +17,13 @@ struct A : virtual B0 {}; // CHECK: 4 | char a // CHECK: | [sizeof=5, align=4 // CHECK: | nvsize=4, nvalign=4] +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: 0 | struct A +// CHECK-X64: 0 | (A vbtable pointer) +// CHECK-X64: 8 | struct B0 (virtual base) +// CHECK-X64: 8 | char a +// CHECK-X64: | [sizeof=16, align=8 +// CHECK-X64: | nvsize=8, nvalign=8] struct __declspec(align(1)) B : virtual B0 {}; @@ -25,6 +34,13 @@ struct __declspec(align(1)) B : virtual B0 {}; // CHECK: 4 | char a // CHECK: | [sizeof=8, align=4 // CHECK: | nvsize=4, nvalign=4] +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: 0 | struct B +// CHECK-X64: 0 | (B vbtable pointer) +// CHECK-X64: 8 | struct B0 (virtual base) +// CHECK-X64: 8 | char a +// CHECK-X64: | [sizeof=16, align=8 +// CHECK-X64: | nvsize=8, nvalign=8] struct C : virtual B0 { int a; C() : a(0xC) {} }; @@ -36,6 +52,14 @@ struct C : virtual B0 { int a; C() : a(0xC) {} }; // CHECK: 8 | char a // CHECK: | [sizeof=9, align=4 // CHECK: | nvsize=8, nvalign=4] +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: 0 | struct C +// CHECK-X64: 0 | (C vbtable pointer) +// CHECK-X64: 8 | int a +// CHECK-X64: 16 | struct B0 (virtual base) +// CHECK-X64: 16 | char a +// CHECK-X64: | [sizeof=24, align=8 +// CHECK-X64: | nvsize=16, nvalign=8] struct D : virtual B0 { __declspec(align(1)) int a; D() : a(0xD) {} }; @@ -47,6 +71,14 @@ struct D : virtual B0 { __declspec(align(1)) int a; D() : a(0xD) {} }; // CHECK: 8 | char a // CHECK: | [sizeof=12, align=4 // CHECK: | nvsize=8, nvalign=4] +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: 0 | struct D +// CHECK-X64: 0 | (D vbtable pointer) +// CHECK-X64: 8 | int a +// CHECK-X64: 16 | struct B0 (virtual base) +// CHECK-X64: 16 | char a +// CHECK-X64: | [sizeof=24, align=8 +// CHECK-X64: | nvsize=16, nvalign=8] struct E : virtual B0, virtual B1 {}; @@ -58,6 +90,14 @@ struct E : virtual B0, virtual B1 {}; // CHECK: 5 | struct B1 (virtual base) (empty) // CHECK: | [sizeof=8, align=4 // CHECK: | nvsize=4, nvalign=4] +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: 0 | struct E +// CHECK-X64: 0 | (E vbtable pointer) +// CHECK-X64: 8 | struct B0 (virtual base) +// CHECK-X64: 8 | char a +// CHECK-X64: 9 | struct B1 (virtual base) (empty) +// CHECK-X64: | [sizeof=16, align=8 +// CHECK-X64: | nvsize=8, nvalign=8] struct F { char a; virtual ~F(); }; @@ -67,6 +107,12 @@ struct F { char a; virtual ~F(); }; // CHECK: 4 | char a // CHECK: | [sizeof=8, align=4 // CHECK: | nvsize=8, nvalign=4] +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: 0 | struct F +// CHECK-X64: 0 | (F vftable pointer) +// CHECK-X64: 8 | char a +// CHECK-X64: | [sizeof=16, align=8 +// CHECK-X64: | nvsize=16, nvalign=8] int a[ sizeof(A)+ |