diff options
author | Warren Hunt <whunt@google.com> | 2014-04-10 23:23:34 +0000 |
---|---|---|
committer | Warren Hunt <whunt@google.com> | 2014-04-10 23:23:34 +0000 |
commit | bb9c3c33e94f3e5a17990b7a8ab9d076d0c7e594 (patch) | |
tree | dff6dd016a24937cd5330b91855a8b4da41c743b /clang/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp | |
parent | 42d71b990677afc974c404fb0482cb5af176c3d0 (diff) | |
download | bcm5719-llvm-bb9c3c33e94f3e5a17990b7a8ab9d076d0c7e594.tar.gz bcm5719-llvm-bb9c3c33e94f3e5a17990b7a8ab9d076d0c7e594.zip |
[MS-ABI] Fix to vbptr injection site calculation.
The vbptr is injected after the last non-virtual base lexographically
rather than the last non-virtual base in layout order. Test case
included. Also, some line ending fixes.
llvm-svn: 206000
Diffstat (limited to 'clang/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp')
-rw-r--r-- | clang/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/clang/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp b/clang/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp index 5bea872ae11..34ae0cf9dde 100644 --- a/clang/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp +++ b/clang/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp @@ -766,6 +766,45 @@ struct C2 : public C1, public C0 {}; // CHECK-X64-NEXT: | [sizeof=8, align=4 // CHECK-X64-NEXT: | nvsize=8, nvalign=4] +struct JA { char a; }; +struct JB { + char a; + virtual void f() {} +}; +struct JC { char a; }; +struct JD : JA, JB, virtual JC {}; + +// CHECK: *** Dumping AST Record Layout +// CHECK: *** Dumping AST Record Layout +// CHECK: *** Dumping AST Record Layout +// CHECK: *** Dumping AST Record Layout +// CHECK-NEXT: 0 | struct JD +// CHECK-NEXT: 0 | struct JB (primary base) +// CHECK-NEXT: 0 | (JB vftable pointer) +// CHECK-NEXT: 4 | char a +// CHECK-NEXT: 12 | struct JA (base) +// CHECK-NEXT: 12 | char a +// CHECK-NEXT: 8 | (JD vbtable pointer) +// CHECK-NEXT: 16 | struct JC (virtual base) +// CHECK-NEXT: 16 | char a +// CHECK-NEXT: | [sizeof=17, align=4 +// CHECK-NEXT: | nvsize=16, nvalign=4] +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64-NEXT: 0 | struct JD +// CHECK-X64-NEXT: 0 | struct JB (primary base) +// CHECK-X64-NEXT: 0 | (JB vftable pointer) +// CHECK-X64-NEXT: 8 | char a +// CHECK-X64-NEXT: 24 | struct JA (base) +// CHECK-X64-NEXT: 24 | char a +// CHECK-X64-NEXT: 16 | (JD vbtable pointer) +// CHECK-X64-NEXT: 32 | struct JC (virtual base) +// CHECK-X64-NEXT: 32 | char a +// CHECK-X64-NEXT: | [sizeof=40, align=8 +// CHECK-X64-NEXT: | nvsize=32, nvalign=8] + int a[ sizeof(AA)+ sizeof(AB)+ @@ -793,4 +832,6 @@ sizeof(AX)+ sizeof(BX)+ sizeof(CX)+ sizeof(DX)+ -sizeof(C2)]; +sizeof(C2)+ +sizeof(JD)+ +0]; |