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 | |
Mike Stump | 599837a | 2009-11-06 00:18:25 +0000 | [diff] [blame] | 4 | // RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -emit-llvm %s -o %t-64.ll && |
| 5 | // RUN: FileCheck -check-prefix LPLL64 --input-file=%t-64.ll %s && |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 6 | |
Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame] | 7 | // RUN: true |
Mike Stump | 3dee6ef | 2009-07-30 00:22:38 +0000 | [diff] [blame] | 8 | |
Mike Stump | 104ffaa | 2009-08-04 21:58:42 +0000 | [diff] [blame] | 9 | struct B { |
| 10 | virtual void bar1(); |
| 11 | virtual void bar2(); |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 12 | int b; |
Mike Stump | 104ffaa | 2009-08-04 21:58:42 +0000 | [diff] [blame] | 13 | }; |
Mike Stump | 6f37633 | 2009-08-05 22:37:18 +0000 | [diff] [blame] | 14 | void B::bar1() { } |
| 15 | void B::bar2() { } |
| 16 | |
| 17 | struct C { |
| 18 | virtual void bee1(); |
| 19 | virtual void bee2(); |
| 20 | }; |
| 21 | void C::bee1() { } |
| 22 | void C::bee2() { } |
Mike Stump | 104ffaa | 2009-08-04 21:58:42 +0000 | [diff] [blame] | 23 | |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 24 | struct D { |
| 25 | virtual void boo(); |
| 26 | }; |
| 27 | void D::boo() { } |
Mike Stump | 104ffaa | 2009-08-04 21:58:42 +0000 | [diff] [blame] | 28 | |
Mike Stump | c5708d9 | 2009-08-06 14:12:47 +0000 | [diff] [blame] | 29 | struct D1 { |
| 30 | virtual void bar(); |
Mike Stump | 02cf1e2 | 2009-08-06 23:48:32 +0000 | [diff] [blame] | 31 | virtual void bar2(); |
| 32 | virtual void bar3(); |
| 33 | virtual void bar4(); |
| 34 | virtual void bar5(); |
Mike Stump | c5708d9 | 2009-08-06 14:12:47 +0000 | [diff] [blame] | 35 | void *d1; |
| 36 | }; |
| 37 | void D1::bar() { } |
| 38 | |
| 39 | class F : virtual public D1, virtual public D { |
| 40 | public: |
| 41 | virtual void foo(); |
| 42 | void *f; |
| 43 | }; |
| 44 | void F::foo() { } |
| 45 | |
| 46 | int j; |
Mike Stump | 941e3f3 | 2009-11-05 05:01:19 +0000 | [diff] [blame] | 47 | void *vp; |
Mike Stump | c5708d9 | 2009-08-06 14:12:47 +0000 | [diff] [blame] | 48 | void test2() { |
| 49 | F f; |
| 50 | static int sz = (char *)(&f.f) - (char *)(&f); |
Mike Stump | 941e3f3 | 2009-11-05 05:01:19 +0000 | [diff] [blame] | 51 | vp = &sz; |
Mike Stump | c5708d9 | 2009-08-06 14:12:47 +0000 | [diff] [blame] | 52 | j = sz; |
Mike Stump | 37148f4 | 2009-08-06 14:16:19 +0000 | [diff] [blame] | 53 | // FIXME: These should result in a frontend constant a la fold, no run time |
| 54 | // initializer |
Mike Stump | 599837a | 2009-11-06 00:18:25 +0000 | [diff] [blame] | 55 | // CHECK-LPLL64: define void @_Z5test2v() |
| 56 | // CHECK-LPLL64: = getelementptr inbounds %class.F* %f, i32 0, i32 1 |
Mike Stump | c5708d9 | 2009-08-06 14:12:47 +0000 | [diff] [blame] | 57 | } |
Mike Stump | 8a12b56 | 2009-08-06 15:50:11 +0000 | [diff] [blame] | 58 | |
Mike Stump | c5708d9 | 2009-08-06 14:12:47 +0000 | [diff] [blame] | 59 | static_assert(sizeof(F) == sizeof(void*)*4, "invalid vbase size"); |
| 60 | |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 61 | struct E { |
| 62 | int e; |
| 63 | }; |
| 64 | |
| 65 | static_assert (sizeof (C) == (sizeof(void *)), "vtable pointer layout"); |
| 66 | |
Mike Stump | eb19fa9 | 2009-08-06 13:41:24 +0000 | [diff] [blame] | 67 | class A : public E, public B, public C { |
Mike Stump | 3dee6ef | 2009-07-30 00:22:38 +0000 | [diff] [blame] | 68 | public: |
Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame] | 69 | virtual void foo1(); |
| 70 | virtual void foo2(); |
| 71 | A() { } |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 72 | int a; |
| 73 | } *ap; |
Mike Stump | 6f37633 | 2009-08-05 22:37:18 +0000 | [diff] [blame] | 74 | void A::foo1() { } |
| 75 | void A::foo2() { } |
Mike Stump | 3dee6ef | 2009-07-30 00:22:38 +0000 | [diff] [blame] | 76 | |
Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame] | 77 | int main() { |
| 78 | A a; |
Mike Stump | 26899b0 | 2009-08-05 22:48:36 +0000 | [diff] [blame] | 79 | B b; |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 80 | ap->e = 1; |
| 81 | ap->b = 2; |
Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame] | 82 | } |
| 83 | |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 84 | // CHECK-LP64: main: |
| 85 | // CHECK-LP64: movl $1, 12(%rax) |
| 86 | // CHECK-LP64: movl $2, 8(%rax) |
| 87 | |
Mike Stump | f0070db | 2009-08-26 20:46:33 +0000 | [diff] [blame] | 88 | struct test12_A { |
| 89 | virtual void foo0() { } |
| 90 | virtual void foo(); |
| 91 | } *test12_pa; |
| 92 | |
| 93 | struct test12_B : public test12_A { |
| 94 | virtual void foo() { } |
| 95 | } *test12_pb; |
| 96 | |
| 97 | struct test12_D : public test12_B { |
| 98 | } *test12_pd; |
| 99 | void test12_foo() { |
| 100 | test12_pa->foo0(); |
| 101 | test12_pb->foo0(); |
| 102 | test12_pd->foo0(); |
| 103 | test12_pa->foo(); |
| 104 | test12_pb->foo(); |
| 105 | test12_pd->foo(); |
| 106 | test12_pa->test12_A::foo(); |
| 107 | } |
| 108 | |
Mike Stump | 599837a | 2009-11-06 00:18:25 +0000 | [diff] [blame] | 109 | // CHECK-LPLL64:define void @_Z10test12_foov() nounwind { |
| 110 | // CHECK-LPLL64: call void %2(%class.test14* %tmp) |
| 111 | // CHECK-LPLL64: call void %5(%class.test14* %tmp1) |
| 112 | // CHECK-LPLL64: call void %8(%class.test14* %tmp3) |
| 113 | // CHECK-LPLL64: call void %11(%class.test14* %tmp5) |
| 114 | // CHECK-LPLL64: call void %14(%class.test14* %tmp7) |
| 115 | // CHECK-LPLL64: call void %17(%class.test14* %tmp9) |
| 116 | // CHECK-LPLL64: call void @_ZN8test12_A3fooEv(%class.test14* %tmp11) |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 117 | |
Mike Stump | 941e3f3 | 2009-11-05 05:01:19 +0000 | [diff] [blame] | 118 | |
Mike Stump | 94d0bce | 2009-08-13 00:34:14 +0000 | [diff] [blame] | 119 | struct test6_B2 { virtual void funcB2(); char b[1000]; }; |
| 120 | struct test6_B1 : virtual test6_B2 { virtual void funcB1(); }; |
| 121 | |
| 122 | struct test6_D : test6_B2, virtual test6_B1 { |
| 123 | }; |
| 124 | |
Mike Stump | 94d0bce | 2009-08-13 00:34:14 +0000 | [diff] [blame] | 125 | // CHECK-LP64: .zerofill __DATA, __common, _d6, 2024, 4 |
| 126 | |
Mike Stump | 7884678 | 2009-08-13 23:33:29 +0000 | [diff] [blame] | 127 | struct test7_B2 { virtual void funcB2(); }; |
| 128 | struct test7_B1 : virtual test7_B2 { virtual void funcB1(); }; |
| 129 | |
| 130 | struct test7_D : test7_B2, virtual test7_B1 { |
| 131 | }; |
| 132 | |
Mike Stump | 7884678 | 2009-08-13 23:33:29 +0000 | [diff] [blame] | 133 | // CHECK-LP64: .zerofill __DATA, __common, _d7, 16, 3 |
Mike Stump | 94d0bce | 2009-08-13 00:34:14 +0000 | [diff] [blame] | 134 | |
| 135 | |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 136 | struct test3_B3 { virtual void funcB3(); }; |
| 137 | struct test3_B2 : virtual test3_B3 { virtual void funcB2(); }; |
| 138 | struct test3_B1 : virtual test3_B2 { virtual void funcB1(); }; |
| 139 | |
Mike Stump | f0070db | 2009-08-26 20:46:33 +0000 | [diff] [blame] | 140 | struct test3_D : virtual test3_B1 { |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 141 | virtual void funcD() { } |
| 142 | }; |
| 143 | |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 144 | // CHECK-LP64:__ZTV7test3_D: |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 145 | // CHECK-LP64-NEXT: .space 8 |
| 146 | // CHECK-LP64-NEXT: .space 8 |
| 147 | // CHECK-LP64-NEXT: .space 8 |
| 148 | // CHECK-LP64-NEXT: .space 8 |
| 149 | // CHECK-LP64-NEXT: .space 8 |
| 150 | // CHECK-LP64-NEXT: .space 8 |
| 151 | // CHECK-LP64-NEXT: .space 8 |
Mike Stump | 666a91e | 2009-08-21 18:05:02 +0000 | [diff] [blame] | 152 | // CHECK-LP64-NEXT: .quad __ZTI7test3_D |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 153 | // CHECK-LP64-NEXT: .quad __ZN8test3_B36funcB3Ev |
| 154 | // CHECK-LP64-NEXT: .quad __ZN8test3_B26funcB2Ev |
| 155 | // CHECK-LP64-NEXT: .quad __ZN8test3_B16funcB1Ev |
| 156 | // CHECK-LP64-NEXT: .quad __ZN7test3_D5funcDEv |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 157 | |
Mike Stump | 34fae9c | 2009-08-12 18:50:26 +0000 | [diff] [blame] | 158 | struct test4_D : virtual B, virtual C { |
| 159 | }; |
| 160 | |
Mike Stump | 34fae9c | 2009-08-12 18:50:26 +0000 | [diff] [blame] | 161 | // CHECK-LP64:__ZTV7test4_D: |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 162 | // CHECK-LP64-NEXT: .space 8 |
| 163 | // CHECK-LP64-NEXT: .quad 8 |
| 164 | // CHECK-LP64-NEXT: .space 8 |
| 165 | // CHECK-LP64-NEXT: .space 8 |
| 166 | // CHECK-LP64-NEXT: .space 8 |
| 167 | // CHECK-LP64-NEXT: .quad __ZTI7test4_D |
| 168 | // CHECK-LP64-NEXT: .quad __ZN1C4bee1Ev |
| 169 | // CHECK-LP64-NEXT: .quad __ZN1C4bee2Ev |
| 170 | // CHECK-LP64-NEXT: .space 8 |
| 171 | // CHECK-LP64-NEXT: .space 8 |
| 172 | // CHECK-LP64-NEXT: .quad 18446744073709551608 |
| 173 | // CHECK-LP64-NEXT: .quad __ZTI7test4_D |
| 174 | // CHECK-LP64-NEXT: .quad __ZN1B4bar1Ev |
| 175 | // CHECK-LP64-NEXT: .quad __ZN1B4bar2Ev |
Mike Stump | 34fae9c | 2009-08-12 18:50:26 +0000 | [diff] [blame] | 176 | |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 177 | |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 178 | struct test5_B3 { virtual void funcB3(); }; |
| 179 | struct test5_B2 : virtual test5_B3 { virtual void funcB2(); }; |
| 180 | struct test5_B1 : virtual test5_B2 { virtual void funcB1(); }; |
| 181 | |
| 182 | struct test5_B23 { virtual void funcB23(); }; |
| 183 | struct test5_B22 : virtual test5_B23 { virtual void funcB22(); }; |
| 184 | struct test5_B21 : virtual test5_B22 { virtual void funcB21(); }; |
| 185 | |
| 186 | |
| 187 | struct B232 { virtual void funcB232(); }; |
| 188 | struct B231 { virtual void funcB231(); }; |
| 189 | |
| 190 | struct test5_B33 { virtual void funcB33(); }; |
| 191 | struct test5_B32 : virtual test5_B33, virtual B232 { virtual void funcB32(); }; |
| 192 | struct test5_B31 : virtual test5_B32, virtual B231 { virtual void funcB31(); }; |
| 193 | |
| 194 | struct test5_D : virtual test5_B1, virtual test5_B21, virtual test5_B31 { |
| 195 | virtual void funcD() { } |
| 196 | }; |
| 197 | |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 198 | // CHECK-LP64:__ZTV7test5_D: |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 199 | // CHECK-LP64-NEXT: .quad 32 |
| 200 | // CHECK-LP64-NEXT: .quad 24 |
Mike Stump | fe3010d | 2009-08-16 19:04:13 +0000 | [diff] [blame] | 201 | // CHECK-LP64-NEXT: .quad 16 |
| 202 | // CHECK-LP64-NEXT: .quad 16 |
| 203 | // CHECK-LP64-NEXT: .quad 16 |
| 204 | // CHECK-LP64-NEXT: .quad 8 |
| 205 | // CHECK-LP64-NEXT: .quad 8 |
| 206 | // CHECK-LP64-NEXT: .quad 8 |
| 207 | // CHECK-LP64-NEXT: .space 8 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 208 | // CHECK-LP64-NEXT: .space 8 |
| 209 | // CHECK-LP64-NEXT: .space 8 |
| 210 | // CHECK-LP64-NEXT: .space 8 |
| 211 | // CHECK-LP64-NEXT: .space 8 |
| 212 | // CHECK-LP64-NEXT: .space 8 |
| 213 | // CHECK-LP64-NEXT: .space 8 |
Mike Stump | b983744 | 2009-08-20 07:22:17 +0000 | [diff] [blame] | 214 | // CHECK-LP64-NEXT: .quad __ZTI7test5_D |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 215 | // CHECK-LP64-NEXT: .quad __ZN8test5_B36funcB3Ev |
| 216 | // CHECK-LP64-NEXT: .quad __ZN8test5_B26funcB2Ev |
| 217 | // CHECK-LP64-NEXT: .quad __ZN8test5_B16funcB1Ev |
| 218 | // CHECK-LP64-NEXT: .quad __ZN7test5_D5funcDEv |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 219 | // CHECK-LP64-NEXT: .space 8 |
| 220 | // CHECK-LP64-NEXT: .space 8 |
| 221 | // CHECK-LP64-NEXT: .space 8 |
| 222 | // CHECK-LP64-NEXT: .space 8 |
Mike Stump | 15a24e0 | 2009-08-28 23:22:54 +0000 | [diff] [blame] | 223 | // CHECK-LP64-NEXT: .space 8 |
Mike Stump | bf3fe20 | 2009-08-27 01:09:45 +0000 | [diff] [blame] | 224 | // CHECK-LP64-NEXT: .quad 18446744073709551608 |
Mike Stump | fe3010d | 2009-08-16 19:04:13 +0000 | [diff] [blame] | 225 | // CHECK-LP64-NEXT: .quad __ZTI7test5_D |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 226 | // CHECK-LP64-NEXT: .quad __ZN9test5_B237funcB23Ev |
| 227 | // CHECK-LP64-NEXT: .quad __ZN9test5_B227funcB22Ev |
| 228 | // CHECK-LP64-NEXT: .quad __ZN9test5_B217funcB21Ev |
Mike Stump | 74be00b | 2009-09-01 22:01:25 +0000 | [diff] [blame] | 229 | // CHECK-LP64-NEXT: .space 8 |
Mike Stump | 6a9612f | 2009-10-31 20:06:59 +0000 | [diff] [blame] | 230 | // CHECK-LP64-NEXT: .quad 16 |
| 231 | // CHECK-LP64-NEXT: .space 8 |
| 232 | // CHECK-LP64-NEXT: .space 8 |
| 233 | // CHECK-LP64-NEXT: .quad 8 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 234 | // CHECK-LP64-NEXT: .space 8 |
| 235 | // CHECK-LP64-NEXT: .space 8 |
Mike Stump | 74be00b | 2009-09-01 22:01:25 +0000 | [diff] [blame] | 236 | // CHECK-LP64-NEXT: .quad 18446744073709551600 |
Mike Stump | fe3010d | 2009-08-16 19:04:13 +0000 | [diff] [blame] | 237 | // CHECK-LP64-NEXT: .quad __ZTI7test5_D |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 238 | // CHECK-LP64-NEXT: .quad __ZN9test5_B337funcB33Ev |
| 239 | // CHECK-LP64-NEXT: .quad __ZN9test5_B327funcB32Ev |
| 240 | // CHECK-LP64-NEXT: .quad __ZN9test5_B317funcB31Ev |
| 241 | // CHECK-LP64-NEXT: .space 8 |
| 242 | // CHECK-LP64-NEXT: .quad 18446744073709551592 |
| 243 | // CHECK-LP64-NEXT: .quad __ZTI7test5_D |
| 244 | // CHECK-LP64-NEXT: .quad __ZN4B2328funcB232Ev |
| 245 | // CHECK-LP64-NEXT: .space 8 |
Mike Stump | b983744 | 2009-08-20 07:22:17 +0000 | [diff] [blame] | 246 | // CHECK-LP64-NEXT: .quad 18446744073709551584 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 247 | // CHECK-LP64-NEXT: .quad __ZTI7test5_D |
| 248 | // CHECK-LP64-NEXT: .quad __ZN4B2318funcB231Ev |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 249 | |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 250 | struct test8_B1 { |
| 251 | virtual void ftest8_B1() { } |
| 252 | }; |
| 253 | struct test8_B2aa { |
| 254 | virtual void ftest8_B2aa() { } |
| 255 | int i; |
| 256 | }; |
| 257 | struct test8_B2ab { |
| 258 | virtual void ftest8_B2ab() { } |
| 259 | int i; |
| 260 | }; |
| 261 | struct test8_B2a : virtual test8_B2aa, virtual test8_B2ab { |
| 262 | virtual void ftest8_B2a() { } |
| 263 | }; |
| 264 | struct test8_B2b { |
| 265 | virtual void ftest8_B2b() { } |
| 266 | }; |
| 267 | struct test8_B2 : test8_B2a, test8_B2b { |
| 268 | virtual void ftest8_B2() { } |
| 269 | }; |
| 270 | struct test8_B3 { |
| 271 | virtual void ftest8_B3() { } |
| 272 | }; |
| 273 | class test8_D : test8_B1, test8_B2, test8_B3 { |
Mike Stump | 09765ec | 2009-08-19 02:53:08 +0000 | [diff] [blame] | 274 | }; |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 275 | |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 276 | // CHECK-LP64:__ZTV7test8_D: |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 277 | // CHECK-LP64-NEXT: .quad 48 |
| 278 | // CHECK-LP64-NEXT: .quad 32 |
| 279 | // CHECK-LP64-NEXT: .space 8 |
Mike Stump | b46c92d | 2009-08-19 02:06:38 +0000 | [diff] [blame] | 280 | // CHECK-LP64-NEXT: .quad __ZTI7test8_D |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 281 | // CHECK-LP64-NEXT: .quad __ZN8test8_B19ftest8_B1Ev |
| 282 | // CHECK-LP64-NEXT: .quad 40 |
| 283 | // CHECK-LP64-NEXT: .quad 24 |
Mike Stump | 7fa0d93 | 2009-08-20 02:11:48 +0000 | [diff] [blame] | 284 | // CHECK-LP64-NEXT: .quad 18446744073709551608 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 285 | // CHECK-LP64-NEXT: .quad __ZTI7test8_D |
| 286 | // CHECK-LP64-NEXT: .quad __ZN9test8_B2a10ftest8_B2aEv |
| 287 | // CHECK-LP64-NEXT: .quad __ZN8test8_B29ftest8_B2Ev |
Mike Stump | b46c92d | 2009-08-19 02:06:38 +0000 | [diff] [blame] | 288 | // CHECK-LP64-NEXT: .quad 18446744073709551600 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 289 | // CHECK-LP64-NEXT: .quad __ZTI7test8_D |
| 290 | // CHECK-LP64-NEXT: .quad __ZN9test8_B2b10ftest8_B2bEv |
Mike Stump | b46c92d | 2009-08-19 02:06:38 +0000 | [diff] [blame] | 291 | // CHECK-LP64-NEXT: .quad 18446744073709551592 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 292 | // CHECK-LP64-NEXT: .quad __ZTI7test8_D |
| 293 | // CHECK-LP64-NEXT: .quad __ZN8test8_B39ftest8_B3Ev |
| 294 | // CHECK-LP64-NEXT: .space 8 |
| 295 | // CHECK-LP64-NEXT: .quad 18446744073709551584 |
| 296 | // CHECK-LP64-NEXT: .quad __ZTI7test8_D |
| 297 | // CHECK-LP64-NEXT: .quad __ZN10test8_B2aa11ftest8_B2aaEv |
| 298 | // CHECK-LP64-NEXT: .space 8 |
| 299 | // CHECK-LP64-NEXT: .quad 18446744073709551568 |
| 300 | // CHECK-LP64-NEXT: .quad __ZTI7test8_D |
| 301 | // CHECK-LP64-NEXT: .quad __ZN10test8_B2ab11ftest8_B2abEv |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 302 | |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 303 | |
Mike Stump | 09765ec | 2009-08-19 02:53:08 +0000 | [diff] [blame] | 304 | struct test9_B3 { virtual void funcB3(); int i; }; |
| 305 | struct test9_B2 : virtual test9_B3 { virtual void funcB2(); int i; }; |
| 306 | struct test9_B1 : virtual test9_B2 { virtual void funcB1(); int i; }; |
| 307 | |
| 308 | struct test9_B23 { virtual void funcB23(); int i; }; |
| 309 | struct test9_B22 : virtual test9_B23 { virtual void funcB22(); int i; }; |
| 310 | struct test9_B21 : virtual test9_B22 { virtual void funcB21(); int i; }; |
| 311 | |
| 312 | |
| 313 | struct test9_B232 { virtual void funcB232(); int i; }; |
| 314 | struct test9_B231 { virtual void funcB231(); int i; }; |
| 315 | |
| 316 | struct test9_B33 { virtual void funcB33(); int i; }; |
| 317 | struct test9_B32 : virtual test9_B33, virtual test9_B232 { virtual void funcB32(); int i; }; |
| 318 | struct test9_B31 : virtual test9_B32, virtual test9_B231 { virtual void funcB31(); int i; }; |
| 319 | |
| 320 | struct test9_D : virtual test9_B1, virtual test9_B21, virtual test9_B31 { |
| 321 | virtual void funcD() { } |
| 322 | }; |
| 323 | |
| 324 | // CHECK-LP64: __ZTV7test9_D: |
| 325 | // CHECK-LP64-NEXT: .quad 168 |
| 326 | // CHECK-LP64-NEXT: .quad 152 |
| 327 | // CHECK-LP64-NEXT: .quad 136 |
| 328 | // CHECK-LP64-NEXT: .quad 120 |
| 329 | // CHECK-LP64-NEXT: .quad 104 |
| 330 | // CHECK-LP64-NEXT: .quad 88 |
| 331 | // CHECK-LP64-NEXT: .quad 72 |
| 332 | // CHECK-LP64-NEXT: .quad 56 |
| 333 | // CHECK-LP64-NEXT: .quad 40 |
| 334 | // CHECK-LP64-NEXT: .quad 24 |
| 335 | // CHECK-LP64-NEXT: .quad 8 |
| 336 | // CHECK-LP64-NEXT: .space 8 |
| 337 | // CHECK-LP64-NEXT: .quad __ZTI7test9_D |
| 338 | // CHECK-LP64-NEXT: .quad __ZN7test9_D5funcDEv |
| 339 | // CHECK-LP64-NEXT: .space 8 |
| 340 | // CHECK-LP64-NEXT: .quad 32 |
| 341 | // CHECK-LP64-NEXT: .quad 16 |
| 342 | // CHECK-LP64-NEXT: .quad 18446744073709551608 |
| 343 | // CHECK-LP64-NEXT: .quad __ZTI7test9_D |
| 344 | // CHECK-LP64-NEXT: .quad __ZN8test9_B16funcB1Ev |
| 345 | // CHECK-LP64-NEXT: .space 8 |
| 346 | // CHECK-LP64-NEXT: .quad 16 |
| 347 | // CHECK-LP64-NEXT: .quad 18446744073709551592 |
| 348 | // CHECK-LP64-NEXT: .quad __ZTI7test9_D |
| 349 | // CHECK-LP64-NEXT: .quad __ZN8test9_B26funcB2Ev |
| 350 | // CHECK-LP64-NEXT: .space 8 |
| 351 | // CHECK-LP64-NEXT: .quad 18446744073709551576 |
| 352 | // CHECK-LP64-NEXT: .quad __ZTI7test9_D |
| 353 | // CHECK-LP64-NEXT: .quad __ZN8test9_B36funcB3Ev |
| 354 | // CHECK-LP64-NEXT: .space 8 |
| 355 | // CHECK-LP64-NEXT: .quad 32 |
| 356 | // CHECK-LP64-NEXT: .quad 16 |
| 357 | // CHECK-LP64-NEXT: .quad 18446744073709551560 |
| 358 | // CHECK-LP64-NEXT: .quad __ZTI7test9_D |
| 359 | // CHECK-LP64-NEXT: .quad __ZN9test9_B217funcB21Ev |
| 360 | // CHECK-LP64-NEXT: .space 8 |
| 361 | // CHECK-LP64-NEXT: .quad 16 |
| 362 | // CHECK-LP64-NEXT: .quad 18446744073709551544 |
| 363 | // CHECK-LP64-NEXT: .quad __ZTI7test9_D |
| 364 | // CHECK-LP64-NEXT: .quad __ZN9test9_B227funcB22Ev |
| 365 | // CHECK-LP64-NEXT: .space 8 |
| 366 | // CHECK-LP64-NEXT: .quad 18446744073709551528 |
| 367 | // CHECK-LP64-NEXT: .quad __ZTI7test9_D |
| 368 | // CHECK-LP64-NEXT: .quad __ZN9test9_B237funcB23Ev |
| 369 | // CHECK-LP64-NEXT: .space 8 |
| 370 | // CHECK-LP64-NEXT: .quad 64 |
| 371 | // CHECK-LP64-NEXT: .quad 48 |
| 372 | // CHECK-LP64-NEXT: .quad 32 |
| 373 | // CHECK-LP64-NEXT: .quad 16 |
| 374 | // CHECK-LP64-NEXT: .quad 18446744073709551512 |
| 375 | // CHECK-LP64-NEXT: .quad __ZTI7test9_D |
| 376 | // CHECK-LP64-NEXT: .quad __ZN9test9_B317funcB31Ev |
| 377 | // CHECK-LP64-NEXT: .space 8 |
| 378 | // CHECK-LP64-NEXT: .quad 32 |
| 379 | // CHECK-LP64-NEXT: .quad 16 |
| 380 | // CHECK-LP64-NEXT: .quad 18446744073709551496 |
| 381 | // CHECK-LP64-NEXT: .quad __ZTI7test9_D |
| 382 | // CHECK-LP64-NEXT: .quad __ZN9test9_B327funcB32Ev |
| 383 | // CHECK-LP64-NEXT: .space 8 |
| 384 | // CHECK-LP64-NEXT: .quad 18446744073709551480 |
| 385 | // CHECK-LP64-NEXT: .quad __ZTI7test9_D |
| 386 | // CHECK-LP64-NEXT: .quad __ZN9test9_B337funcB33Ev |
| 387 | // CHECK-LP64-NEXT: .space 8 |
| 388 | // CHECK-LP64-NEXT: .quad 18446744073709551464 |
| 389 | // CHECK-LP64-NEXT: .quad __ZTI7test9_D |
| 390 | // CHECK-LP64-NEXT: .quad __ZN10test9_B2328funcB232Ev |
| 391 | // CHECK-LP64-NEXT: .space 8 |
| 392 | // CHECK-LP64-NEXT: .quad 18446744073709551448 |
| 393 | // CHECK-LP64-NEXT: .quad __ZTI7test9_D |
| 394 | // CHECK-LP64-NEXT: .quad __ZN10test9_B2318funcB231Ev |
| 395 | |
Mike Stump | 09765ec | 2009-08-19 02:53:08 +0000 | [diff] [blame] | 396 | |
Mike Stump | b983744 | 2009-08-20 07:22:17 +0000 | [diff] [blame] | 397 | struct test10_O { int i; }; |
| 398 | |
| 399 | struct test10_B1 : virtual test10_O { |
| 400 | virtual void ftest10_B1() { } |
| 401 | }; |
| 402 | |
| 403 | struct test10_B2aa : virtual test10_O { |
| 404 | int i; |
| 405 | }; |
| 406 | struct test10_B2ab : virtual test10_O { |
| 407 | int i; |
| 408 | }; |
| 409 | struct test10_B2a : virtual test10_B2aa, virtual test10_B2ab,virtual test10_O { |
| 410 | virtual void ftest10_B2a() { } |
| 411 | }; |
| 412 | struct test10_B2b : virtual test10_O { |
| 413 | virtual void ftest10_B2b() { } |
| 414 | }; |
| 415 | struct test10_B2 : test10_B2a { |
| 416 | virtual void ftest10_B2() { } |
| 417 | }; |
| 418 | class test10_D : test10_B1, test10_B2 { |
| 419 | |
| 420 | void ftest10_B2aa() { } |
| 421 | }; |
| 422 | |
| 423 | // CHECK-LP64:__ZTV8test10_D: |
| 424 | // CHECK-LP64-NEXT: .quad 40 |
| 425 | // CHECK-LP64-NEXT: .quad 24 |
| 426 | // CHECK-LP64-NEXT: .quad 16 |
| 427 | // CHECK-LP64-NEXT: .space 8 |
| 428 | // CHECK-LP64-NEXT: .quad __ZTI8test10_D |
| 429 | // CHECK-LP64-NEXT: .quad __ZN9test10_B110ftest10_B1Ev |
| 430 | // CHECK-LP64-NEXT: .quad 32 |
| 431 | // CHECK-LP64-NEXT: .quad 8 |
| 432 | // CHECK-LP64-NEXT: .quad 16 |
| 433 | // CHECK-LP64-NEXT: .quad 18446744073709551608 |
| 434 | // CHECK-LP64-NEXT: .quad __ZTI8test10_D |
| 435 | // CHECK-LP64-NEXT: .quad __ZN10test10_B2a11ftest10_B2aEv |
| 436 | // CHECK-LP64-NEXT: .quad __ZN9test10_B210ftest10_B2Ev |
| 437 | // CHECK-LP64-NEXT: .quad 18446744073709551608 |
| 438 | // CHECK-LP64-NEXT: .quad 18446744073709551592 |
| 439 | // CHECK-LP64-NEXT: .quad __ZTI8test10_D |
| 440 | // CHECK-LP64-NEXT: .quad 18446744073709551592 |
| 441 | // CHECK-LP64-NEXT: .quad 18446744073709551576 |
| 442 | // CHECK-LP64-NEXT: .quad __ZTI8test10_D |
| 443 | |
Mike Stump | b983744 | 2009-08-20 07:22:17 +0000 | [diff] [blame] | 444 | |
Mike Stump | b9871a2 | 2009-08-21 01:45:00 +0000 | [diff] [blame] | 445 | struct test11_B { |
| 446 | virtual void B1() { } |
| 447 | virtual void D() { } |
| 448 | virtual void B2() { } |
| 449 | }; |
| 450 | |
| 451 | struct test11_D : test11_B { |
| 452 | virtual void D1() { } |
| 453 | virtual void D() { } |
| 454 | virtual void D2() { } |
| 455 | }; |
| 456 | |
Mike Stump | b9871a2 | 2009-08-21 01:45:00 +0000 | [diff] [blame] | 457 | // CHECK-LP64:__ZTV8test11_D: |
| 458 | // CHECK-LP64-NEXT: .space 8 |
| 459 | // CHECK-LP64-NEXT: .quad __ZTI8test11_D |
| 460 | // CHECK-LP64-NEXT: .quad __ZN8test11_B2B1Ev |
| 461 | // CHECK-LP64-NEXT: .quad __ZN8test11_D1DEv |
| 462 | // CHECK-LP64-NEXT: .quad __ZN8test11_B2B2Ev |
| 463 | // CHECK-LP64-NEXT: .quad __ZN8test11_D2D1Ev |
| 464 | // CHECK-LP64-NEXT: .quad __ZN8test11_D2D2Ev |
Mike Stump | b983744 | 2009-08-20 07:22:17 +0000 | [diff] [blame] | 465 | |
Mike Stump | dec025b | 2009-09-07 04:27:52 +0000 | [diff] [blame] | 466 | struct test13_B { |
| 467 | virtual void B1() { } |
| 468 | virtual void D() { } |
| 469 | virtual void Da(); |
| 470 | virtual void Db() { } |
| 471 | virtual void Dc() { } |
| 472 | virtual void B2() { } |
| 473 | int i; |
| 474 | }; |
| 475 | |
| 476 | |
| 477 | struct test13_NV1 { |
| 478 | virtual void fooNV1() { } |
| 479 | virtual void D() { } |
| 480 | }; |
| 481 | |
| 482 | |
| 483 | struct test13_B2 : /* test13_NV1, */ virtual test13_B { |
| 484 | virtual void B2a() { } |
| 485 | virtual void B2() { } |
| 486 | virtual void D() { } |
| 487 | virtual void Da(); |
| 488 | virtual void Dd() { } |
| 489 | virtual void B2b() { } |
| 490 | int i; |
| 491 | }; |
| 492 | |
| 493 | |
| 494 | struct test13_D : test13_NV1, virtual test13_B2 { |
| 495 | virtual void D1() { } |
| 496 | virtual void D() { } |
| 497 | virtual void Db() { } |
| 498 | virtual void Dd() { } |
| 499 | virtual void D2() { } |
| 500 | virtual void fooNV1() { } |
Mike Stump | d9878a1 | 2009-10-13 10:55:21 +0000 | [diff] [blame] | 501 | }; |
Mike Stump | dec025b | 2009-09-07 04:27:52 +0000 | [diff] [blame] | 502 | |
| 503 | // CHECK-LP64:__ZTV8test13_D: |
| 504 | // CHECK-LP64-NEXT: .quad 24 |
| 505 | // CHECK-LP64-NEXT: .quad 8 |
| 506 | // CHECK-LP64-NEXT: .space 8 |
| 507 | // CHECK-LP64-NEXT: .quad __ZTI8test13_D |
| 508 | // CHECK-LP64-NEXT: .quad __ZN8test13_D6fooNV1Ev |
| 509 | // CHECK-LP64-NEXT: .quad __ZN8test13_D1DEv |
| 510 | // CHECK-LP64-NEXT: .quad __ZN8test13_D2D1Ev |
| 511 | // CHECK-LP64-NEXT: .quad __ZN8test13_D2DbEv |
| 512 | // CHECK-LP64-NEXT: .quad __ZN8test13_D2DdEv |
| 513 | // CHECK-LP64-NEXT: .quad __ZN8test13_D2D2Ev |
| 514 | // CHECK-LP64-NEXT: .space 8 |
| 515 | // CHECK-LP64-NEXT: .quad 18446744073709551608 |
| 516 | // CHECK-LP64-NEXT: .space 8 |
| 517 | // CHECK-LP64-NEXT: .quad 18446744073709551608 |
| 518 | // CHECK-LP64-NEXT: .space 8 |
| 519 | // CHECK-LP64-NEXT: .space 8 |
| 520 | // CHECK-LP64-NEXT: .quad 16 |
| 521 | // CHECK-LP64-NEXT: .quad 18446744073709551608 |
| 522 | // CHECK-LP64-NEXT: .quad __ZTI8test13_D |
| 523 | // CHECK-LP64-NEXT: .quad __ZN9test13_B23B2aEv |
| 524 | // CHECK-LP64-NEXT: .quad __ZN9test13_B22B2Ev |
| 525 | // CHECK-LP64-NEXT: .quad __ZTv0_n48_N8test13_D1DEv |
| 526 | // CHECK-LP64-NEXT: .quad __ZN9test13_B22DaEv |
| 527 | // CHECK-LP64-NEXT: .quad __ZTv0_n64_N8test13_D2DdEv |
| 528 | // CHECK-LP64-NEXT: .quad __ZN9test13_B23B2bEv |
| 529 | // CHECK-LP64-NEXT: .quad 18446744073709551600 |
| 530 | // CHECK-LP64-NEXT: .space 8 |
| 531 | // CHECK-LP64-NEXT: .quad 18446744073709551592 |
| 532 | // CHECK-LP64-NEXT: .quad 18446744073709551600 |
| 533 | // CHECK-LP64-NEXT: .quad 18446744073709551592 |
| 534 | // CHECK-LP64-NEXT: .space 8 |
| 535 | // CHECK-LP64-NEXT: .quad 18446744073709551592 |
| 536 | // CHECK-LP64-NEXT: .quad __ZTI8test13_D |
| 537 | // CHECK-LP64-NEXT: .quad __ZN8test13_B2B1Ev |
| 538 | // CHECK-LP64-NEXT: .quad __ZTv0_n32_N8test13_D1DEv |
| 539 | // CHECK-LP64-NEXT: .quad __ZTv0_n40_N9test13_B22DaEv |
| 540 | // CHECK-LP64-NEXT: .quad __ZTv0_n48_N8test13_D2DbEv |
| 541 | // CHECK-LP64-NEXT: .quad __ZN8test13_B2DcEv |
| 542 | // CHECK-LP64-NEXT: .quad __ZTv0_n64_N9test13_B22B2Ev |
| 543 | |
Mike Stump | 09765ec | 2009-08-19 02:53:08 +0000 | [diff] [blame] | 544 | |
Mike Stump | d9878a1 | 2009-10-13 10:55:21 +0000 | [diff] [blame] | 545 | class test14 { |
| 546 | public: |
| 547 | virtual void initWithInt(int a); |
| 548 | static test14 *withInt(int a); |
| 549 | }; |
| 550 | |
| 551 | void test14::initWithInt(int a) { } |
| 552 | |
| 553 | test14 *test14::withInt(int a) { |
| 554 | test14 *me = new test14; |
| 555 | me->initWithInt(a); |
| 556 | return me; |
| 557 | } |
| 558 | |
| 559 | |
| 560 | struct test15_B { |
| 561 | virtual test15_B *foo1() { return 0; } |
| 562 | virtual test15_B *foo2() { return 0; } |
| 563 | virtual test15_B *foo3() { return 0; } |
| 564 | int i; |
| 565 | }; |
| 566 | |
| 567 | struct test15_NV1 { |
| 568 | virtual void fooNV1() { } |
| 569 | int i; |
| 570 | }; |
| 571 | |
| 572 | struct test15_B2 : test15_NV1, virtual test15_B { |
| 573 | virtual test15_B2 *foo1() { return 0; } |
| 574 | virtual test15_B2 *foo2() { return 0; } |
| 575 | int i; |
| 576 | }; |
| 577 | |
| 578 | struct test15_D : test15_NV1, virtual test15_B2 { |
| 579 | virtual test15_D *foo1() { return 0; } |
| 580 | }; |
| 581 | |
| 582 | // CHECK-LP64:__ZTV8test15_D: |
| 583 | // CHECK-LP64-NEXT: .quad 32 |
| 584 | // CHECK-LP64-NEXT: .quad 16 |
| 585 | // CHECK-LP64-NEXT: .space 8 |
| 586 | // CHECK-LP64-NEXT: .quad __ZTI8test15_D |
| 587 | // CHECK-LP64-NEXT: .quad __ZN10test15_NV16fooNV1Ev |
| 588 | // CHECK-LP64-NEXT: .quad __ZN8test15_D4foo1Ev |
| 589 | // CHECK-LP64-NEXT: .space 8 |
| 590 | // CHECK-LP64-NEXT: .quad 18446744073709551600 |
| 591 | // CHECK-LP64-NEXT: .space 8 |
| 592 | // CHECK-LP64-NEXT: .quad 16 |
| 593 | // CHECK-LP64-NEXT: .quad 18446744073709551600 |
| 594 | // CHECK-LP64-NEXT: .quad __ZTI8test15_D |
| 595 | // CHECK-LP64-NEXT: .quad __ZN10test15_NV16fooNV1Ev |
| 596 | // CHECK-LP64-NEXT: .quad __ZTcv0_n40_v0_n24_N8test15_D4foo1Ev |
| 597 | // CHECK-LP64-NEXT: .quad __ZN9test15_B24foo2Ev |
| 598 | // CHECK-LP64-NEXT: .space 8 |
| 599 | // CHECK-LP64-NEXT: .quad 18446744073709551600 |
| 600 | // CHECK-LP64-NEXT: .quad 18446744073709551584 |
| 601 | // CHECK-LP64-NEXT: .quad 18446744073709551584 |
| 602 | // CHECK-LP64-NEXT: .quad __ZTI8test15_D |
| 603 | // CHECK-LP64-NEXT: .quad __ZTcv0_n24_v0_n32_N8test15_D4foo1Ev |
| 604 | // CHECK-LP64-NEXT: .quad __ZTcv0_n32_v0_n24_N9test15_B24foo2Ev |
| 605 | // CHECK-LP64-NEXT: .quad __ZN8test15_B4foo3Ev |
| 606 | |
Mike Stump | d9878a1 | 2009-10-13 10:55:21 +0000 | [diff] [blame] | 607 | |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 608 | struct test16_NV1 { |
| 609 | virtual void fooNV1() { } |
| 610 | virtual void foo_NV1() { } |
| 611 | int i; |
| 612 | }; |
| 613 | |
| 614 | struct test16_NV2 { |
| 615 | virtual test16_NV2* foo1() { return 0; } |
| 616 | virtual void foo_NV2() { } |
| 617 | virtual void foo_NV2b() { } |
| 618 | int i; |
| 619 | }; |
| 620 | |
| 621 | struct test16_B : public test16_NV1, test16_NV2 { |
| 622 | virtual test16_B *foo1() { return 0; } |
| 623 | virtual test16_B *foo2() { return 0; } |
| 624 | virtual test16_B *foo3() { return 0; } |
| 625 | virtual void foo_B() { } |
| 626 | int i; |
| 627 | }; |
| 628 | |
| 629 | struct test16_B2 : test16_NV1, virtual test16_B { |
| 630 | virtual test16_B2 *foo1() { return 0; } |
| 631 | virtual test16_B2 *foo2() { return 0; } |
| 632 | virtual void foo_B2() { } |
| 633 | int i; |
| 634 | }; |
| 635 | |
| 636 | struct test16_D : test16_NV1, virtual test16_B2 { |
Mike Stump | 941e3f3 | 2009-11-05 05:01:19 +0000 | [diff] [blame] | 637 | virtual void bar(); |
| 638 | virtual test16_D *foo1(); |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 639 | }; |
| 640 | |
Mike Stump | 941e3f3 | 2009-11-05 05:01:19 +0000 | [diff] [blame] | 641 | void test16_D::bar() { } |
| 642 | |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 643 | // CHECK-LP64: __ZTV8test16_D: |
| 644 | // CHECK-LP64-NEXT: .quad 32 |
| 645 | // CHECK-LP64-NEXT: .quad 16 |
| 646 | // CHECK-LP64-NEXT: .space 8 |
| 647 | // CHECK-LP64-NEXT: .quad __ZTI8test16_D |
| 648 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV16fooNV1Ev |
| 649 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV17foo_NV1Ev |
Mike Stump | 941e3f3 | 2009-11-05 05:01:19 +0000 | [diff] [blame] | 650 | // CHECK-LP64-NEXT: .quad __ZN8test16_D3barEv |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 651 | // CHECK-LP64-NEXT: .quad __ZN8test16_D4foo1Ev |
| 652 | // CHECK-LP64-NEXT: .space 8 |
| 653 | // CHECK-LP64-NEXT: .space 8 |
| 654 | // CHECK-LP64-NEXT: .quad 18446744073709551600 |
| 655 | // CHECK-LP64-NEXT: .space 8 |
| 656 | // CHECK-LP64-NEXT: .space 8 |
| 657 | // CHECK-LP64-NEXT: .quad 16 |
| 658 | // CHECK-LP64-NEXT: .quad 18446744073709551600 |
| 659 | // CHECK-LP64-NEXT: .quad __ZTI8test16_D |
| 660 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV16fooNV1Ev |
| 661 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV17foo_NV1Ev |
| 662 | // CHECK-LP64-NEXT: .quad __ZTcv0_n48_v0_n24_N8test16_D4foo1Ev |
| 663 | // CHECK-LP64-NEXT: .quad __ZN9test16_B24foo2Ev |
| 664 | // CHECK-LP64-NEXT: .quad __ZN9test16_B26foo_B2Ev |
| 665 | // CHECK-LP64-NEXT .quad 16 |
| 666 | // CHECK-LP64-NEXT .quad 16 |
| 667 | // CHECK-LP64-NEXT: .space 8 |
| 668 | // CHECK-LP64-NEXT: .space 8 |
| 669 | // CHECK-LP64: .quad 18446744073709551600 |
| 670 | // CHECK-LP64: .quad 18446744073709551584 |
| 671 | // CHECK-LP64-NEXT: .space 8 |
| 672 | // CHECK-LP64-NEXT: .space 8 |
| 673 | // CHECK-LP64-NEXT: .quad 18446744073709551584 |
| 674 | // CHECK-LP64-NEXT: .quad __ZTI8test16_D |
| 675 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV16fooNV1Ev |
| 676 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV17foo_NV1Ev |
| 677 | // CHECK-LP64-NEXT: .quad __ZTcv0_n40_v0_n32_N8test16_D4foo1Ev |
| 678 | // CHECK-LP64-NEXT: .quad __ZTcv0_n48_v0_n24_N9test16_B24foo2Ev |
| 679 | // CHECK-LP64-NEXT: .quad __ZN8test16_B4foo3Ev |
| 680 | // CHECK-LP64-NEXT: .quad __ZN8test16_B5foo_BEv |
| 681 | // CHECK-LP64-NEXT: .quad 18446744073709551568 |
| 682 | // CHECK-LP64-NEXT: .quad __ZTI8test16_D |
| 683 | // CHECK-LP64-NEXT .quad __ZTcvn16_n40_v16_n32_N8test16_D4foo1Ev |
| 684 | // CHECK-LP64: .quad __ZN10test16_NV27foo_NV2Ev |
| 685 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV28foo_NV2bEv |
| 686 | |
Mike Stump | d9878a1 | 2009-10-13 10:55:21 +0000 | [diff] [blame] | 687 | |
Mike Stump | 941e3f3 | 2009-11-05 05:01:19 +0000 | [diff] [blame] | 688 | // FIXME: This is the wrong thunk, but until these issues are fixed, better |
| 689 | // than nothing. |
Mike Stump | 599837a | 2009-11-06 00:18:25 +0000 | [diff] [blame] | 690 | // CHECK-LPLL64:define weak %class.test8_D* @_ZTcvn16_n72_v16_n32_N8test16_D4foo1Ev(%class.test8_D*) { |
| 691 | // CHECK-LPLL64:entry: |
| 692 | // CHECK-LPLL64: %retval = alloca %class.test8_D* |
| 693 | // CHECK-LPLL64: %.addr = alloca %class.test8_D* |
| 694 | // CHECK-LPLL64: store %class.test8_D* %0, %class.test8_D** %.addr |
| 695 | // CHECK-LPLL64: %this = load %class.test8_D** %.addr |
| 696 | // CHECK-LPLL64: %1 = bitcast %class.test8_D* %this to i8* |
| 697 | // CHECK-LPLL64: %2 = getelementptr inbounds i8* %1, i64 -16 |
| 698 | // CHECK-LPLL64: %3 = bitcast i8* %2 to %class.test8_D* |
| 699 | // CHECK-LPLL64: %4 = bitcast %class.test8_D* %3 to i8* |
| 700 | // CHECK-LPLL64: %5 = bitcast %class.test8_D* %3 to i64** |
| 701 | // CHECK-LPLL64: %vtable = load i64** %5 |
| 702 | // CHECK-LPLL64: %6 = getelementptr inbounds i64* %vtable, i64 -9 |
| 703 | // CHECK-LPLL64: %7 = load i64* %6 |
| 704 | // CHECK-LPLL64: %8 = getelementptr i8* %4, i64 %7 |
| 705 | // CHECK-LPLL64: %9 = bitcast i8* %8 to %class.test8_D* |
| 706 | // CHECK-LPLL64: %call = call %class.test8_D* @_ZTch0_v16_n32_N8test16_D4foo1Ev(%class.test8_D* %9) |
| 707 | // CHECK-LPLL64: store %class.test8_D* %call, %class.test8_D** %retval |
| 708 | // CHECK-LPLL64: %10 = load %class.test8_D** %retval |
| 709 | // CHECK-LPLL64: ret %class.test8_D* %10 |
| 710 | // CHECK-LPLL64:} |
Mike Stump | 941e3f3 | 2009-11-05 05:01:19 +0000 | [diff] [blame] | 711 | |
Mike Stump | 599837a | 2009-11-06 00:18:25 +0000 | [diff] [blame] | 712 | // CHECK-LPLL64:define weak %class.test8_D* @_ZTch0_v16_n32_N8test16_D4foo1Ev36(%class.test8_D*) { |
| 713 | // CHECK-LPLL64:entry: |
| 714 | // CHECK-LPLL64: %retval = alloca %class.test8_D* |
| 715 | // CHECK-LPLL64: %.addr = alloca %class.test8_D* |
| 716 | // CHECK-LPLL64: store %class.test8_D* %0, %class.test8_D** %.addr |
| 717 | // CHECK-LPLL64: %this = load %class.test8_D** %.addr |
| 718 | // CHECK-LPLL64: %call = call %class.test8_D* @_ZN8test16_D4foo1Ev(%class.test8_D* %this) |
| 719 | // CHECK-LPLL64: %1 = icmp ne %class.test8_D* %call, null |
| 720 | // CHECK-LPLL64: br i1 %1, label %2, label %12 |
| 721 | // CHECK-LPLL64:; <label>:2 |
| 722 | // CHECK-LPLL64: %3 = bitcast %class.test8_D* %call to i8* |
| 723 | // CHECK-LPLL64: %4 = getelementptr inbounds i8* %3, i64 16 |
| 724 | // CHECK-LPLL64: %5 = bitcast i8* %4 to %class.test8_D* |
| 725 | // CHECK-LPLL64: %6 = bitcast %class.test8_D* %5 to i8* |
| 726 | // CHECK-LPLL64: %7 = bitcast %class.test8_D* %5 to i64** |
| 727 | // CHECK-LPLL64: %vtable = load i64** %7 |
| 728 | // CHECK-LPLL64: %8 = getelementptr inbounds i64* %vtable, i64 -4 |
| 729 | // CHECK-LPLL64: %9 = load i64* %8 |
| 730 | // CHECK-LPLL64: %10 = getelementptr i8* %6, i64 %9 |
| 731 | // CHECK-LPLL64: %11 = bitcast i8* %10 to %class.test8_D* |
| 732 | // CHECK-LPLL64: br label %13 |
| 733 | // CHECK-LPLL64:; <label>:12 |
| 734 | // CHECK-LPLL64: br label %13 |
| 735 | // CHECK-LPLL64:; <label>:13 |
| 736 | // CHECK-LPLL64: %14 = phi %class.test8_D* [ %11, %2 ], [ %call, %12 ] |
| 737 | // CHECK-LPLL64: store %class.test8_D* %14, %class.test8_D** %retval |
| 738 | // CHECK-LPLL64: %15 = load %class.test8_D** %retval |
| 739 | // CHECK-LPLL64: ret %class.test8_D* %15 |
| 740 | // CHECK-LPLL64:} |
Mike Stump | 941e3f3 | 2009-11-05 05:01:19 +0000 | [diff] [blame] | 741 | |
| 742 | |
Mike Stump | 7809e0d | 2009-10-28 00:35:46 +0000 | [diff] [blame] | 743 | class test17_B1 { |
| 744 | virtual void foo() = 0; |
| 745 | virtual void bar() { } |
| 746 | }; |
| 747 | |
| 748 | class test17_B2 : public test17_B1 { |
| 749 | void foo() { } |
| 750 | virtual void bar() = 0; |
| 751 | }; |
| 752 | |
| 753 | class test17_D : public test17_B2 { |
| 754 | void bar() { } |
Mike Stump | 62db245 | 2009-11-03 19:28:52 +0000 | [diff] [blame] | 755 | }; |
Mike Stump | 7809e0d | 2009-10-28 00:35:46 +0000 | [diff] [blame] | 756 | |
| 757 | |
| 758 | // CHECK-LP64:__ZTV8test17_D: |
| 759 | // CHECK-LP64-NEXT: .space 8 |
| 760 | // CHECK-LP64-NEXT: .quad __ZTI8test17_D |
| 761 | // CHECK-LP64-NEXT: .quad __ZN9test17_B23fooEv |
| 762 | // CHECK-LP64-NEXT: .quad __ZN8test17_D3barEv |
| 763 | |
| 764 | // CHECK-LP64:__ZTV9test17_B2: |
| 765 | // CHECK-LP64-NEXT: .space 8 |
| 766 | // CHECK-LP64-NEXT: .quad __ZTI9test17_B2 |
| 767 | // CHECK-LP64-NEXT: .quad __ZN9test17_B23fooEv |
| 768 | // CHECK-LP64-NEXT: .quad ___cxa_pure_virtual |
| 769 | |
| 770 | // CHECK-LP64:__ZTV9test17_B1: |
| 771 | // CHECK-LP64-NEXT: .space 8 |
| 772 | // CHECK-LP64-NEXT: .quad __ZTI9test17_B1 |
| 773 | // CHECK-LP64-NEXT: .quad ___cxa_pure_virtual |
| 774 | // CHECK-LP64-NEXT: .quad __ZN9test17_B13barEv |
| 775 | |
| 776 | |
Mike Stump | 9c21289 | 2009-11-03 19:03:17 +0000 | [diff] [blame] | 777 | struct test18_NV1 { |
| 778 | virtual void fooNV1() { } |
| 779 | virtual void foo_NV1() { } |
| 780 | int i; |
| 781 | }; |
| 782 | |
| 783 | struct test18_NV2 { |
| 784 | virtual test18_NV2& foo1() { return *this; } |
| 785 | virtual void foo_NV2() { } |
| 786 | virtual void foo_NV2b() { } |
| 787 | int i; |
| 788 | }; |
| 789 | |
| 790 | struct test18_B : public test18_NV1, test18_NV2 { |
| 791 | virtual test18_B& foo1() { return *this; } |
| 792 | virtual test18_B *foo2() { return 0; } |
| 793 | virtual test18_B *foo3() { return 0; } |
| 794 | virtual void foo_B() { } |
| 795 | int i; |
| 796 | }; |
| 797 | |
| 798 | struct test18_B2 : test18_NV1, virtual test18_B { |
| 799 | virtual test18_B2& foo1() { return *this; } |
| 800 | virtual test18_B2 *foo2() { return 0; } |
| 801 | virtual void foo_B2() { } |
| 802 | int i; |
| 803 | }; |
| 804 | |
| 805 | struct test18_D : test18_NV1, virtual test18_B2 { |
| 806 | virtual test18_D& foo1() { return *this; } |
Mike Stump | 62db245 | 2009-11-03 19:28:52 +0000 | [diff] [blame] | 807 | }; |
| 808 | |
| 809 | |
| 810 | struct test19_VB1 { }; |
| 811 | struct test19_B1 : public virtual test19_VB1 { |
| 812 | virtual void fB1() { } |
| 813 | virtual void foB1B2() { } |
| 814 | virtual void foB1B3() { } |
| 815 | virtual void foB1B4() { } |
| 816 | }; |
| 817 | |
| 818 | struct test19_VB2 { }; |
| 819 | struct test19_B2: public test19_B1, public virtual test19_VB2 { |
| 820 | virtual void foB1B2() { } |
| 821 | virtual void foB1B3() { } |
| 822 | virtual void foB1B4() { } |
| 823 | |
| 824 | virtual void fB2() { } |
| 825 | virtual void foB2B3() { } |
| 826 | virtual void foB2B4() { } |
| 827 | }; |
| 828 | |
| 829 | struct test19_VB3 { }; |
| 830 | struct test19_B3: virtual public test19_B2, public virtual test19_VB3 { |
| 831 | virtual void foB1B3() { } |
| 832 | virtual void foB1B4() { } |
| 833 | |
| 834 | virtual void foB2B3() { } |
| 835 | virtual void foB2B4() { } |
| 836 | |
| 837 | virtual void fB3() { } |
| 838 | virtual void foB3B4() { } |
| 839 | }; |
| 840 | |
| 841 | struct test19_VB4 { }; |
| 842 | struct test19_B4: public test19_B3, public virtual test19_VB4 { |
| 843 | virtual void foB1B4() { } |
| 844 | |
| 845 | virtual void foB2B4() { } |
| 846 | |
| 847 | virtual void foB3B4() { } |
| 848 | |
| 849 | virtual void fB4() { } |
| 850 | }; |
| 851 | |
| 852 | struct test19_D : virtual test19_B4 { |
| 853 | }; |
| 854 | |
| 855 | |
| 856 | // CHECK-LP64: __ZTV8test19_D: |
| 857 | // CHECK-LP64-NEXT: .space 8 |
| 858 | // CHECK-LP64-NEXT: .space 8 |
| 859 | // CHECK-LP64-NEXT: .space 8 |
| 860 | // CHECK-LP64-NEXT: .space 8 |
| 861 | // CHECK-LP64-NEXT: .space 8 |
| 862 | // CHECK-LP64-NEXT: .space 8 |
| 863 | // CHECK-LP64-NEXT: .space 8 |
| 864 | // CHECK-LP64-NEXT: .space 8 |
| 865 | // CHECK-LP64-NEXT: .space 8 |
| 866 | // CHECK-LP64-NEXT: .space 8 |
| 867 | // CHECK-LP64-NEXT: .space 8 |
| 868 | // CHECK-LP64-NEXT: .space 8 |
| 869 | // CHECK-LP64-NEXT: .space 8 |
| 870 | // CHECK-LP64-NEXT: .space 8 |
| 871 | // CHECK-LP64-NEXT: .space 8 |
| 872 | // CHECK-LP64-NEXT: .space 8 |
| 873 | // CHECK-LP64-NEXT: .space 8 |
| 874 | // CHECK-LP64-NEXT: .quad __ZTI8test19_D |
| 875 | // CHECK-LP64-NEXT .quad __ZN9test19_B13fB1Ev |
| 876 | // CHECK-LP64-NEXT .quad __ZN9test19_B26foB1B2Ev |
| 877 | // CHECK-LP64-NEXT .quad __ZN9test19_B36foB1B3Ev |
| 878 | // CHECK-LP64-NEXT .quad __ZN9test19_B46foB1B4Ev |
| 879 | // CHECK-LP64-NEXT .quad __ZN9test19_B23fB2Ev |
| 880 | // CHECK-LP64-NEXT .quad __ZN9test19_B36foB2B3Ev |
| 881 | // CHECK-LP64-NEXT .quad __ZN9test19_B46foB2B4Ev |
| 882 | // CHECK-LP64-NEXT .quad __ZN9test19_B33fB3Ev |
| 883 | // CHECK-LP64-NEXT .quad __ZN9test19_B46foB3B4Ev |
| 884 | // CHECK-LP64-NEXT .quad __ZN9test19_B43fB4Ev |
| 885 | |
Mike Stump | 9c21289 | 2009-11-03 19:03:17 +0000 | [diff] [blame] | 886 | |
Mike Stump | 99faefd | 2009-11-05 05:26:28 +0000 | [diff] [blame] | 887 | class test20_V { |
| 888 | virtual void foo1(); |
| 889 | }; |
| 890 | class test20_V1 { |
| 891 | virtual void foo2(); |
| 892 | }; |
| 893 | class test20_B : virtual test20_V { |
| 894 | } b; |
| 895 | class test20_B1 : virtual test20_V1 { |
| 896 | }; |
| 897 | class test20_D : public test20_B, public test20_B1 { |
| 898 | } d; |
| 899 | |
| 900 | // CHECK-LP64: __ZTV8test20_D: |
| 901 | // CHECK-LP64-NEXT: .quad 8 |
| 902 | // CHECK-LP64-NEXT: .space 8 |
| 903 | // CHECK-LP64-NEXT: .space 8 |
| 904 | // CHECK-LP64-NEXT: .space 8 |
| 905 | // CHECK-LP64-NEXT: .quad __ZTI8test20_D |
| 906 | // CHECK-LP64-NEXT: .quad __ZN8test20_V4foo1Ev |
| 907 | // CHECK-LP64-NEXT: .space 8 |
| 908 | // CHECK-LP64-NEXT: .space 8 |
| 909 | // CHECK-LP64-NEXT: .quad 18446744073709551608 |
| 910 | // CHECK-LP64-NEXT: .quad __ZTI8test20_D |
| 911 | // CHECK-LP64-NEXT: .quad __ZN9test20_V14foo2Ev |
| 912 | |
| 913 | |
Mike Stump | 7809e0d | 2009-10-28 00:35:46 +0000 | [diff] [blame] | 914 | |
Mike Stump | 26899b0 | 2009-08-05 22:48:36 +0000 | [diff] [blame] | 915 | // CHECK-LP64: __ZTV1B: |
Mike Stump | b46c92d | 2009-08-19 02:06:38 +0000 | [diff] [blame] | 916 | // CHECK-LP64-NEXT: .space 8 |
| 917 | // CHECK-LP64-NEXT: .quad __ZTI1B |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 918 | // CHECK-LP64-NEXT: .quad __ZN1B4bar1Ev |
| 919 | // CHECK-LP64-NEXT: .quad __ZN1B4bar2Ev |
Mike Stump | 26899b0 | 2009-08-05 22:48:36 +0000 | [diff] [blame] | 920 | |
Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame] | 921 | // CHECK-LP64: __ZTV1A: |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 922 | // CHECK-LP64-NEXT: .space 8 |
Mike Stump | b46c92d | 2009-08-19 02:06:38 +0000 | [diff] [blame] | 923 | // CHECK-LP64-NEXT: .quad __ZTI1A |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 924 | // CHECK-LP64-NEXT: .quad __ZN1B4bar1Ev |
| 925 | // CHECK-LP64-NEXT: .quad __ZN1B4bar2Ev |
| 926 | // CHECK-LP64-NEXT: .quad __ZN1A4foo1Ev |
| 927 | // CHECK-LP64-NEXT: .quad __ZN1A4foo2Ev |
Mike Stump | b46c92d | 2009-08-19 02:06:38 +0000 | [diff] [blame] | 928 | // CHECK-LP64-NEXT: .quad 18446744073709551600 |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 929 | // CHECK-LP64-NEXT: .quad __ZTI1A |
| 930 | // CHECK-LP64-NEXT: .quad __ZN1C4bee1Ev |
| 931 | // CHECK-LP64-NEXT: .quad __ZN1C4bee2Ev |
Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame] | 932 | |
Mike Stump | 8a12b56 | 2009-08-06 15:50:11 +0000 | [diff] [blame] | 933 | // CHECK-LP64: __ZTV1F: |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 934 | // CHECK-LP64-NEXT: .space 8 |
| 935 | // CHECK-LP64-NEXT: .quad 16 |
| 936 | // CHECK-LP64-NEXT: .space 8 |
| 937 | // CHECK-LP64-NEXT: .space 8 |
Mike Stump | b46c92d | 2009-08-19 02:06:38 +0000 | [diff] [blame] | 938 | // CHECK-LP64-NEXT: .quad __ZTI1F |
Mike Stump | 4ec04c4 | 2009-08-16 02:40:14 +0000 | [diff] [blame] | 939 | // CHECK-LP64-NEXT: .quad __ZN1D3booEv |
| 940 | // CHECK-LP64-NEXT: .quad __ZN1F3fooEv |
| 941 | // CHECK-LP64-NEXT: .space 8 |
| 942 | // CHECK-LP64-NEXT: .space 8 |
| 943 | // CHECK-LP64-NEXT: .space 8 |
| 944 | // CHECK-LP64-NEXT: .space 8 |
| 945 | // CHECK-LP64-NEXT: .space 8 |
| 946 | // CHECK-LP64-NEXT: .quad 18446744073709551600 |
| 947 | // CHECK-LP64-NEXT: .quad __ZTI1F |
| 948 | // CHECK-LP64-NEXT: .quad __ZN2D13barEv |
| 949 | // CHECK-LP64-NEXT: .quad __ZN2D14bar2Ev |
| 950 | // CHECK-LP64-NEXT: .quad __ZN2D14bar3Ev |
| 951 | // CHECK-LP64-NEXT: .quad __ZN2D14bar4Ev |
| 952 | // CHECK-LP64-NEXT: .quad __ZN2D14bar5Ev |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 953 | |
Mike Stump | 62db245 | 2009-11-03 19:28:52 +0000 | [diff] [blame] | 954 | test19_D d19; |
| 955 | test18_D d18; |
| 956 | test17_D d17; |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 957 | test16_D d16; |
Mike Stump | d9878a1 | 2009-10-13 10:55:21 +0000 | [diff] [blame] | 958 | test15_D d15; |
| 959 | test13_D d13; |
Mike Stump | b9871a2 | 2009-08-21 01:45:00 +0000 | [diff] [blame] | 960 | test11_D d11; |
Mike Stump | b983744 | 2009-08-20 07:22:17 +0000 | [diff] [blame] | 961 | test10_D d10; |
Mike Stump | 09765ec | 2009-08-19 02:53:08 +0000 | [diff] [blame] | 962 | test9_D d9; |
| 963 | test8_D d8; |
| 964 | |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 965 | test5_D d5; |
Mike Stump | 34fae9c | 2009-08-12 18:50:26 +0000 | [diff] [blame] | 966 | test4_D d4; |
| 967 | test3_D d3; |
Mike Stump | 7884678 | 2009-08-13 23:33:29 +0000 | [diff] [blame] | 968 | |
| 969 | test6_D d6; |
| 970 | test7_D d7; |