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-alias-avoidance-padding.cpp | |
parent | 42d71b990677afc974c404fb0482cb5af176c3d0 (diff) | |
download | llvm-bb9c3c33e94f3e5a17990b7a8ab9d076d0c7e594.tar.gz |
[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-alias-avoidance-padding.cpp')
-rw-r--r-- | clang/test/Layout/ms-x86-alias-avoidance-padding.cpp | 216 |
1 files changed, 108 insertions, 108 deletions
diff --git a/clang/test/Layout/ms-x86-alias-avoidance-padding.cpp b/clang/test/Layout/ms-x86-alias-avoidance-padding.cpp index 94ed031734c9..7a78f8732ca3 100644 --- a/clang/test/Layout/ms-x86-alias-avoidance-padding.cpp +++ b/clang/test/Layout/ms-x86-alias-avoidance-padding.cpp @@ -327,19 +327,19 @@ struct RZ0 : RX0, RY {}; // CHECK-NEXT: 2 | struct RY (base) (empty) // CHECK-NEXT: | [sizeof=2, align=1 // CHECK-NEXT: | nvsize=2, nvalign=1] -// 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: *** Dumping AST Record Layout
-// CHECK-X64-NEXT: 0 | struct RZ0
-// CHECK-X64-NEXT: 0 | struct RX0 (base)
-// CHECK-X64-NEXT: 0 | struct RB (base)
-// CHECK-X64-NEXT: 0 | char c
-// CHECK-X64-NEXT: 1 | struct RA (base) (empty)
-// CHECK-X64-NEXT: 2 | struct RY (base) (empty)
-// CHECK-X64-NEXT: | [sizeof=2, align=1
-// CHECK-X64-NEXT: | nvsize=2, nvalign=1]
+// 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: *** Dumping AST Record Layout +// CHECK-X64-NEXT: 0 | struct RZ0 +// CHECK-X64-NEXT: 0 | struct RX0 (base) +// CHECK-X64-NEXT: 0 | struct RB (base) +// CHECK-X64-NEXT: 0 | char c +// CHECK-X64-NEXT: 1 | struct RA (base) (empty) +// CHECK-X64-NEXT: 2 | struct RY (base) (empty) +// CHECK-X64-NEXT: | [sizeof=2, align=1 +// CHECK-X64-NEXT: | nvsize=2, nvalign=1] struct RZ1 : RX1, RY {}; // CHECK: *** Dumping AST Record Layout @@ -352,16 +352,16 @@ struct RZ1 : RX1, RY {}; // CHECK-NEXT: 1 | struct RY (base) (empty) // CHECK-NEXT: | [sizeof=1, align=1 // CHECK-NEXT: | nvsize=1, nvalign=1] -// CHECK-X64: *** Dumping AST Record Layout
-// CHECK-X64: *** Dumping AST Record Layout
-// CHECK-X64-NEXT: 0 | struct RZ1
-// CHECK-X64-NEXT: 0 | struct RX1 (base)
-// CHECK-X64-NEXT: 0 | struct RA (base) (empty)
-// CHECK-X64-NEXT: 0 | struct RB (base)
-// CHECK-X64-NEXT: 0 | char c
-// CHECK-X64-NEXT: 1 | struct RY (base) (empty)
-// CHECK-X64-NEXT: | [sizeof=1, align=1
-// CHECK-X64-NEXT: | nvsize=1, nvalign=1]
+// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64-NEXT: 0 | struct RZ1 +// CHECK-X64-NEXT: 0 | struct RX1 (base) +// CHECK-X64-NEXT: 0 | struct RA (base) (empty) +// CHECK-X64-NEXT: 0 | struct RB (base) +// CHECK-X64-NEXT: 0 | char c +// CHECK-X64-NEXT: 1 | struct RY (base) (empty) +// CHECK-X64-NEXT: | [sizeof=1, align=1 +// CHECK-X64-NEXT: | nvsize=1, nvalign=1] struct RZ2 : RX2, RY {}; // CHECK: *** Dumping AST Record Layout @@ -373,15 +373,15 @@ struct RZ2 : RX2, RY {}; // CHECK-NEXT: 2 | struct RY (base) (empty) // CHECK-NEXT: | [sizeof=2, align=1 // CHECK-NEXT: | nvsize=2, nvalign=1] -// CHECK-X64: *** Dumping AST Record Layout
-// CHECK-X64: *** Dumping AST Record Layout
-// CHECK-X64-NEXT: 0 | struct RZ2
-// CHECK-X64-NEXT: 0 | struct RX2 (base)
-// CHECK-X64-NEXT: 0 | struct RA (base) (empty)
-// CHECK-X64-NEXT: 0 | char a
-// CHECK-X64-NEXT: 2 | struct RY (base) (empty)
-// CHECK-X64-NEXT: | [sizeof=2, align=1
-// CHECK-X64-NEXT: | nvsize=2, nvalign=1]
+// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64-NEXT: 0 | struct RZ2 +// CHECK-X64-NEXT: 0 | struct RX2 (base) +// CHECK-X64-NEXT: 0 | struct RA (base) (empty) +// CHECK-X64-NEXT: 0 | char a +// CHECK-X64-NEXT: 2 | struct RY (base) (empty) +// CHECK-X64-NEXT: | [sizeof=2, align=1 +// CHECK-X64-NEXT: | nvsize=2, nvalign=1] struct RZ3 : RX3, RY {}; // CHECK: *** Dumping AST Record Layout @@ -396,18 +396,18 @@ struct RZ3 : RX3, RY {}; // CHECK-NEXT: 1 | struct RY (base) (empty) // CHECK-NEXT: | [sizeof=1, align=1 // CHECK-NEXT: | nvsize=1, nvalign=1] -// CHECK-X64: *** Dumping AST Record Layout
-// CHECK-X64: *** Dumping AST Record Layout
-// CHECK-X64-NEXT: 0 | struct RZ3
-// CHECK-X64-NEXT: 0 | struct RX3 (base)
-// CHECK-X64-NEXT: 0 | struct RA (base) (empty)
-// CHECK-X64-NEXT: 0 | struct RB a
-// CHECK-X64-NEXT: 0 | char c
-// CHECK-X64-NEXT: | [sizeof=1, align=1
-// CHECK-X64-NEXT: | nvsize=1, nvalign=1]
-// CHECK-X64-NEXT: 1 | struct RY (base) (empty)
-// CHECK-X64-NEXT: | [sizeof=1, align=1
-// CHECK-X64-NEXT: | nvsize=1, nvalign=1]
+// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64-NEXT: 0 | struct RZ3 +// CHECK-X64-NEXT: 0 | struct RX3 (base) +// CHECK-X64-NEXT: 0 | struct RA (base) (empty) +// CHECK-X64-NEXT: 0 | struct RB a +// CHECK-X64-NEXT: 0 | char c +// CHECK-X64-NEXT: | [sizeof=1, align=1 +// CHECK-X64-NEXT: | nvsize=1, nvalign=1] +// CHECK-X64-NEXT: 1 | struct RY (base) (empty) +// CHECK-X64-NEXT: | [sizeof=1, align=1 +// CHECK-X64-NEXT: | nvsize=1, nvalign=1] struct RZ4 : RX4, RY {}; // CHECK: *** Dumping AST Record Layout @@ -421,17 +421,17 @@ struct RZ4 : RX4, RY {}; // CHECK-NEXT: 3 | struct RY (base) (empty) // CHECK-NEXT: | [sizeof=3, align=1 // CHECK-NEXT: | nvsize=3, nvalign=1] -// CHECK-X64: *** Dumping AST Record Layout
-// CHECK-X64: *** Dumping AST Record Layout
-// CHECK-X64-NEXT: 0 | struct RZ4
-// CHECK-X64-NEXT: 0 | struct RX4 (base)
-// CHECK-X64-NEXT: 0 | struct RA a (empty)
-// CHECK-X64-NEXT: | [sizeof=1, align=1
-// CHECK-X64-NEXT: | nvsize=0, nvalign=1]
-// CHECK-X64-NEXT: 1 | char b
-// CHECK-X64-NEXT: 3 | struct RY (base) (empty)
-// CHECK-X64-NEXT: | [sizeof=3, align=1
-// CHECK-X64-NEXT: | nvsize=3, nvalign=1]
+// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64-NEXT: 0 | struct RZ4 +// CHECK-X64-NEXT: 0 | struct RX4 (base) +// CHECK-X64-NEXT: 0 | struct RA a (empty) +// CHECK-X64-NEXT: | [sizeof=1, align=1 +// CHECK-X64-NEXT: | nvsize=0, nvalign=1] +// CHECK-X64-NEXT: 1 | char b +// CHECK-X64-NEXT: 3 | struct RY (base) (empty) +// CHECK-X64-NEXT: | [sizeof=3, align=1 +// CHECK-X64-NEXT: | nvsize=3, nvalign=1] struct RZ5 : RX5, RY {}; // CHECK: *** Dumping AST Record Layout @@ -448,20 +448,20 @@ struct RZ5 : RX5, RY {}; // CHECK-NEXT: 2 | struct RY (base) (empty) // CHECK-NEXT: | [sizeof=2, align=1 // CHECK-NEXT: | nvsize=2, nvalign=1] -// CHECK-X64: *** Dumping AST Record Layout
-// CHECK-X64: *** Dumping AST Record Layout
-// CHECK-X64-NEXT: 0 | struct RZ5
-// CHECK-X64-NEXT: 0 | struct RX5 (base)
-// CHECK-X64-NEXT: 0 | struct RA a (empty)
-// CHECK-X64-NEXT: | [sizeof=1, align=1
-// CHECK-X64-NEXT: | nvsize=0, nvalign=1]
-// CHECK-X64-NEXT: 1 | struct RB b
-// CHECK-X64-NEXT: 1 | char c
-// CHECK-X64-NEXT: | [sizeof=1, align=1
-// CHECK-X64-NEXT: | nvsize=1, nvalign=1]
-// CHECK-X64-NEXT: 2 | struct RY (base) (empty)
-// CHECK-X64-NEXT: | [sizeof=2, align=1
-// CHECK-X64-NEXT: | nvsize=2, nvalign=1]
+// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64-NEXT: 0 | struct RZ5 +// CHECK-X64-NEXT: 0 | struct RX5 (base) +// CHECK-X64-NEXT: 0 | struct RA a (empty) +// CHECK-X64-NEXT: | [sizeof=1, align=1 +// CHECK-X64-NEXT: | nvsize=0, nvalign=1] +// CHECK-X64-NEXT: 1 | struct RB b +// CHECK-X64-NEXT: 1 | char c +// CHECK-X64-NEXT: | [sizeof=1, align=1 +// CHECK-X64-NEXT: | nvsize=1, nvalign=1] +// CHECK-X64-NEXT: 2 | struct RY (base) (empty) +// CHECK-X64-NEXT: | [sizeof=2, align=1 +// CHECK-X64-NEXT: | nvsize=2, nvalign=1] struct RZ6 : RX6, RY {}; // CHECK: *** Dumping AST Record Layout @@ -478,20 +478,20 @@ struct RZ6 : RX6, RY {}; // CHECK-NEXT: 12 | struct RV (virtual base) (empty) // CHECK-NEXT: | [sizeof=12, align=4 // CHECK-NEXT: | nvsize=12, nvalign=4] -// CHECK-X64: *** Dumping AST Record Layout
-// CHECK-X64: *** Dumping AST Record Layout
-// CHECK-X64: *** Dumping AST Record Layout
-// CHECK-X64-NEXT: 0 | struct RZ6
-// CHECK-X64-NEXT: 0 | struct RX6 (base)
-// CHECK-X64-NEXT: 0 | (RX6 vbtable pointer)
-// CHECK-X64-NEXT: 8 | struct RB a
-// CHECK-X64-NEXT: 8 | char c
-// CHECK-X64-NEXT: | [sizeof=1, align=1
-// CHECK-X64-NEXT: | nvsize=1, nvalign=1]
-// CHECK-X64-NEXT: 17 | struct RY (base) (empty)
-// CHECK-X64-NEXT: 24 | struct RV (virtual base) (empty)
-// CHECK-X64-NEXT: | [sizeof=24, align=8
-// CHECK-X64-NEXT: | nvsize=24, nvalign=8]
+// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64-NEXT: 0 | struct RZ6 +// CHECK-X64-NEXT: 0 | struct RX6 (base) +// CHECK-X64-NEXT: 0 | (RX6 vbtable pointer) +// CHECK-X64-NEXT: 8 | struct RB a +// CHECK-X64-NEXT: 8 | char c +// CHECK-X64-NEXT: | [sizeof=1, align=1 +// CHECK-X64-NEXT: | nvsize=1, nvalign=1] +// CHECK-X64-NEXT: 17 | struct RY (base) (empty) +// CHECK-X64-NEXT: 24 | struct RV (virtual base) (empty) +// CHECK-X64-NEXT: | [sizeof=24, align=8 +// CHECK-X64-NEXT: | nvsize=24, nvalign=8] struct RZ7 : RX7, RY {}; // CHECK: *** Dumping AST Record Layout @@ -508,20 +508,20 @@ struct RZ7 : RX7, RY {}; // CHECK-NEXT: 8 | char c // CHECK-NEXT: | [sizeof=9, align=4 // CHECK-NEXT: | nvsize=8, nvalign=4] -// CHECK-X64: *** Dumping AST Record Layout
-// CHECK-X64: *** Dumping AST Record Layout
-// CHECK-X64: *** Dumping AST Record Layout
-// CHECK-X64-NEXT: 0 | struct RZ7
-// CHECK-X64-NEXT: 0 | struct RX7 (base)
-// CHECK-X64-NEXT: 0 | (RX7 vbtable pointer)
-// CHECK-X64-NEXT: 8 | struct RA a (empty)
-// CHECK-X64-NEXT: | [sizeof=1, align=1
-// CHECK-X64-NEXT: | nvsize=0, nvalign=1]
-// CHECK-X64-NEXT: 16 | struct RY (base) (empty)
-// CHECK-X64-NEXT: 16 | struct RW (virtual base)
-// CHECK-X64-NEXT: 16 | char c
-// CHECK-X64-NEXT: | [sizeof=24, align=8
-// CHECK-X64-NEXT: | nvsize=16, nvalign=8]
+// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64-NEXT: 0 | struct RZ7 +// CHECK-X64-NEXT: 0 | struct RX7 (base) +// CHECK-X64-NEXT: 0 | (RX7 vbtable pointer) +// CHECK-X64-NEXT: 8 | struct RA a (empty) +// CHECK-X64-NEXT: | [sizeof=1, align=1 +// CHECK-X64-NEXT: | nvsize=0, nvalign=1] +// CHECK-X64-NEXT: 16 | struct RY (base) (empty) +// CHECK-X64-NEXT: 16 | struct RW (virtual base) +// CHECK-X64-NEXT: 16 | char c +// CHECK-X64-NEXT: | [sizeof=24, align=8 +// CHECK-X64-NEXT: | nvsize=16, nvalign=8] struct RZ8 : RX8, RY {}; // CHECK: *** Dumping AST Record Layout @@ -535,17 +535,17 @@ struct RZ8 : RX8, RY {}; // CHECK-NEXT: 4 | char c // CHECK-NEXT: | [sizeof=5, align=4 // CHECK-NEXT: | nvsize=4, nvalign=4] -// CHECK-X64: *** Dumping AST Record Layout
-// CHECK-X64: *** Dumping AST Record Layout
-// CHECK-X64-NEXT: 0 | struct RZ8
-// CHECK-X64-NEXT: 0 | struct RX8 (base)
-// CHECK-X64-NEXT: 8 | struct RA (base) (empty)
-// CHECK-X64-NEXT: 0 | (RX8 vbtable pointer)
-// CHECK-X64-NEXT: 8 | struct RY (base) (empty)
-// CHECK-X64-NEXT: 8 | struct RW (virtual base)
-// CHECK-X64-NEXT: 8 | char c
-// CHECK-X64-NEXT: | [sizeof=16, align=8
-// CHECK-X64-NEXT: | nvsize=8, nvalign=8]
+// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64: *** Dumping AST Record Layout +// CHECK-X64-NEXT: 0 | struct RZ8 +// CHECK-X64-NEXT: 0 | struct RX8 (base) +// CHECK-X64-NEXT: 8 | struct RA (base) (empty) +// CHECK-X64-NEXT: 0 | (RX8 vbtable pointer) +// CHECK-X64-NEXT: 8 | struct RY (base) (empty) +// CHECK-X64-NEXT: 8 | struct RW (virtual base) +// CHECK-X64-NEXT: 8 | char c +// CHECK-X64-NEXT: | [sizeof=16, align=8 +// CHECK-X64-NEXT: | nvsize=8, nvalign=8] |