Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -O0 -S %s -o %t-64.s && |
Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame] | 2 | // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s && |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 3 | // RUN: clang-cc -triple i386-apple-darwin -std=c++0x -O0 -S %s -o %t-32.s && |
Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame] | 4 | // RUN: FileCheck -check-prefix LP32 -input-file=%t-32.s %s && |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 5 | |
| 6 | // RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -O3 -S %s -o %t-O3-64.s && |
| 7 | // RUN: FileCheck -check-prefix LPOPT64 --input-file=%t-O3-64.s %s && |
| 8 | // RUN: clang-cc -triple i386-apple-darwin -std=c++0x -O3 -S %s -o %t-O3-32.s && |
| 9 | // RUN: FileCheck -check-prefix LPOPT32 -input-file=%t-O3-32.s %s && |
| 10 | |
Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame] | 11 | // RUN: true |
Mike Stump | 3dee6ef | 2009-07-30 00:22:38 +0000 | [diff] [blame] | 12 | |
Mike Stump | 104ffaa | 2009-08-04 21:58:42 +0000 | [diff] [blame] | 13 | struct B { |
| 14 | virtual void bar1(); |
| 15 | virtual void bar2(); |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 16 | int b; |
Mike Stump | 104ffaa | 2009-08-04 21:58:42 +0000 | [diff] [blame] | 17 | }; |
Mike Stump | 6f37633 | 2009-08-05 22:37:18 +0000 | [diff] [blame] | 18 | void B::bar1() { } |
| 19 | void B::bar2() { } |
| 20 | |
| 21 | struct C { |
| 22 | virtual void bee1(); |
| 23 | virtual void bee2(); |
| 24 | }; |
| 25 | void C::bee1() { } |
| 26 | void C::bee2() { } |
Mike Stump | 104ffaa | 2009-08-04 21:58:42 +0000 | [diff] [blame] | 27 | |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 28 | struct D { |
| 29 | virtual void boo(); |
| 30 | }; |
| 31 | void D::boo() { } |
Mike Stump | 104ffaa | 2009-08-04 21:58:42 +0000 | [diff] [blame] | 32 | |
Mike Stump | c5708d9 | 2009-08-06 14:12:47 +0000 | [diff] [blame] | 33 | struct D1 { |
| 34 | virtual void bar(); |
Mike Stump | 02cf1e2 | 2009-08-06 23:48:32 +0000 | [diff] [blame] | 35 | virtual void bar2(); |
| 36 | virtual void bar3(); |
| 37 | virtual void bar4(); |
| 38 | virtual void bar5(); |
Mike Stump | c5708d9 | 2009-08-06 14:12:47 +0000 | [diff] [blame] | 39 | void *d1; |
| 40 | }; |
| 41 | void D1::bar() { } |
| 42 | |
| 43 | class F : virtual public D1, virtual public D { |
| 44 | public: |
| 45 | virtual void foo(); |
| 46 | void *f; |
| 47 | }; |
| 48 | void F::foo() { } |
| 49 | |
| 50 | int j; |
| 51 | void test2() { |
| 52 | F f; |
| 53 | static int sz = (char *)(&f.f) - (char *)(&f); |
| 54 | j = sz; |
Mike Stump | 37148f4 | 2009-08-06 14:16:19 +0000 | [diff] [blame] | 55 | // FIXME: These should result in a frontend constant a la fold, no run time |
| 56 | // initializer |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 57 | // CHECK-LPOPT32: movl $4, __ZZ5test2vE2sz |
| 58 | // CHECK-LPOPT64: movl $8, __ZZ5test2vE2sz(%rip) |
Mike Stump | c5708d9 | 2009-08-06 14:12:47 +0000 | [diff] [blame] | 59 | } |
Mike Stump | 8a12b56 | 2009-08-06 15:50:11 +0000 | [diff] [blame] | 60 | |
Mike Stump | c5708d9 | 2009-08-06 14:12:47 +0000 | [diff] [blame] | 61 | static_assert(sizeof(F) == sizeof(void*)*4, "invalid vbase size"); |
| 62 | |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 63 | struct E { |
| 64 | int e; |
| 65 | }; |
| 66 | |
| 67 | static_assert (sizeof (C) == (sizeof(void *)), "vtable pointer layout"); |
| 68 | |
Mike Stump | eb19fa9 | 2009-08-06 13:41:24 +0000 | [diff] [blame] | 69 | class A : public E, public B, public C { |
Mike Stump | 3dee6ef | 2009-07-30 00:22:38 +0000 | [diff] [blame] | 70 | public: |
Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame] | 71 | virtual void foo1(); |
| 72 | virtual void foo2(); |
| 73 | A() { } |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 74 | int a; |
| 75 | } *ap; |
Mike Stump | 6f37633 | 2009-08-05 22:37:18 +0000 | [diff] [blame] | 76 | void A::foo1() { } |
| 77 | void A::foo2() { } |
Mike Stump | 3dee6ef | 2009-07-30 00:22:38 +0000 | [diff] [blame] | 78 | |
Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame] | 79 | int main() { |
| 80 | A a; |
Mike Stump | 26899b0 | 2009-08-05 22:48:36 +0000 | [diff] [blame] | 81 | B b; |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 82 | ap->e = 1; |
| 83 | ap->b = 2; |
Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame] | 84 | } |
| 85 | |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 86 | // CHECK-LP32: main: |
| 87 | // CHECK-LP32: movl $1, 8(%eax) |
| 88 | // CHECK-LP32: movl $2, 4(%eax) |
| 89 | |
| 90 | // CHECK-LP64: main: |
| 91 | // CHECK-LP64: movl $1, 12(%rax) |
| 92 | // CHECK-LP64: movl $2, 8(%rax) |
| 93 | |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 94 | |
Mike Stump | 94d0bce | 2009-08-13 00:34:14 +0000 | [diff] [blame] | 95 | struct test6_B2 { virtual void funcB2(); char b[1000]; }; |
| 96 | struct test6_B1 : virtual test6_B2 { virtual void funcB1(); }; |
| 97 | |
| 98 | struct test6_D : test6_B2, virtual test6_B1 { |
| 99 | }; |
| 100 | |
| 101 | // CEHCK-LP32: .zerofill __DATA, __common, _d6, 2012, 4 |
| 102 | // CHECK-LP64: .zerofill __DATA, __common, _d6, 2024, 4 |
| 103 | |
Mike Stump | 7884678 | 2009-08-13 23:33:29 +0000 | [diff] [blame] | 104 | struct test7_B2 { virtual void funcB2(); }; |
| 105 | struct test7_B1 : virtual test7_B2 { virtual void funcB1(); }; |
| 106 | |
| 107 | struct test7_D : test7_B2, virtual test7_B1 { |
| 108 | }; |
| 109 | |
| 110 | // CEHCK-LP32: .zerofill __DATA, __common, _d7, 8, 3 |
| 111 | // CHECK-LP64: .zerofill __DATA, __common, _d7, 16, 3 |
Mike Stump | 94d0bce | 2009-08-13 00:34:14 +0000 | [diff] [blame] | 112 | |
| 113 | |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 114 | struct test3_B3 { virtual void funcB3(); }; |
| 115 | struct test3_B2 : virtual test3_B3 { virtual void funcB2(); }; |
| 116 | struct test3_B1 : virtual test3_B2 { virtual void funcB1(); }; |
| 117 | |
| 118 | struct test3_D : virtual test3_B1 { |
| 119 | virtual void funcD() { } |
| 120 | }; |
| 121 | |
| 122 | // CHECK-LP32:__ZTV7test3_D: |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 123 | // CHECK-LP32-NEXT: .space 4 |
| 124 | // CHECK-LP32-NEXT: .space 4 |
| 125 | // CHECK-LP32-NEXT: .space 4 |
| 126 | // CHECK-LP32-NEXT: .space 4 |
| 127 | // CHECK-LP32-NEXT: .space 4 |
| 128 | // CHECK-LP32-NEXT: .space 4 |
| 129 | // CHECK-LP32-NEXT: .space 4 |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 130 | // CHECK-LP32: .long __ZTI7test3_D |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 131 | // CHECK-LP32-NEXT: .long __ZN8test3_B36funcB3Ev |
| 132 | // CHECK-LP32-NEXT: .long __ZN8test3_B26funcB2Ev |
| 133 | // CHECK-LP32-NEXT: .long __ZN8test3_B16funcB1Ev |
| 134 | // CHECK-LP32-NEXT: .long __ZN7test3_D5funcDEv |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 135 | |
| 136 | // CHECK-LP64:__ZTV7test3_D: |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 137 | // CHECK-LP64-NEXT: .space 8 |
| 138 | // CHECK-LP64-NEXT: .space 8 |
| 139 | // CHECK-LP64-NEXT: .space 8 |
| 140 | // CHECK-LP64-NEXT: .space 8 |
| 141 | // CHECK-LP64-NEXT: .space 8 |
| 142 | // CHECK-LP64-NEXT: .space 8 |
| 143 | // CHECK-LP64-NEXT: .space 8 |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 144 | // CHECK-LP64: .quad __ZTI7test3_D |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 145 | // CHECK-LP64-NEXT: .quad __ZN8test3_B36funcB3Ev |
| 146 | // CHECK-LP64-NEXT: .quad __ZN8test3_B26funcB2Ev |
| 147 | // CHECK-LP64-NEXT: .quad __ZN8test3_B16funcB1Ev |
| 148 | // CHECK-LP64-NEXT: .quad __ZN7test3_D5funcDEv |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 149 | |
Mike Stump | 34fae9c | 2009-08-12 18:50:26 +0000 | [diff] [blame] | 150 | struct test4_D : virtual B, virtual C { |
| 151 | }; |
| 152 | |
| 153 | // CHECK-LP32:__ZTV7test4_D: |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 154 | // CHECK-LP32-NEXT: .space 4 |
| 155 | // CHECK-LP32-NEXT: .long 4 |
| 156 | // CHECK-LP32-NEXT: .space 4 |
| 157 | // CHECK-LP32-NEXT: .space 4 |
| 158 | // CHECK-LP32-NEXT: .space 4 |
| 159 | // CHECK-LP32-NEXT: .long __ZTI7test4_D |
| 160 | // CHECK-LP32-NEXT: .long __ZN1C4bee1Ev |
| 161 | // CHECK-LP32-NEXT: .long __ZN1C4bee2Ev |
| 162 | // CHECK-LP32-NEXT: .space 4 |
| 163 | // CHECK-LP32-NEXT: .space 4 |
| 164 | // CHECK-LP32-NEXT: .long 4294967292 |
| 165 | // CHECK-LP32-NEXT: .long __ZTI7test4_D |
| 166 | // CHECK-LP32-NEXT: .long __ZN1B4bar1Ev |
| 167 | // CHECK-LP32-NEXT: .long __ZN1B4bar2Ev |
Mike Stump | 34fae9c | 2009-08-12 18:50:26 +0000 | [diff] [blame] | 168 | |
| 169 | // CHECK-LP64:__ZTV7test4_D: |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 170 | // CHECK-LP64-NEXT: .space 8 |
| 171 | // CHECK-LP64-NEXT: .quad 8 |
| 172 | // CHECK-LP64-NEXT: .space 8 |
| 173 | // CHECK-LP64-NEXT: .space 8 |
| 174 | // CHECK-LP64-NEXT: .space 8 |
| 175 | // CHECK-LP64-NEXT: .quad __ZTI7test4_D |
| 176 | // CHECK-LP64-NEXT: .quad __ZN1C4bee1Ev |
| 177 | // CHECK-LP64-NEXT: .quad __ZN1C4bee2Ev |
| 178 | // CHECK-LP64-NEXT: .space 8 |
| 179 | // CHECK-LP64-NEXT: .space 8 |
| 180 | // CHECK-LP64-NEXT: .quad 18446744073709551608 |
| 181 | // CHECK-LP64-NEXT: .quad __ZTI7test4_D |
| 182 | // CHECK-LP64-NEXT: .quad __ZN1B4bar1Ev |
| 183 | // CHECK-LP64-NEXT: .quad __ZN1B4bar2Ev |
Mike Stump | 34fae9c | 2009-08-12 18:50:26 +0000 | [diff] [blame] | 184 | |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 185 | |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 186 | struct test5_B3 { virtual void funcB3(); }; |
| 187 | struct test5_B2 : virtual test5_B3 { virtual void funcB2(); }; |
| 188 | struct test5_B1 : virtual test5_B2 { virtual void funcB1(); }; |
| 189 | |
| 190 | struct test5_B23 { virtual void funcB23(); }; |
| 191 | struct test5_B22 : virtual test5_B23 { virtual void funcB22(); }; |
| 192 | struct test5_B21 : virtual test5_B22 { virtual void funcB21(); }; |
| 193 | |
| 194 | |
| 195 | struct B232 { virtual void funcB232(); }; |
| 196 | struct B231 { virtual void funcB231(); }; |
| 197 | |
| 198 | struct test5_B33 { virtual void funcB33(); }; |
| 199 | struct test5_B32 : virtual test5_B33, virtual B232 { virtual void funcB32(); }; |
| 200 | struct test5_B31 : virtual test5_B32, virtual B231 { virtual void funcB31(); }; |
| 201 | |
| 202 | struct test5_D : virtual test5_B1, virtual test5_B21, virtual test5_B31 { |
| 203 | virtual void funcD() { } |
| 204 | }; |
| 205 | |
| 206 | // CHECK-LP32:__ZTV7test5_D: |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 207 | // CHECK-LP32-NEXT: .long 16 |
| 208 | // CHECK-LP32-NEXT: .long 12 |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 209 | // CHECK-LP32: .long 8 |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 210 | // CHECK-LP32 .long 8 |
| 211 | // CHECK-LP32 .long 8 |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 212 | // CHECK-LP32: .long 4 |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 213 | // CHECK-LP32 .long 4 |
| 214 | // CHECK-LP32 .long 4 |
| 215 | // CHECK-LP32: .space 4 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 216 | // CHECK-LP32-NEXT: .space 4 |
| 217 | // CHECK-LP32-NEXT: .space 4 |
| 218 | // CHECK-LP32-NEXT: .space 4 |
| 219 | // CHECK-LP32-NEXT: .space 4 |
| 220 | // CHECK-LP32-NEXT: .space 4 |
| 221 | // CHECK-LP32-NEXT: .space 4 |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 222 | // CHECK-LP32: .long __ZTI7test5_D |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 223 | // CHECK-LP32-NEXT: .long __ZN8test5_B36funcB3Ev |
| 224 | // CHECK-LP32-NEXT: .long __ZN8test5_B26funcB2Ev |
| 225 | // CHECK-LP32-NEXT: .long __ZN8test5_B16funcB1Ev |
| 226 | // CHECK-LP32-NEXT: .long __ZN7test5_D5funcDEv |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 227 | // CHECK-LP32: .space 4 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 228 | // CHECK-LP32-NEXT: .space 4 |
| 229 | // CHECK-LP32-NEXT: .space 4 |
| 230 | // CHECK-LP32-NEXT: .space 4 |
| 231 | // CHECK-LP32-NEXT: .space 4 |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 232 | // CHECK-LP32 .long 4294967292 |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 233 | // CHECK-LP32: .long __ZTI7test5_D |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 234 | // CHECK-LP32-NEXT: .long __ZN9test5_B237funcB23Ev |
| 235 | // CHECK-LP32-NEXT: .long __ZN9test5_B227funcB22Ev |
| 236 | // CHECK-LP32-NEXT: .long __ZN9test5_B217funcB21Ev |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 237 | // CHECK-LP32 .space 4 |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 238 | // CHECK-LP32: .long 8 |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 239 | // CHECK-LP32: .space 4 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 240 | // CHECK-LP32-NEXT: .space 4 |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 241 | // CHECK-LP32: .long 4 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 242 | // CHECK-LP32-NEXT: .space 4 |
| 243 | // CHECK-LP32-NEXT: .space 4 |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 244 | // CHECK-LP32 .long 4294967288 |
| 245 | // CHECK-LP32: .long __ZTI7test5_D |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 246 | // CHECK-LP32-NEXT: .long __ZN9test5_B337funcB33Ev |
| 247 | // CHECK-LP32-NEXT: .long __ZN9test5_B327funcB32Ev |
| 248 | // CHECK-LP32-NEXT: .long __ZN9test5_B317funcB31Ev |
| 249 | // CHECK-LP32-NEXT: .space 4 |
| 250 | // CHECK-LP32-NEXT: .long 4294967284 |
| 251 | // CHECK-LP32-NEXT: .long __ZTI7test5_D |
| 252 | // CHECK-LP32-NEXT: .long __ZN4B2328funcB232Ev |
| 253 | // CHECK-LP32-NEXT: .space 4 |
| 254 | // CHECK-LP32-NEXT:.long 4294967280 |
| 255 | // CHECK-LP32-NEXT: .long __ZTI7test5_D |
| 256 | // CHECK-LP32-NEXT: .long __ZN4B2318funcB231Ev |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 257 | |
| 258 | // CHECK-LP64:__ZTV7test5_D: |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 259 | // CHECK-LP64-NEXT: .quad 32 |
| 260 | // CHECK-LP64-NEXT: .quad 24 |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 261 | // CHECK-LP64: .quad 16 |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 262 | // CHECK-LP64 .quad 16 |
| 263 | // CHECK-LP64 .quad 16 |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 264 | // CHECK-LP64: .quad 8 |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 265 | // CHECK-LP64 .quad 8 |
| 266 | // CHECK-LP64 .quad 8 |
| 267 | // CHECK-LP64: .space 8 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 268 | // CHECK-LP64-NEXT: .space 8 |
| 269 | // CHECK-LP64-NEXT: .space 8 |
| 270 | // CHECK-LP64-NEXT: .space 8 |
| 271 | // CHECK-LP64-NEXT: .space 8 |
| 272 | // CHECK-LP64-NEXT: .space 8 |
| 273 | // CHECK-LP64-NEXT: .space 8 |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 274 | // CHECK-LP64: .quad __ZTI7test5_D |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 275 | // CHECK-LP64-NEXT: .quad __ZN8test5_B36funcB3Ev |
| 276 | // CHECK-LP64-NEXT: .quad __ZN8test5_B26funcB2Ev |
| 277 | // CHECK-LP64-NEXT: .quad __ZN8test5_B16funcB1Ev |
| 278 | // CHECK-LP64-NEXT: .quad __ZN7test5_D5funcDEv |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 279 | // CHECK-LP64: .space 8 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 280 | // CHECK-LP64-NEXT: .space 8 |
| 281 | // CHECK-LP64-NEXT: .space 8 |
| 282 | // CHECK-LP64-NEXT: .space 8 |
| 283 | // CHECK-LP64-NEXT: .space 8 |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 284 | // CHECK-LP64 .quad 18446744073709551608 |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 285 | // CHECK-LP64: .quad __ZTI7test5_D |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 286 | // CHECK-LP64-NEXT: .quad __ZN9test5_B237funcB23Ev |
| 287 | // CHECK-LP64-NEXT: .quad __ZN9test5_B227funcB22Ev |
| 288 | // CHECK-LP64-NEXT: .quad __ZN9test5_B217funcB21Ev |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 289 | // CHECK-LP64 .space 8 |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 290 | // CHECK-LP64: .quad 16 |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 291 | // CHECK-LP64: .space 8 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 292 | // CHECK-LP64-NEXT: .space 8 |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 293 | // CHECK-LP64: .quad 8 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 294 | // CHECK-LP64-NEXT: .space 8 |
| 295 | // CHECK-LP64-NEXT: .space 8 |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 296 | // CHECK-LP64 .quad 18446744073709551600 |
| 297 | // CHECK-LP64: .quad __ZTI7test5_D |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 298 | // CHECK-LP64-NEXT: .quad __ZN9test5_B337funcB33Ev |
| 299 | // CHECK-LP64-NEXT: .quad __ZN9test5_B327funcB32Ev |
| 300 | // CHECK-LP64-NEXT: .quad __ZN9test5_B317funcB31Ev |
| 301 | // CHECK-LP64-NEXT: .space 8 |
| 302 | // CHECK-LP64-NEXT: .quad 18446744073709551592 |
| 303 | // CHECK-LP64-NEXT: .quad __ZTI7test5_D |
| 304 | // CHECK-LP64-NEXT: .quad __ZN4B2328funcB232Ev |
| 305 | // CHECK-LP64-NEXT: .space 8 |
| 306 | // CHECK-LP64-NEXT:.quad 18446744073709551584 |
| 307 | // CHECK-LP64-NEXT: .quad __ZTI7test5_D |
| 308 | // CHECK-LP64-NEXT: .quad __ZN4B2318funcB231Ev |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 309 | |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 310 | struct test8_B1 { |
| 311 | virtual void ftest8_B1() { } |
| 312 | }; |
| 313 | struct test8_B2aa { |
| 314 | virtual void ftest8_B2aa() { } |
| 315 | int i; |
| 316 | }; |
| 317 | struct test8_B2ab { |
| 318 | virtual void ftest8_B2ab() { } |
| 319 | int i; |
| 320 | }; |
| 321 | struct test8_B2a : virtual test8_B2aa, virtual test8_B2ab { |
| 322 | virtual void ftest8_B2a() { } |
| 323 | }; |
| 324 | struct test8_B2b { |
| 325 | virtual void ftest8_B2b() { } |
| 326 | }; |
| 327 | struct test8_B2 : test8_B2a, test8_B2b { |
| 328 | virtual void ftest8_B2() { } |
| 329 | }; |
| 330 | struct test8_B3 { |
| 331 | virtual void ftest8_B3() { } |
| 332 | }; |
| 333 | class test8_D : test8_B1, test8_B2, test8_B3 { |
| 334 | } d8; |
| 335 | |
| 336 | // CHECK-LP32:__ZTV7test8_D: |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 337 | // CHECK-LP32-NEXT: .long 24 |
| 338 | // CHECK-LP32-NEXT: .long 16 |
| 339 | // CHECK-LP32-NEXT: .space 4 |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 340 | // CHECK-LP32: .long __ZTI7test8_D |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 341 | // CHECK-LP32-NEXT: .long __ZN8test8_B19ftest8_B1Ev |
| 342 | // CHECK-LP32-NEXT: .long 20 |
| 343 | // CHECK-LP32-NEXT: .long 12 |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 344 | // CHECK-LP32: .long 4294967292 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 345 | // CHECK-LP32-NEXT: .long __ZTI7test8_D |
| 346 | // CHECK-LP32-NEXT: .long __ZN9test8_B2a10ftest8_B2aEv |
| 347 | // CHECK-LP32-NEXT: .long __ZN8test8_B29ftest8_B2Ev |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 348 | // CHECK-LP32: .long 4294967288 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 349 | // CHECK-LP32-NEXT: .long __ZTI7test8_D |
| 350 | // CHECK-LP32-NEXT: .long __ZN9test8_B2b10ftest8_B2bEv |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 351 | // CHECK-LP32: .long 4294967284 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 352 | // CHECK-LP32-NEXT: .long __ZTI7test8_D |
| 353 | // CHECK-LP32-NEXT: .long __ZN8test8_B39ftest8_B3Ev |
| 354 | // CHECK-LP32-NEXT: .space 4 |
| 355 | // CHECK-LP32-NEXT: .long 4294967280 |
| 356 | // CHECK-LP32-NEXT: .long __ZTI7test8_D |
| 357 | // CHECK-LP32-NEXT: .long __ZN10test8_B2aa11ftest8_B2aaEv |
| 358 | // CHECK-LP32-NEXT: .space 4 |
| 359 | // CHECK-LP32-NEXT: .long 4294967272 |
| 360 | // CHECK-LP32-NEXT: .long __ZTI7test8_D |
| 361 | // CHECK-LP32-NEXT: .long __ZN10test8_B2ab11ftest8_B2abEv |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 362 | |
| 363 | // CHECK-LP64:__ZTV7test8_D: |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 364 | // CHECK-LP64-NEXT: .quad 48 |
| 365 | // CHECK-LP64-NEXT: .quad 32 |
| 366 | // CHECK-LP64-NEXT: .space 8 |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 367 | // CHECK-LP64: .quad __ZTI7test8_D |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 368 | // CHECK-LP64-NEXT: .quad __ZN8test8_B19ftest8_B1Ev |
| 369 | // CHECK-LP64-NEXT: .quad 40 |
| 370 | // CHECK-LP64-NEXT: .quad 24 |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 371 | // CHECK-LP64: .quad 18446744073709551608 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 372 | // CHECK-LP64-NEXT: .quad __ZTI7test8_D |
| 373 | // CHECK-LP64-NEXT: .quad __ZN9test8_B2a10ftest8_B2aEv |
| 374 | // CHECK-LP64-NEXT: .quad __ZN8test8_B29ftest8_B2Ev |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 375 | // CHECK-LP64: .quad 18446744073709551600 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 376 | // CHECK-LP64-NEXT: .quad __ZTI7test8_D |
| 377 | // CHECK-LP64-NEXT: .quad __ZN9test8_B2b10ftest8_B2bEv |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 378 | // CHECK-LP64: .quad 18446744073709551592 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 379 | // CHECK-LP64-NEXT: .quad __ZTI7test8_D |
| 380 | // CHECK-LP64-NEXT: .quad __ZN8test8_B39ftest8_B3Ev |
| 381 | // CHECK-LP64-NEXT: .space 8 |
| 382 | // CHECK-LP64-NEXT: .quad 18446744073709551584 |
| 383 | // CHECK-LP64-NEXT: .quad __ZTI7test8_D |
| 384 | // CHECK-LP64-NEXT: .quad __ZN10test8_B2aa11ftest8_B2aaEv |
| 385 | // CHECK-LP64-NEXT: .space 8 |
| 386 | // CHECK-LP64-NEXT: .quad 18446744073709551568 |
| 387 | // CHECK-LP64-NEXT: .quad __ZTI7test8_D |
| 388 | // CHECK-LP64-NEXT: .quad __ZN10test8_B2ab11ftest8_B2abEv |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 389 | |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 390 | |
| 391 | |
Mike Stump | 26899b0 | 2009-08-05 22:48:36 +0000 | [diff] [blame] | 392 | // CHECK-LP64: __ZTV1B: |
| 393 | // CHECK-LP64: .space 8 |
Mike Stump | e1be2b1 | 2009-08-06 21:49:36 +0000 | [diff] [blame] | 394 | // CHECK-LP64: .quad __ZTI1B |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 395 | // CHECK-LP64-NEXT: .quad __ZN1B4bar1Ev |
| 396 | // CHECK-LP64-NEXT: .quad __ZN1B4bar2Ev |
Mike Stump | 26899b0 | 2009-08-05 22:48:36 +0000 | [diff] [blame] | 397 | |
| 398 | // CHECK-LP32: __ZTV1B: |
| 399 | // CHECK-LP32: .space 4 |
Mike Stump | e1be2b1 | 2009-08-06 21:49:36 +0000 | [diff] [blame] | 400 | // CHECK-LP32: .long __ZTI1B |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 401 | // CHECK-LP32-NEXT: .long __ZN1B4bar1Ev |
| 402 | // CHECK-LP32-NEXT: .long __ZN1B4bar2Ev |
Mike Stump | 26899b0 | 2009-08-05 22:48:36 +0000 | [diff] [blame] | 403 | |
Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame] | 404 | // CHECK-LP64: __ZTV1A: |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 405 | // CHECK-LP64-NEXT: .space 8 |
Mike Stump | e1be2b1 | 2009-08-06 21:49:36 +0000 | [diff] [blame] | 406 | // CHECK-LP64: .quad __ZTI1A |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 407 | // CHECK-LP64-NEXT: .quad __ZN1B4bar1Ev |
| 408 | // CHECK-LP64-NEXT: .quad __ZN1B4bar2Ev |
| 409 | // CHECK-LP64-NEXT: .quad __ZN1A4foo1Ev |
| 410 | // CHECK-LP64-NEXT: .quad __ZN1A4foo2Ev |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 411 | // CHECK-LP64: .quad 18446744073709551600 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 412 | // CHECK-LP64-NEXT: .quad __ZTI1A |
| 413 | // CHECK-LP64-NEXT: .quad __ZN1C4bee1Ev |
| 414 | // CHECK-LP64-NEXT: .quad __ZN1C4bee2Ev |
Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame] | 415 | |
| 416 | // CHECK-LP32: __ZTV1A: |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 417 | // CHECK-LP32-NEXT: .space 4 |
Mike Stump | e1be2b1 | 2009-08-06 21:49:36 +0000 | [diff] [blame] | 418 | // CHECK-LP32: .long __ZTI1A |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 419 | // CHECK-LP32-NEXT: .long __ZN1B4bar1Ev |
| 420 | // CHECK-LP32-NEXT: .long __ZN1B4bar2Ev |
| 421 | // CHECK-LP32-NEXT: .long __ZN1A4foo1Ev |
| 422 | // CHECK-LP32-NEXT: .long __ZN1A4foo2Ev |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 423 | // CHECK-LP32: .long 4294967284 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 424 | // CHECK-LP32-NEXT: .long __ZTI1A |
| 425 | // CHECK-LP32-NEXT: .long __ZN1C4bee1Ev |
| 426 | // CHECK-LP32-NEXT: .long __ZN1C4bee2Ev |
Mike Stump | 8a12b56 | 2009-08-06 15:50:11 +0000 | [diff] [blame] | 427 | |
Mike Stump | 928f150 | 2009-08-07 19:00:50 +0000 | [diff] [blame] | 428 | // CHECK-LP32:__ZTV1F: |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 429 | // CHECK-LP32-NEXT: .space 4 |
| 430 | // CHECK-LP32-NEXT: .long 8 |
| 431 | // CHECK-LP32-NEXT: .space 4 |
| 432 | // CHECK-LP32-NEXT: .space 4 |
Mike Stump | e1be2b1 | 2009-08-06 21:49:36 +0000 | [diff] [blame] | 433 | // CHECK-LP32: .long __ZTI1F |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 434 | // CHECK-LP32-NEXT: .long __ZN1D3booEv |
| 435 | // CHECK-LP32-NEXT: .long __ZN1F3fooEv |
| 436 | // CHECK-LP32-NEXT: .space 4 |
| 437 | // CHECK-LP32-NEXT: .space 4 |
| 438 | // CHECK-LP32-NEXT: .space 4 |
| 439 | // CHECK-LP32-NEXT: .space 4 |
| 440 | // CHECK-LP32-NEXT: .space 4 |
| 441 | // CHECK-LP32-NEXT: .long 4294967288 |
| 442 | // CHECK-LP32-NEXT: .long __ZTI1F |
| 443 | // CHECK-LP32-NEXT: .long __ZN2D13barEv |
| 444 | // CHECK-LP32-NEXT: .long __ZN2D14bar2Ev |
| 445 | // CHECK-LP32-NEXT: .long __ZN2D14bar3Ev |
| 446 | // CHECK-LP32-NEXT: .long __ZN2D14bar4Ev |
| 447 | // CHECK-LP32-NEXT: .long __ZN2D14bar5Ev |
Mike Stump | 8a12b56 | 2009-08-06 15:50:11 +0000 | [diff] [blame] | 448 | |
| 449 | // CHECK-LP64: __ZTV1F: |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 450 | // CHECK-LP64-NEXT: .space 8 |
| 451 | // CHECK-LP64-NEXT: .quad 16 |
| 452 | // CHECK-LP64-NEXT: .space 8 |
| 453 | // CHECK-LP64-NEXT: .space 8 |
Mike Stump | e1be2b1 | 2009-08-06 21:49:36 +0000 | [diff] [blame] | 454 | // CHECK-LP64: .quad __ZTI1F |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 455 | // CHECK-LP64-NEXT: .quad __ZN1D3booEv |
| 456 | // CHECK-LP64-NEXT: .quad __ZN1F3fooEv |
| 457 | // CHECK-LP64-NEXT: .space 8 |
| 458 | // CHECK-LP64-NEXT: .space 8 |
| 459 | // CHECK-LP64-NEXT: .space 8 |
| 460 | // CHECK-LP64-NEXT: .space 8 |
| 461 | // CHECK-LP64-NEXT: .space 8 |
| 462 | // CHECK-LP64-NEXT: .quad 18446744073709551600 |
| 463 | // CHECK-LP64-NEXT: .quad __ZTI1F |
| 464 | // CHECK-LP64-NEXT: .quad __ZN2D13barEv |
| 465 | // CHECK-LP64-NEXT: .quad __ZN2D14bar2Ev |
| 466 | // CHECK-LP64-NEXT: .quad __ZN2D14bar3Ev |
| 467 | // CHECK-LP64-NEXT: .quad __ZN2D14bar4Ev |
| 468 | // CHECK-LP64-NEXT: .quad __ZN2D14bar5Ev |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 469 | |
| 470 | |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 471 | test5_D d5; |
Mike Stump | 34fae9c | 2009-08-12 18:50:26 +0000 | [diff] [blame] | 472 | test4_D d4; |
| 473 | test3_D d3; |
Mike Stump | 7884678 | 2009-08-13 23:33:29 +0000 | [diff] [blame] | 474 | |
| 475 | test6_D d6; |
| 476 | test7_D d7; |