Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++0x -O0 -S %s -o %t-64.s |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +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 | |
Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 4 | // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++0x -emit-llvm %s -o %t-64.ll |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 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 | a84b404 | 2009-11-20 00:02:19 +0000 | [diff] [blame] | 7 | |
| 8 | // CHECK-LP64: main: |
| 9 | // CHECK-LP64: movl $1, 12(%rax) |
| 10 | // CHECK-LP64: movl $2, 8(%rax) |
| 11 | |
Mike Stump | 104ffaa | 2009-08-04 21:58:42 +0000 | [diff] [blame] | 12 | struct B { |
| 13 | virtual void bar1(); |
| 14 | virtual void bar2(); |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 15 | int b; |
Mike Stump | 104ffaa | 2009-08-04 21:58:42 +0000 | [diff] [blame] | 16 | }; |
Mike Stump | 6f37633 | 2009-08-05 22:37:18 +0000 | [diff] [blame] | 17 | void B::bar1() { } |
| 18 | void B::bar2() { } |
| 19 | |
Mike Stump | e07b6e5 | 2010-01-22 22:06:55 +0000 | [diff] [blame] | 20 | // CHECK-LPLL64:@_ZTV1B = constant [4 x i8*] [i8* null, i8* bitcast (%0* @_ZTI1B to i8*), i8* bitcast (void (%struct.B*)* @_ZN1B4bar1Ev to i8*), i8* bitcast (void (%struct.B*)* @_ZN1B4bar2Ev to i8*)] |
Mike Stump | a84b404 | 2009-11-20 00:02:19 +0000 | [diff] [blame] | 21 | |
Mike Stump | 6f37633 | 2009-08-05 22:37:18 +0000 | [diff] [blame] | 22 | struct C { |
| 23 | virtual void bee1(); |
| 24 | virtual void bee2(); |
| 25 | }; |
| 26 | void C::bee1() { } |
| 27 | void C::bee2() { } |
Mike Stump | 104ffaa | 2009-08-04 21:58:42 +0000 | [diff] [blame] | 28 | |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 29 | struct D { |
| 30 | virtual void boo(); |
| 31 | }; |
| 32 | void D::boo() { } |
Mike Stump | 104ffaa | 2009-08-04 21:58:42 +0000 | [diff] [blame] | 33 | |
Mike Stump | c5708d9 | 2009-08-06 14:12:47 +0000 | [diff] [blame] | 34 | struct D1 { |
| 35 | virtual void bar(); |
Mike Stump | 02cf1e2 | 2009-08-06 23:48:32 +0000 | [diff] [blame] | 36 | virtual void bar2(); |
| 37 | virtual void bar3(); |
| 38 | virtual void bar4(); |
| 39 | virtual void bar5(); |
Mike Stump | c5708d9 | 2009-08-06 14:12:47 +0000 | [diff] [blame] | 40 | void *d1; |
| 41 | }; |
| 42 | void D1::bar() { } |
| 43 | |
| 44 | class F : virtual public D1, virtual public D { |
| 45 | public: |
| 46 | virtual void foo(); |
| 47 | void *f; |
| 48 | }; |
| 49 | void F::foo() { } |
| 50 | |
Mike Stump | e07b6e5 | 2010-01-22 22:06:55 +0000 | [diff] [blame] | 51 | // CHECK-LPLL64:@_ZTV1F = constant [19 x i8*] [i8* null, i8* inttoptr (i64 16 to i8*), i8* null, i8* null, i8* bitcast (%1* @_ZTI1F to i8*), i8* bitcast (void (%class.test14*)* @_ZN1D3booEv to i8*), i8* bitcast (void (%class.F*)* @_ZN1F3fooEv to i8*), i8* null, i8* null, i8* null, i8* null, i8* null, i8* inttoptr (i64 -16 to i8*), i8* bitcast (%1* @_ZTI1F to i8*), i8* bitcast (void (%struct.D1*)* @_ZN2D13barEv to i8*), i8* bitcast (void (%struct.D1*)* @_ZN2D14bar2Ev to i8*), i8* bitcast (void (%struct.D1*)* @_ZN2D14bar3Ev to i8*), i8* bitcast (void (%struct.D1*)* @_ZN2D14bar4Ev to i8*), i8* bitcast (void (%struct.D1*)* @_ZN2D14bar5Ev to i8*)] |
Mike Stump | a84b404 | 2009-11-20 00:02:19 +0000 | [diff] [blame] | 52 | |
| 53 | |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 54 | struct E { |
| 55 | int e; |
| 56 | }; |
| 57 | |
| 58 | static_assert (sizeof (C) == (sizeof(void *)), "vtable pointer layout"); |
| 59 | |
Mike Stump | eb19fa9 | 2009-08-06 13:41:24 +0000 | [diff] [blame] | 60 | class A : public E, public B, public C { |
Mike Stump | 3dee6ef | 2009-07-30 00:22:38 +0000 | [diff] [blame] | 61 | public: |
Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame] | 62 | virtual void foo1(); |
| 63 | virtual void foo2(); |
| 64 | A() { } |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 65 | int a; |
| 66 | } *ap; |
Mike Stump | 6f37633 | 2009-08-05 22:37:18 +0000 | [diff] [blame] | 67 | void A::foo1() { } |
| 68 | void A::foo2() { } |
Mike Stump | 3dee6ef | 2009-07-30 00:22:38 +0000 | [diff] [blame] | 69 | |
Mike Stump | e07b6e5 | 2010-01-22 22:06:55 +0000 | [diff] [blame] | 70 | // CHECK-LPLL64:@_ZTV1A = constant [10 x i8*] [i8* null, i8* bitcast (%2* @_ZTI1A to i8*), i8* bitcast (void (%struct.B*)* @_ZN1B4bar1Ev to i8*), i8* bitcast (void (%struct.B*)* @_ZN1B4bar2Ev to i8*), i8* bitcast (void (%class.A*)* @_ZN1A4foo1Ev to i8*), i8* bitcast (void (%class.A*)* @_ZN1A4foo2Ev to i8*), i8* inttoptr (i64 -16 to i8*), i8* bitcast (%2* @_ZTI1A to i8*), i8* bitcast (void (%class.test14*)* @_ZN1C4bee1Ev to i8*), i8* bitcast (void (%class.test14*)* @_ZN1C4bee2Ev to i8*)] |
| 71 | |
Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame] | 72 | int main() { |
| 73 | A a; |
Mike Stump | 26899b0 | 2009-08-05 22:48:36 +0000 | [diff] [blame] | 74 | B b; |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 75 | ap->e = 1; |
| 76 | ap->b = 2; |
Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame] | 77 | } |
| 78 | |
Mike Stump | 2effeca | 2009-08-06 00:38:46 +0000 | [diff] [blame] | 79 | |
Mike Stump | f0070db | 2009-08-26 20:46:33 +0000 | [diff] [blame] | 80 | struct test12_A { |
| 81 | virtual void foo0() { } |
| 82 | virtual void foo(); |
| 83 | } *test12_pa; |
| 84 | |
| 85 | struct test12_B : public test12_A { |
| 86 | virtual void foo() { } |
| 87 | } *test12_pb; |
| 88 | |
| 89 | struct test12_D : public test12_B { |
| 90 | } *test12_pd; |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 91 | |
Mike Stump | 941e3f3 | 2009-11-05 05:01:19 +0000 | [diff] [blame] | 92 | |
Mike Stump | 94d0bce | 2009-08-13 00:34:14 +0000 | [diff] [blame] | 93 | struct test6_B2 { virtual void funcB2(); char b[1000]; }; |
| 94 | struct test6_B1 : virtual test6_B2 { virtual void funcB1(); }; |
| 95 | |
| 96 | struct test6_D : test6_B2, virtual test6_B1 { |
| 97 | }; |
| 98 | |
Anders Carlsson | 0d8bb8e | 2010-01-18 03:58:13 +0000 | [diff] [blame] | 99 | // CHECK-LP64: .zerofill __DATA,__common,_d6,2024,4 |
Mike Stump | 94d0bce | 2009-08-13 00:34:14 +0000 | [diff] [blame] | 100 | |
Mike Stump | 7884678 | 2009-08-13 23:33:29 +0000 | [diff] [blame] | 101 | struct test7_B2 { virtual void funcB2(); }; |
| 102 | struct test7_B1 : virtual test7_B2 { virtual void funcB1(); }; |
| 103 | |
| 104 | struct test7_D : test7_B2, virtual test7_B1 { |
| 105 | }; |
| 106 | |
Anders Carlsson | 0d8bb8e | 2010-01-18 03:58:13 +0000 | [diff] [blame] | 107 | // CHECK-LP64: .zerofill __DATA,__common,_d7,16,3 |
Mike Stump | 94d0bce | 2009-08-13 00:34:14 +0000 | [diff] [blame] | 108 | |
| 109 | |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 110 | struct test3_B3 { virtual void funcB3(); }; |
| 111 | struct test3_B2 : virtual test3_B3 { virtual void funcB2(); }; |
| 112 | struct test3_B1 : virtual test3_B2 { virtual void funcB1(); }; |
| 113 | |
Mike Stump | f0070db | 2009-08-26 20:46:33 +0000 | [diff] [blame] | 114 | struct test3_D : virtual test3_B1 { |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 115 | virtual void funcD() { } |
| 116 | }; |
| 117 | |
Mike Stump | e07b6e5 | 2010-01-22 22:06:55 +0000 | [diff] [blame] | 118 | // CHECK-LPLL64:@_ZTV7test3_D = weak_odr constant [12 x i8*] [i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* bitcast (%3* @_ZTI7test3_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN8test3_B36funcB3Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN8test3_B26funcB2Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN8test3_B16funcB1Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN7test3_D5funcDEv to i8*)] |
| 119 | |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 120 | |
Mike Stump | 34fae9c | 2009-08-12 18:50:26 +0000 | [diff] [blame] | 121 | struct test4_D : virtual B, virtual C { |
| 122 | }; |
| 123 | |
Mike Stump | e07b6e5 | 2010-01-22 22:06:55 +0000 | [diff] [blame] | 124 | // CHECK-LPLL64:@_ZTV7test4_D = weak_odr constant [14 x i8*] [i8* null, i8* inttoptr (i64 8 to i8*), i8* null, i8* null, i8* null, i8* bitcast (%1* @_ZTI7test4_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN1C4bee1Ev to i8*), i8* bitcast (void (%class.test14*)* @_ZN1C4bee2Ev to i8*), i8* null, i8* null, i8* inttoptr (i64 -8 to i8*), i8* bitcast (%1* @_ZTI7test4_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN1B4bar1Ev to i8*), i8* bitcast (void (%struct.B*)* @_ZN1B4bar2Ev to i8*)] |
Mike Stump | 34fae9c | 2009-08-12 18:50:26 +0000 | [diff] [blame] | 125 | |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 126 | |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 127 | struct test5_B3 { virtual void funcB3(); }; |
| 128 | struct test5_B2 : virtual test5_B3 { virtual void funcB2(); }; |
| 129 | struct test5_B1 : virtual test5_B2 { virtual void funcB1(); }; |
| 130 | |
| 131 | struct test5_B23 { virtual void funcB23(); }; |
| 132 | struct test5_B22 : virtual test5_B23 { virtual void funcB22(); }; |
| 133 | struct test5_B21 : virtual test5_B22 { virtual void funcB21(); }; |
| 134 | |
| 135 | |
| 136 | struct B232 { virtual void funcB232(); }; |
| 137 | struct B231 { virtual void funcB231(); }; |
| 138 | |
| 139 | struct test5_B33 { virtual void funcB33(); }; |
| 140 | struct test5_B32 : virtual test5_B33, virtual B232 { virtual void funcB32(); }; |
| 141 | struct test5_B31 : virtual test5_B32, virtual B231 { virtual void funcB31(); }; |
| 142 | |
| 143 | struct test5_D : virtual test5_B1, virtual test5_B21, virtual test5_B31 { |
| 144 | virtual void funcD() { } |
| 145 | }; |
| 146 | |
Mike Stump | e07b6e5 | 2010-01-22 22:06:55 +0000 | [diff] [blame] | 147 | // CHECK-LPLL64:@_ZTV7test5_D = weak_odr constant [50 x i8*] [i8* inttoptr (i64 32 to i8*), i8* inttoptr (i64 24 to i8*), i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 8 to i8*), i8* inttoptr (i64 8 to i8*), i8* inttoptr (i64 8 to i8*), i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* bitcast (%2* @_ZTI7test5_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN8test5_B36funcB3Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN8test5_B26funcB2Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN8test5_B16funcB1Ev to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZN7test5_D5funcDEv to i8*), i8* null, i8* null, i8* null, i8* null, i8* null, i8* inttoptr (i64 -8 to i8*), i8* bitcast (%2* @_ZTI7test5_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN9test5_B237funcB23Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test5_B227funcB22Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test5_B217funcB21Ev to i8*), i8* null, i8* inttoptr (i64 16 to i8*), i8* null, i8* null, i8* inttoptr (i64 8 to i8*), i8* null, i8* null, i8* inttoptr (i64 -16 to i8*), i8* bitcast (%2* @_ZTI7test5_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN9test5_B337funcB33Ev to i8*), i8* bitcast (void (%class.test20_D*)* @_ZN9test5_B327funcB32Ev to i8*), i8* bitcast (void (%class.test23_D*)* @_ZN9test5_B317funcB31Ev to i8*), i8* null, i8* inttoptr (i64 -24 to i8*), i8* bitcast (%2* @_ZTI7test5_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN4B2328funcB232Ev to i8*), i8* null, i8* inttoptr (i64 -32 to i8*), i8* bitcast (%2* @_ZTI7test5_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN4B2318funcB231Ev to i8*)] |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 148 | |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 149 | struct test8_B1 { |
| 150 | virtual void ftest8_B1() { } |
| 151 | }; |
| 152 | struct test8_B2aa { |
| 153 | virtual void ftest8_B2aa() { } |
| 154 | int i; |
| 155 | }; |
| 156 | struct test8_B2ab { |
| 157 | virtual void ftest8_B2ab() { } |
| 158 | int i; |
| 159 | }; |
| 160 | struct test8_B2a : virtual test8_B2aa, virtual test8_B2ab { |
| 161 | virtual void ftest8_B2a() { } |
| 162 | }; |
| 163 | struct test8_B2b { |
| 164 | virtual void ftest8_B2b() { } |
| 165 | }; |
| 166 | struct test8_B2 : test8_B2a, test8_B2b { |
| 167 | virtual void ftest8_B2() { } |
| 168 | }; |
| 169 | struct test8_B3 { |
| 170 | virtual void ftest8_B3() { } |
| 171 | }; |
| 172 | class test8_D : test8_B1, test8_B2, test8_B3 { |
Mike Stump | 09765ec | 2009-08-19 02:53:08 +0000 | [diff] [blame] | 173 | }; |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 174 | |
Mike Stump | e07b6e5 | 2010-01-22 22:06:55 +0000 | [diff] [blame] | 175 | // CHECK-LPLL64:@_ZTV7test8_D = weak_odr constant [25 x i8*] [i8* inttoptr (i64 48 to i8*), i8* inttoptr (i64 32 to i8*), i8* null, i8* bitcast (%2* @_ZTI7test8_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN8test8_B19ftest8_B1Ev to i8*), i8* inttoptr (i64 40 to i8*), i8* inttoptr (i64 24 to i8*), i8* inttoptr (i64 -8 to i8*), i8* bitcast (%2* @_ZTI7test8_D to i8*), i8* bitcast (void (%struct.test10_B2a*)* @_ZN9test8_B2a10ftest8_B2aEv to i8*), i8* bitcast (void (%struct.test15_D*)* @_ZN8test8_B29ftest8_B2Ev to i8*), i8* inttoptr (i64 -16 to i8*), i8* bitcast (%2* @_ZTI7test8_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN9test8_B2b10ftest8_B2bEv to i8*), i8* inttoptr (i64 -24 to i8*), i8* bitcast (%2* @_ZTI7test8_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN8test8_B39ftest8_B3Ev to i8*), i8* null, i8* inttoptr (i64 -32 to i8*), i8* bitcast (%2* @_ZTI7test8_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test8_B2aa11ftest8_B2aaEv to i8*), i8* null, i8* inttoptr (i64 -48 to i8*), i8* bitcast (%2* @_ZTI7test8_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test8_B2ab11ftest8_B2abEv to i8*)] |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 176 | |
Mike Stump | e07b6e5 | 2010-01-22 22:06:55 +0000 | [diff] [blame] | 177 | // CHECK-LPLL64:@_ZTC7test8_D8_8test8_B2 = internal constant [14 x i8*] [i8* inttoptr (i64 40 to i8*), i8* inttoptr (i64 24 to i8*), i8* null, i8* bitcast (%1* @_ZTI8test8_B2 to i8*), i8* bitcast (void (%struct.test10_B2a*)* @_ZN9test8_B2a10ftest8_B2aEv to i8*), i8* bitcast (void (%struct.test15_D*)* @_ZN8test8_B29ftest8_B2Ev to i8*), i8* null, i8* inttoptr (i64 -24 to i8*), i8* bitcast (%1* @_ZTI8test8_B2 to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test8_B2aa11ftest8_B2aaEv to i8*), i8* null, i8* inttoptr (i64 -40 to i8*), i8* bitcast (%1* @_ZTI8test8_B2 to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test8_B2ab11ftest8_B2abEv to i8*)] ; <[14 x i8*]*> [#uses=3] |
Mike Stump | 22efb85 | 2009-11-13 22:12:05 +0000 | [diff] [blame] | 178 | |
Mike Stump | e07b6e5 | 2010-01-22 22:06:55 +0000 | [diff] [blame] | 179 | // CHECK-LPLL64:@_ZTC7test8_D8_9test8_B2a = internal constant [13 x i8*] [i8* inttoptr (i64 40 to i8*), i8* inttoptr (i64 24 to i8*), i8* null, i8* bitcast (%1* @_ZTI9test8_B2a to i8*), i8* bitcast (void (%struct.test10_B2a*)* @_ZN9test8_B2a10ftest8_B2aEv to i8*), i8* null, i8* inttoptr (i64 -24 to i8*), i8* bitcast (%1* @_ZTI9test8_B2a to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test8_B2aa11ftest8_B2aaEv to i8*), i8* null, i8* inttoptr (i64 -40 to i8*), i8* bitcast (%1* @_ZTI9test8_B2a to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test8_B2ab11ftest8_B2abEv to i8*)] ; <[13 x i8*]*> [#uses=3] |
Mike Stump | 22efb85 | 2009-11-13 22:12:05 +0000 | [diff] [blame] | 180 | |
Mike Stump | e07b6e5 | 2010-01-22 22:06:55 +0000 | [diff] [blame] | 181 | // CHECK-LPLL64:@_ZTT7test8_D = weak_odr constant [10 x i8*] [i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTV7test8_D, i64 0, i64 4) to i8*), i8* bitcast (i8** getelementptr inbounds ([14 x i8*]* @_ZTC7test8_D8_8test8_B2, i64 0, i64 4) to i8*), i8* bitcast (i8** getelementptr inbounds ([13 x i8*]* @_ZTC7test8_D8_9test8_B2a, i64 0, i64 4) to i8*), i8* bitcast (i8** getelementptr inbounds ([13 x i8*]* @_ZTC7test8_D8_9test8_B2a, i64 0, i64 8) to i8*), i8* bitcast (i8** getelementptr inbounds ([13 x i8*]* @_ZTC7test8_D8_9test8_B2a, i64 0, i64 12) to i8*), i8* bitcast (i8** getelementptr inbounds ([14 x i8*]* @_ZTC7test8_D8_8test8_B2, i64 0, i64 9) to i8*), i8* bitcast (i8** getelementptr inbounds ([14 x i8*]* @_ZTC7test8_D8_8test8_B2, i64 0, i64 13) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTV7test8_D, i64 0, i64 9) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTV7test8_D, i64 0, i64 20) to i8*), i8* bitcast (i8** getelementptr inbounds ([25 x i8*]* @_ZTV7test8_D, i64 0, i64 24) to i8*)] |
Mike Stump | 22efb85 | 2009-11-13 22:12:05 +0000 | [diff] [blame] | 182 | |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 183 | |
Mike Stump | 09765ec | 2009-08-19 02:53:08 +0000 | [diff] [blame] | 184 | struct test9_B3 { virtual void funcB3(); int i; }; |
| 185 | struct test9_B2 : virtual test9_B3 { virtual void funcB2(); int i; }; |
| 186 | struct test9_B1 : virtual test9_B2 { virtual void funcB1(); int i; }; |
| 187 | |
| 188 | struct test9_B23 { virtual void funcB23(); int i; }; |
| 189 | struct test9_B22 : virtual test9_B23 { virtual void funcB22(); int i; }; |
| 190 | struct test9_B21 : virtual test9_B22 { virtual void funcB21(); int i; }; |
| 191 | |
| 192 | |
| 193 | struct test9_B232 { virtual void funcB232(); int i; }; |
| 194 | struct test9_B231 { virtual void funcB231(); int i; }; |
| 195 | |
| 196 | struct test9_B33 { virtual void funcB33(); int i; }; |
| 197 | struct test9_B32 : virtual test9_B33, virtual test9_B232 { virtual void funcB32(); int i; }; |
| 198 | struct test9_B31 : virtual test9_B32, virtual test9_B231 { virtual void funcB31(); int i; }; |
| 199 | |
| 200 | struct test9_D : virtual test9_B1, virtual test9_B21, virtual test9_B31 { |
| 201 | virtual void funcD() { } |
| 202 | }; |
| 203 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 204 | // CHECK-LPLL64:@_ZTV7test9_D = weak_odr constant [70 x i8*] [i8* inttoptr (i64 168 to i8*), i8* inttoptr (i64 152 to i8*), i8* inttoptr (i64 136 to i8*), i8* inttoptr (i64 120 to i8*), i8* inttoptr (i64 104 to i8*), i8* inttoptr (i64 88 to i8*), i8* inttoptr (i64 72 to i8*), i8* inttoptr (i64 56 to i8*), i8* inttoptr (i64 40 to i8*), i8* inttoptr (i64 24 to i8*), i8* inttoptr (i64 8 to i8*), i8* null, i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.test9_D*)* @_ZN7test9_D5funcDEv to i8*), i8* null, i8* inttoptr (i64 32 to i8*), i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 -8 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.test9_B1*)* @_ZN8test9_B16funcB1Ev to i8*), i8* null, i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 -24 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.test13_B2*)* @_ZN8test9_B26funcB2Ev to i8*), i8* null, i8* inttoptr (i64 -40 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN8test9_B36funcB3Ev to i8*), i8* null, i8* inttoptr (i64 32 to i8*), i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 -56 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.test9_B1*)* @_ZN9test9_B217funcB21Ev to i8*), i8* null, i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 -72 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.test13_B2*)* @_ZN9test9_B227funcB22Ev to i8*), i8* null, i8* inttoptr (i64 -88 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN9test9_B237funcB23Ev to i8*), i8* null, i8* inttoptr (i64 64 to i8*), i8* inttoptr (i64 48 to i8*), i8* inttoptr (i64 32 to i8*), i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 -104 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.test9_B31*)* @_ZN9test9_B317funcB31Ev to i8*), i8* null, i8* inttoptr (i64 32 to i8*), i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 -120 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.test9_B1*)* @_ZN9test9_B327funcB32Ev to i8*), i8* null, i8* inttoptr (i64 -136 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN9test9_B337funcB33Ev to i8*), i8* null, i8* inttoptr (i64 -152 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test9_B2328funcB232Ev to i8*), i8* null, i8* inttoptr (i64 -168 to i8*), i8* bitcast (%2* @_ZTI7test9_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test9_B2318funcB231Ev to i8*)] ; <[70 x i8*]*> [#uses=12] |
Mike Stump | 09765ec | 2009-08-19 02:53:08 +0000 | [diff] [blame] | 205 | |
Mike Stump | 09765ec | 2009-08-19 02:53:08 +0000 | [diff] [blame] | 206 | |
Mike Stump | b983744 | 2009-08-20 07:22:17 +0000 | [diff] [blame] | 207 | struct test10_O { int i; }; |
| 208 | |
| 209 | struct test10_B1 : virtual test10_O { |
| 210 | virtual void ftest10_B1() { } |
| 211 | }; |
| 212 | |
| 213 | struct test10_B2aa : virtual test10_O { |
| 214 | int i; |
| 215 | }; |
| 216 | struct test10_B2ab : virtual test10_O { |
| 217 | int i; |
| 218 | }; |
| 219 | struct test10_B2a : virtual test10_B2aa, virtual test10_B2ab,virtual test10_O { |
| 220 | virtual void ftest10_B2a() { } |
| 221 | }; |
| 222 | struct test10_B2b : virtual test10_O { |
| 223 | virtual void ftest10_B2b() { } |
| 224 | }; |
| 225 | struct test10_B2 : test10_B2a { |
| 226 | virtual void ftest10_B2() { } |
| 227 | }; |
| 228 | class test10_D : test10_B1, test10_B2 { |
| 229 | |
| 230 | void ftest10_B2aa() { } |
| 231 | }; |
| 232 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 233 | // CHECK-LPLL64:@_ZTV8test10_D = weak_odr constant [19 x i8*] [i8* inttoptr (i64 40 to i8*), i8* inttoptr (i64 24 to i8*), i8* inttoptr (i64 16 to i8*), i8* null, i8* bitcast (%1* @_ZTI8test10_D to i8*), i8* bitcast (void (%struct.test10_B1*)* @_ZN9test10_B110ftest10_B1Ev to i8*), i8* inttoptr (i64 32 to i8*), i8* inttoptr (i64 8 to i8*), i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 -8 to i8*), i8* bitcast (%1* @_ZTI8test10_D to i8*), i8* bitcast (void (%struct.test10_B2a*)* @_ZN10test10_B2a11ftest10_B2aEv to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZN9test10_B210ftest10_B2Ev to i8*), i8* inttoptr (i64 -8 to i8*), i8* inttoptr (i64 -24 to i8*), i8* bitcast (%1* @_ZTI8test10_D to i8*), i8* inttoptr (i64 -24 to i8*), i8* inttoptr (i64 -40 to i8*), i8* bitcast (%1* @_ZTI8test10_D to i8*)] ; <[19 x i8*]*> [#uses=4] |
Mike Stump | b983744 | 2009-08-20 07:22:17 +0000 | [diff] [blame] | 234 | |
Mike Stump | b983744 | 2009-08-20 07:22:17 +0000 | [diff] [blame] | 235 | |
Mike Stump | b9871a2 | 2009-08-21 01:45:00 +0000 | [diff] [blame] | 236 | struct test11_B { |
| 237 | virtual void B1() { } |
| 238 | virtual void D() { } |
| 239 | virtual void B2() { } |
| 240 | }; |
| 241 | |
| 242 | struct test11_D : test11_B { |
| 243 | virtual void D1() { } |
| 244 | virtual void D() { } |
| 245 | virtual void D2() { } |
| 246 | }; |
| 247 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 248 | // CHECK-LPLL64:@_ZTV8test11_D = weak_odr constant [7 x i8*] [i8* null, i8* bitcast (%4* @_ZTI8test11_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN8test11_B2B1Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN8test11_D1DEv to i8*), i8* bitcast (void (%class.test14*)* @_ZN8test11_B2B2Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN8test11_D2D1Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN8test11_D2D2Ev to i8*)] |
| 249 | |
Mike Stump | b983744 | 2009-08-20 07:22:17 +0000 | [diff] [blame] | 250 | |
Mike Stump | dec025b | 2009-09-07 04:27:52 +0000 | [diff] [blame] | 251 | struct test13_B { |
| 252 | virtual void B1() { } |
| 253 | virtual void D() { } |
| 254 | virtual void Da(); |
| 255 | virtual void Db() { } |
| 256 | virtual void Dc() { } |
| 257 | virtual void B2() { } |
| 258 | int i; |
| 259 | }; |
| 260 | |
| 261 | |
| 262 | struct test13_NV1 { |
| 263 | virtual void fooNV1() { } |
| 264 | virtual void D() { } |
| 265 | }; |
| 266 | |
| 267 | |
| 268 | struct test13_B2 : /* test13_NV1, */ virtual test13_B { |
| 269 | virtual void B2a() { } |
| 270 | virtual void B2() { } |
| 271 | virtual void D() { } |
| 272 | virtual void Da(); |
| 273 | virtual void Dd() { } |
| 274 | virtual void B2b() { } |
| 275 | int i; |
| 276 | }; |
| 277 | |
| 278 | |
| 279 | struct test13_D : test13_NV1, virtual test13_B2 { |
| 280 | virtual void D1() { } |
| 281 | virtual void D() { } |
| 282 | virtual void Db() { } |
| 283 | virtual void Dd() { } |
| 284 | virtual void D2() { } |
| 285 | virtual void fooNV1() { } |
Mike Stump | d9878a1 | 2009-10-13 10:55:21 +0000 | [diff] [blame] | 286 | }; |
Mike Stump | dec025b | 2009-09-07 04:27:52 +0000 | [diff] [blame] | 287 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 288 | // CHECK-LPLL64:@_ZTV8test13_D = weak_odr constant [39 x i8*] [i8* inttoptr (i64 24 to i8*), i8* inttoptr (i64 8 to i8*), i8* null, i8* bitcast (%1* @_ZTI8test13_D to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZN8test13_D6fooNV1Ev to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZN8test13_D1DEv to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZN8test13_D2D1Ev to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZN8test13_D2DbEv to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZN8test13_D2DdEv to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZN8test13_D2D2Ev to i8*), i8* null, i8* inttoptr (i64 -8 to i8*), i8* null, i8* inttoptr (i64 -8 to i8*), i8* null, i8* null, i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 -8 to i8*), i8* bitcast (%1* @_ZTI8test13_D to i8*), i8* bitcast (void (%struct.test13_B2*)* @_ZN9test13_B23B2aEv to i8*), i8* bitcast (void (%struct.test13_B2*)* @_ZN9test13_B22B2Ev to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZTv0_n48_N8test13_D1DEv to i8*), i8* bitcast (void (%struct.test13_B2*)* @_ZN9test13_B22DaEv to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZTv0_n64_N8test13_D2DdEv to i8*), i8* bitcast (void (%struct.test13_B2*)* @_ZN9test13_B23B2bEv to i8*), i8* inttoptr (i64 -16 to i8*), i8* null, i8* inttoptr (i64 -24 to i8*), i8* inttoptr (i64 -16 to i8*), i8* inttoptr (i64 -24 to i8*), i8* null, i8* inttoptr (i64 -24 to i8*), i8* bitcast (%1* @_ZTI8test13_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN8test13_B2B1Ev to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZTv0_n32_N8test13_D1DEv to i8*), i8* bitcast (void (%struct.test13_B2*)* @_ZTv0_n40_N9test13_B22DaEv to i8*), i8* bitcast (void (%struct.test10_B2*)* @_ZTv0_n48_N8test13_D2DbEv to i8*), i8* bitcast (void (%struct.B*)* @_ZN8test13_B2DcEv to i8*), i8* bitcast (void (%struct.test13_B2*)* @_ZTv0_n64_N9test13_B22B2Ev to i8*)] |
Mike Stump | dec025b | 2009-09-07 04:27:52 +0000 | [diff] [blame] | 289 | |
Mike Stump | 09765ec | 2009-08-19 02:53:08 +0000 | [diff] [blame] | 290 | |
Mike Stump | d9878a1 | 2009-10-13 10:55:21 +0000 | [diff] [blame] | 291 | class test14 { |
| 292 | public: |
| 293 | virtual void initWithInt(int a); |
| 294 | static test14 *withInt(int a); |
| 295 | }; |
| 296 | |
| 297 | void test14::initWithInt(int a) { } |
| 298 | |
| 299 | test14 *test14::withInt(int a) { |
| 300 | test14 *me = new test14; |
| 301 | me->initWithInt(a); |
| 302 | return me; |
| 303 | } |
| 304 | |
| 305 | |
| 306 | struct test15_B { |
| 307 | virtual test15_B *foo1() { return 0; } |
| 308 | virtual test15_B *foo2() { return 0; } |
| 309 | virtual test15_B *foo3() { return 0; } |
| 310 | int i; |
| 311 | }; |
| 312 | |
| 313 | struct test15_NV1 { |
| 314 | virtual void fooNV1() { } |
| 315 | int i; |
| 316 | }; |
| 317 | |
| 318 | struct test15_B2 : test15_NV1, virtual test15_B { |
| 319 | virtual test15_B2 *foo1() { return 0; } |
| 320 | virtual test15_B2 *foo2() { return 0; } |
| 321 | int i; |
| 322 | }; |
| 323 | |
| 324 | struct test15_D : test15_NV1, virtual test15_B2 { |
| 325 | virtual test15_D *foo1() { return 0; } |
| 326 | }; |
| 327 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 328 | // CHECK-LPLL64:@_ZTV8test15_D = weak_odr constant [23 x i8*] [i8* inttoptr (i64 32 to i8*), i8* inttoptr (i64 16 to i8*), i8* null, i8* bitcast (%1* @_ZTI8test15_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test15_NV16fooNV1Ev to i8*), i8* bitcast (%struct.test15_D* (%struct.test15_D*)* @_ZN8test15_D4foo1Ev to i8*), i8* null, i8* inttoptr (i64 -16 to i8*), i8* null, i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 -16 to i8*), i8* bitcast (%1* @_ZTI8test15_D to i8*), i8* bitcast (void (%struct.B*)* @_ZN10test15_NV16fooNV1Ev to i8*), i8* bitcast (%struct.test15_D* (%struct.test15_D*)* @_ZTcv0_n40_v0_n24_N8test15_D4foo1Ev to i8*), i8* bitcast (%struct.test15_B2* (%struct.test15_B2*)* @_ZN9test15_B24foo2Ev to i8*), i8* null, i8* inttoptr (i64 -16 to i8*), i8* inttoptr (i64 -32 to i8*), i8* inttoptr (i64 -32 to i8*), i8* bitcast (%1* @_ZTI8test15_D to i8*), i8* bitcast (%struct.test15_D* (%struct.test15_D*)* @_ZTcv0_n24_v0_n32_N8test15_D4foo1Ev to i8*), i8* bitcast (%struct.test15_B2* (%struct.test15_B2*)* @_ZTcv0_n32_v0_n24_N9test15_B24foo2Ev to i8*), i8* bitcast (%struct.B* (%struct.B*)* @_ZN8test15_B4foo3Ev to i8*)] |
Mike Stump | d9878a1 | 2009-10-13 10:55:21 +0000 | [diff] [blame] | 329 | |
Mike Stump | d9878a1 | 2009-10-13 10:55:21 +0000 | [diff] [blame] | 330 | |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 331 | struct test16_NV1 { |
| 332 | virtual void fooNV1() { } |
| 333 | virtual void foo_NV1() { } |
| 334 | int i; |
| 335 | }; |
| 336 | |
| 337 | struct test16_NV2 { |
| 338 | virtual test16_NV2* foo1() { return 0; } |
| 339 | virtual void foo_NV2() { } |
| 340 | virtual void foo_NV2b() { } |
| 341 | int i; |
| 342 | }; |
| 343 | |
| 344 | struct test16_B : public test16_NV1, test16_NV2 { |
| 345 | virtual test16_B *foo1() { return 0; } |
| 346 | virtual test16_B *foo2() { return 0; } |
| 347 | virtual test16_B *foo3() { return 0; } |
| 348 | virtual void foo_B() { } |
| 349 | int i; |
| 350 | }; |
| 351 | |
| 352 | struct test16_B2 : test16_NV1, virtual test16_B { |
| 353 | virtual test16_B2 *foo1() { return 0; } |
| 354 | virtual test16_B2 *foo2() { return 0; } |
| 355 | virtual void foo_B2() { } |
| 356 | int i; |
| 357 | }; |
| 358 | |
| 359 | struct test16_D : test16_NV1, virtual test16_B2 { |
Mike Stump | a84b404 | 2009-11-20 00:02:19 +0000 | [diff] [blame] | 360 | virtual void bar() { } |
| 361 | virtual test16_D *foo1() { return 0; } |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 362 | }; |
| 363 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 364 | // FIXME: |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 365 | // CHECK-LP64: __ZTV8test16_D: |
| 366 | // CHECK-LP64-NEXT: .quad 32 |
| 367 | // CHECK-LP64-NEXT: .quad 16 |
Chris Lattner | f79df05 | 2010-01-20 07:45:09 +0000 | [diff] [blame] | 368 | // CHECK-LP64-NEXT: .quad 0 |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 369 | // CHECK-LP64-NEXT: .quad __ZTI8test16_D |
| 370 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV16fooNV1Ev |
| 371 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV17foo_NV1Ev |
Mike Stump | 941e3f3 | 2009-11-05 05:01:19 +0000 | [diff] [blame] | 372 | // CHECK-LP64-NEXT: .quad __ZN8test16_D3barEv |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 373 | // CHECK-LP64-NEXT: .quad __ZN8test16_D4foo1Ev |
Chris Lattner | f79df05 | 2010-01-20 07:45:09 +0000 | [diff] [blame] | 374 | // CHECK-LP64-NEXT: .quad 0 |
| 375 | // CHECK-LP64-NEXT: .quad 0 |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 376 | // CHECK-LP64-NEXT: .quad 18446744073709551600 |
Chris Lattner | f79df05 | 2010-01-20 07:45:09 +0000 | [diff] [blame] | 377 | // CHECK-LP64-NEXT: .quad 0 |
| 378 | // CHECK-LP64-NEXT: .quad 0 |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 379 | // CHECK-LP64-NEXT: .quad 16 |
| 380 | // CHECK-LP64-NEXT: .quad 18446744073709551600 |
| 381 | // CHECK-LP64-NEXT: .quad __ZTI8test16_D |
| 382 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV16fooNV1Ev |
| 383 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV17foo_NV1Ev |
| 384 | // CHECK-LP64-NEXT: .quad __ZTcv0_n48_v0_n24_N8test16_D4foo1Ev |
| 385 | // CHECK-LP64-NEXT: .quad __ZN9test16_B24foo2Ev |
| 386 | // CHECK-LP64-NEXT: .quad __ZN9test16_B26foo_B2Ev |
| 387 | // CHECK-LP64-NEXT .quad 16 |
| 388 | // CHECK-LP64-NEXT .quad 16 |
Chris Lattner | f79df05 | 2010-01-20 07:45:09 +0000 | [diff] [blame] | 389 | // CHECK-LP64-NEXT: .quad 0 |
| 390 | // CHECK-LP64-NEXT: .quad 0 |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 391 | // CHECK-LP64: .quad 18446744073709551600 |
Mike Stump | 9e7e3c6 | 2009-11-06 23:27:42 +0000 | [diff] [blame] | 392 | // CHECK-LP64-NEXT: .quad 18446744073709551584 |
Chris Lattner | f79df05 | 2010-01-20 07:45:09 +0000 | [diff] [blame] | 393 | // CHECK-LP64-NEXT: .quad 0 |
| 394 | // CHECK-LP64-NEXT: .quad 0 |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 395 | // CHECK-LP64-NEXT: .quad 18446744073709551584 |
| 396 | // CHECK-LP64-NEXT: .quad __ZTI8test16_D |
| 397 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV16fooNV1Ev |
| 398 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV17foo_NV1Ev |
| 399 | // CHECK-LP64-NEXT: .quad __ZTcv0_n40_v0_n32_N8test16_D4foo1Ev |
| 400 | // CHECK-LP64-NEXT: .quad __ZTcv0_n48_v0_n24_N9test16_B24foo2Ev |
| 401 | // CHECK-LP64-NEXT: .quad __ZN8test16_B4foo3Ev |
| 402 | // CHECK-LP64-NEXT: .quad __ZN8test16_B5foo_BEv |
| 403 | // CHECK-LP64-NEXT: .quad 18446744073709551568 |
| 404 | // CHECK-LP64-NEXT: .quad __ZTI8test16_D |
| 405 | // CHECK-LP64-NEXT .quad __ZTcvn16_n40_v16_n32_N8test16_D4foo1Ev |
| 406 | // CHECK-LP64: .quad __ZN10test16_NV27foo_NV2Ev |
| 407 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV28foo_NV2bEv |
| 408 | |
Mike Stump | d9878a1 | 2009-10-13 10:55:21 +0000 | [diff] [blame] | 409 | |
Mike Stump | 941e3f3 | 2009-11-05 05:01:19 +0000 | [diff] [blame] | 410 | |
| 411 | |
Mike Stump | 7809e0d | 2009-10-28 00:35:46 +0000 | [diff] [blame] | 412 | class test17_B1 { |
| 413 | virtual void foo() = 0; |
| 414 | virtual void bar() { } |
| 415 | }; |
| 416 | |
| 417 | class test17_B2 : public test17_B1 { |
| 418 | void foo() { } |
| 419 | virtual void bar() = 0; |
| 420 | }; |
| 421 | |
| 422 | class test17_D : public test17_B2 { |
| 423 | void bar() { } |
Mike Stump | 62db245 | 2009-11-03 19:28:52 +0000 | [diff] [blame] | 424 | }; |
Mike Stump | 7809e0d | 2009-10-28 00:35:46 +0000 | [diff] [blame] | 425 | |
| 426 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 427 | // CHECK-LPLL64:@_ZTV8test17_D = weak_odr constant [4 x i8*] [i8* null, i8* bitcast (%4* @_ZTI8test17_D to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test17_B23fooEv to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN8test17_D3barEv to i8*)] |
Mike Stump | 7809e0d | 2009-10-28 00:35:46 +0000 | [diff] [blame] | 428 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 429 | // CHECK-LPLL64:@_ZTV9test17_B2 = weak_odr constant [4 x i8*] [i8* null, i8* bitcast (%4* @_ZTI9test17_B2 to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test17_B23fooEv to i8*), i8* bitcast (void ()* @__cxa_pure_virtual to i8*)] |
Mike Stump | 7809e0d | 2009-10-28 00:35:46 +0000 | [diff] [blame] | 430 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 431 | // CHECK-LPLL64:@_ZTV9test17_B1 = weak_odr constant [4 x i8*] [i8* null, i8* bitcast (%0* @_ZTI9test17_B1 to i8*), i8* bitcast (void ()* @__cxa_pure_virtual to i8*), i8* bitcast (void (%class.test14*)* @_ZN9test17_B13barEv to i8*)] |
Mike Stump | 7809e0d | 2009-10-28 00:35:46 +0000 | [diff] [blame] | 432 | |
| 433 | |
Mike Stump | 9c21289 | 2009-11-03 19:03:17 +0000 | [diff] [blame] | 434 | struct test18_NV1 { |
| 435 | virtual void fooNV1() { } |
| 436 | virtual void foo_NV1() { } |
| 437 | int i; |
| 438 | }; |
| 439 | |
| 440 | struct test18_NV2 { |
| 441 | virtual test18_NV2& foo1() { return *this; } |
| 442 | virtual void foo_NV2() { } |
| 443 | virtual void foo_NV2b() { } |
| 444 | int i; |
| 445 | }; |
| 446 | |
| 447 | struct test18_B : public test18_NV1, test18_NV2 { |
| 448 | virtual test18_B& foo1() { return *this; } |
| 449 | virtual test18_B *foo2() { return 0; } |
| 450 | virtual test18_B *foo3() { return 0; } |
| 451 | virtual void foo_B() { } |
| 452 | int i; |
| 453 | }; |
| 454 | |
| 455 | struct test18_B2 : test18_NV1, virtual test18_B { |
| 456 | virtual test18_B2& foo1() { return *this; } |
| 457 | virtual test18_B2 *foo2() { return 0; } |
| 458 | virtual void foo_B2() { } |
| 459 | int i; |
| 460 | }; |
| 461 | |
| 462 | struct test18_D : test18_NV1, virtual test18_B2 { |
| 463 | virtual test18_D& foo1() { return *this; } |
Mike Stump | 62db245 | 2009-11-03 19:28:52 +0000 | [diff] [blame] | 464 | }; |
| 465 | |
| 466 | |
| 467 | struct test19_VB1 { }; |
| 468 | struct test19_B1 : public virtual test19_VB1 { |
| 469 | virtual void fB1() { } |
| 470 | virtual void foB1B2() { } |
| 471 | virtual void foB1B3() { } |
| 472 | virtual void foB1B4() { } |
| 473 | }; |
| 474 | |
| 475 | struct test19_VB2 { }; |
| 476 | struct test19_B2: public test19_B1, public virtual test19_VB2 { |
| 477 | virtual void foB1B2() { } |
| 478 | virtual void foB1B3() { } |
| 479 | virtual void foB1B4() { } |
| 480 | |
| 481 | virtual void fB2() { } |
| 482 | virtual void foB2B3() { } |
| 483 | virtual void foB2B4() { } |
| 484 | }; |
| 485 | |
| 486 | struct test19_VB3 { }; |
| 487 | struct test19_B3: virtual public test19_B2, public virtual test19_VB3 { |
| 488 | virtual void foB1B3() { } |
| 489 | virtual void foB1B4() { } |
| 490 | |
| 491 | virtual void foB2B3() { } |
| 492 | virtual void foB2B4() { } |
| 493 | |
| 494 | virtual void fB3() { } |
| 495 | virtual void foB3B4() { } |
| 496 | }; |
| 497 | |
| 498 | struct test19_VB4 { }; |
| 499 | struct test19_B4: public test19_B3, public virtual test19_VB4 { |
| 500 | virtual void foB1B4() { } |
| 501 | |
| 502 | virtual void foB2B4() { } |
| 503 | |
| 504 | virtual void foB3B4() { } |
| 505 | |
| 506 | virtual void fB4() { } |
| 507 | }; |
| 508 | |
| 509 | struct test19_D : virtual test19_B4 { |
| 510 | }; |
| 511 | |
| 512 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 513 | // CHECK-LPLL64:@_ZTV8test19_D = weak_odr constant [28 x i8*] [i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* bitcast (%3* @_ZTI8test19_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN9test19_B13fB1Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test19_B26foB1B2Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test19_B36foB1B3Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test19_B46foB1B4Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test19_B23fB2Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test19_B36foB2B3Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test19_B46foB2B4Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test19_B33fB3Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test19_B46foB3B4Ev to i8*), i8* bitcast (void (%class.test17_B2*)* @_ZN9test19_B43fB4Ev to i8*)] |
Mike Stump | 62db245 | 2009-11-03 19:28:52 +0000 | [diff] [blame] | 514 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 515 | // FIXME: |
Mike Stump | 2cdcbdb | 2009-11-13 21:40:38 +0000 | [diff] [blame] | 516 | // CHECK-LP64: __ZTT8test19_D: |
| 517 | // CHECK-LP64-NEXT: .quad (__ZTV8test19_D) + 144 |
| 518 | // CHECK-LP64-NEXT: .quad (__ZTV8test19_D) + 144 |
| 519 | // CHECK-LP64-NEXT .quad (__ZTV8test19_D) + 144 |
| 520 | // CHECK-LP64-NEXT .quad (__ZTC8test19_D0_9test19_B4) + 136 |
| 521 | // CHECK-LP64-NEXT .quad (__ZTC8test19_D0_9test19_B3) + 104 |
| 522 | // CHECK-LP64-NEXT .quad (__ZTC8test19_D0_9test19_B3) + 104 |
| 523 | // CHECK-LP64-NEXT .quad (__ZTC8test19_D0_9test19_B4) + 136 |
| 524 | // CHECK-LP64-NEXT .quad (__ZTC8test19_D0_9test19_B2) + 88 |
| 525 | // CHECK-LP64-NEXT .quad (__ZTC8test19_D0_9test19_B1) + 24 |
| 526 | |
Mike Stump | 99faefd | 2009-11-05 05:26:28 +0000 | [diff] [blame] | 527 | class test20_V { |
| 528 | virtual void foo1(); |
| 529 | }; |
| 530 | class test20_V1 { |
| 531 | virtual void foo2(); |
| 532 | }; |
| 533 | class test20_B : virtual test20_V { |
| 534 | } b; |
| 535 | class test20_B1 : virtual test20_V1 { |
| 536 | }; |
| 537 | class test20_D : public test20_B, public test20_B1 { |
Mike Stump | 33c530e | 2009-11-06 02:38:24 +0000 | [diff] [blame] | 538 | }; |
Mike Stump | 99faefd | 2009-11-05 05:26:28 +0000 | [diff] [blame] | 539 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 540 | // CHECK-LPLL64:@_ZTV8test20_D = weak_odr constant [11 x i8*] [i8* inttoptr (i64 8 to i8*), i8* null, i8* null, i8* null, i8* bitcast (%1* @_ZTI8test20_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN8test20_V4foo1Ev to i8*), i8* null, i8* null, i8* inttoptr (i64 -8 to i8*), i8* bitcast (%1* @_ZTI8test20_D to i8*), i8* bitcast (void (%class.test14*)* @_ZN9test20_V14foo2Ev to i8*)] |
Mike Stump | 99faefd | 2009-11-05 05:26:28 +0000 | [diff] [blame] | 541 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 542 | // CHECK-LPLL64:@_ZTC8test20_D0_8test20_B = internal constant [5 x i8*] [i8* null, i8* null, i8* null, i8* bitcast (%3* @_ZTI8test20_B to i8*), i8* bitcast (void (%class.test14*)* @_ZN8test20_V4foo1Ev to i8*)] |
Mike Stump | 513225f | 2009-11-13 21:55:26 +0000 | [diff] [blame] | 543 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 544 | // CHECK-LPLL64:@_ZTC8test20_D8_9test20_B1 = internal constant [5 x i8*] [i8* null, i8* null, i8* null, i8* bitcast (%3* @_ZTI9test20_B1 to i8*), i8* bitcast (void (%class.test14*)* @_ZN9test20_V14foo2Ev to i8*)] ; <[5 x i8*]*> [#uses=1] |
Mike Stump | 513225f | 2009-11-13 21:55:26 +0000 | [diff] [blame] | 545 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 546 | // FIXME: |
Mike Stump | 2cdcbdb | 2009-11-13 21:40:38 +0000 | [diff] [blame] | 547 | // CHECK-LP64: __ZTT8test20_D: |
| 548 | // CHECK-LP64-NEXT: .quad (__ZTV8test20_D) + 40 |
| 549 | // CHECK-LP64-NEXT: .quad (__ZTC8test20_D0_8test20_B) + 32 |
| 550 | // CHECK-LP64-NEXT: .quad (__ZTC8test20_D0_8test20_B) + 32 |
| 551 | // CHECK-LP64-NEXT: .quad (__ZTC8test20_D8_9test20_B1) + 32 |
| 552 | // CHECK-LP64-NEXT: .quad (__ZTC8test20_D8_9test20_B1) + 32 |
| 553 | // CHECK-LP64-NEXT .quad (__ZTV8test20_D) + 40 |
| 554 | // CHECK-LP64-NEXT .quad (__ZTV8test20_D) + 80 |
| 555 | // CHECK-LP64-NEXT .quad (__ZTV8test20_D) + 80 |
| 556 | |
Mike Stump | 99faefd | 2009-11-05 05:26:28 +0000 | [diff] [blame] | 557 | |
Mike Stump | 33c530e | 2009-11-06 02:38:24 +0000 | [diff] [blame] | 558 | class test21_V { |
Mike Stump | a660440 | 2009-11-13 18:53:35 +0000 | [diff] [blame] | 559 | virtual void foo() { } |
Mike Stump | 33c530e | 2009-11-06 02:38:24 +0000 | [diff] [blame] | 560 | }; |
| 561 | class test21_V1 { |
Mike Stump | a660440 | 2009-11-13 18:53:35 +0000 | [diff] [blame] | 562 | virtual void foo() { } |
Mike Stump | 33c530e | 2009-11-06 02:38:24 +0000 | [diff] [blame] | 563 | }; |
| 564 | class test21_B : virtual test21_V { |
| 565 | }; |
| 566 | class test21_B1 : virtual test21_V1 { |
| 567 | }; |
| 568 | class test21_D : public test21_B, public test21_B1 { |
| 569 | void foo() { } |
| 570 | }; |
| 571 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 572 | // CHECK-LPLL64:@_ZTV8test21_D = weak_odr constant [11 x i8*] [i8* inttoptr (i64 8 to i8*), i8* null, i8* null, i8* null, i8* bitcast (%1* @_ZTI8test21_D to i8*), i8* bitcast (void (%class.test20_D*)* @_ZN8test21_D3fooEv to i8*), i8* null, i8* inttoptr (i64 -8 to i8*), i8* inttoptr (i64 -8 to i8*), i8* bitcast (%1* @_ZTI8test21_D to i8*), i8* bitcast (void (%class.test20_D*)* @_ZTv0_n24_N8test21_D3fooEv to i8*)] |
Mike Stump | 33c530e | 2009-11-06 02:38:24 +0000 | [diff] [blame] | 573 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 574 | // CHECK-LPLL64:@_ZTC8test21_D0_8test21_B = internal constant [5 x i8*] [i8* null, i8* null, i8* null, i8* bitcast (%3* @_ZTI8test21_B to i8*), i8* bitcast (void (%class.test14*)* @_ZN8test21_V3fooEv to i8*)] |
Mike Stump | 513225f | 2009-11-13 21:55:26 +0000 | [diff] [blame] | 575 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 576 | // CHECK-LPLL64:@_ZTC8test21_D8_9test21_B1 = internal constant [5 x i8*] [i8* null, i8* null, i8* null, i8* bitcast (%3* @_ZTI9test21_B1 to i8*), i8* bitcast (void (%class.test14*)* @_ZN9test21_V13fooEv to i8*)] ; <[5 x i8*]*> [#uses=1] |
Mike Stump | 513225f | 2009-11-13 21:55:26 +0000 | [diff] [blame] | 577 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 578 | // FIXME: |
Mike Stump | 9326c56 | 2009-11-13 19:36:46 +0000 | [diff] [blame] | 579 | // CHECK-LP64: __ZTT8test21_D: |
| 580 | // CHECK-LP64-NEXT: .quad (__ZTV8test21_D) + 40 |
| 581 | // CHECK-LP64-NEXT: .quad (__ZTC8test21_D0_8test21_B) + 32 |
| 582 | // CHECK-LP64-NEXT: .quad (__ZTC8test21_D0_8test21_B) + 32 |
| 583 | // CHECK-LP64-NEXT: .quad (__ZTC8test21_D8_9test21_B1) + 32 |
| 584 | // CHECK-LP64-NEXT: .quad (__ZTC8test21_D8_9test21_B1) + 32 |
| 585 | // CHECK-LP64-NEXT .quad (__ZTV8test21_D) + 40 |
| 586 | // CHECK-LP64-NEXT .quad (__ZTV8test21_D) + 80 |
| 587 | // CHECK-LP64-NEXT .quad (__ZTV8test21_D) + 80 |
| 588 | |
Mike Stump | 33c530e | 2009-11-06 02:38:24 +0000 | [diff] [blame] | 589 | |
Mike Stump | fc9f16c | 2010-01-22 06:45:05 +0000 | [diff] [blame] | 590 | struct test22_s1 { virtual void dtor() { } }; |
| 591 | struct test22_s2 { virtual void dtor() { } }; |
| 592 | struct test22_s3 : test22_s1, test22_s2 { virtual void dtor() { } }; |
| 593 | struct test22_D : test22_s3 { virtual void dtor() { } }; |
Mike Stump | 7809e0d | 2009-10-28 00:35:46 +0000 | [diff] [blame] | 594 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 595 | // CHECK-LPLL64:@_ZTV8test22_D = weak_odr constant [6 x i8*] [i8* null, i8* bitcast (%4* @_ZTI8test22_D to i8*), i8* bitcast (void (%class.test20_D*)* @_ZN8test22_D4dtorEv to i8*), i8* inttoptr (i64 -8 to i8*), i8* bitcast (%4* @_ZTI8test22_D to i8*), i8* bitcast (void (%class.test20_D*)* @_ZThn8_N8test22_D4dtorEv to i8*)] |
Mike Stump | fc9f16c | 2010-01-22 06:45:05 +0000 | [diff] [blame] | 596 | |
| 597 | |
Mike Stump | 6ebee07 | 2010-01-22 20:27:17 +0000 | [diff] [blame] | 598 | class test23_s1 { |
| 599 | virtual void fun1(char *t) { } |
| 600 | }; |
| 601 | class test23_s2 { |
| 602 | virtual void fun2(char *t) { } |
| 603 | }; |
| 604 | class test23_s3 { |
| 605 | virtual void fun3(char *t) { } |
| 606 | }; |
| 607 | class test23_s4: virtual test23_s1, test23_s2, test23_s3 { |
| 608 | virtual void fun4(char *t) { } |
| 609 | }; |
| 610 | class test23_D: virtual test23_s4 { |
| 611 | virtual void fun5(char *t) { } |
| 612 | }; |
| 613 | |
| 614 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 615 | // FIXME: |
Mike Stump | 6ebee07 | 2010-01-22 20:27:17 +0000 | [diff] [blame] | 616 | // CHECK-LP64: __ZTV8test23_D: |
| 617 | // CHECK-LP64-NEXT: .quad 0 |
| 618 | // CHECK-LP64-NEXT: .quad 8 |
| 619 | // CHECK-LP64-NEXT: .quad 0 |
| 620 | // CHECK-LP64-NEXT: .quad 0 |
| 621 | // CHECK-LP64-NEXT: .quad __ZTI8test23_D |
| 622 | // CHECK-LP64-NEXT: .quad __ZN9test23_s14fun1EPc |
| 623 | // CHECK-LP64-NEXT: .quad __ZN8test23_D4fun5EPc |
| 624 | // CHECK-LP64-NEXT .quad 8 |
| 625 | // CHECK-LP64: .quad 0 |
| 626 | // CHECK-LP64-NEXT: .quad 0 |
| 627 | // CHECK-LP64: .quad 18446744073709551608 |
| 628 | // CHECK-LP64-NEXT: .quad 18446744073709551608 |
| 629 | // CHECK-LP64-NEXT: .quad __ZTI8test23_D |
| 630 | // CHECK-LP64-NEXT: .quad __ZN9test23_s24fun2EPc |
| 631 | // CHECK-LP64-NEXT: .quad __ZN9test23_s44fun4EPc |
| 632 | // CHECK-LP64-NEXT: .quad 18446744073709551600 |
| 633 | // CHECK-LP64-NEXT: .quad __ZTI8test23_D |
| 634 | // CHECK-LP64-NEXT: .quad __ZN9test23_s34fun3EPc |
| 635 | |
| 636 | |
| 637 | test23_D d23; |
Mike Stump | fc9f16c | 2010-01-22 06:45:05 +0000 | [diff] [blame] | 638 | test22_D d22; |
Mike Stump | 33c530e | 2009-11-06 02:38:24 +0000 | [diff] [blame] | 639 | test21_D d21; |
| 640 | test20_D d20; |
Mike Stump | 62db245 | 2009-11-03 19:28:52 +0000 | [diff] [blame] | 641 | test19_D d19; |
| 642 | test18_D d18; |
| 643 | test17_D d17; |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 644 | test16_D d16; |
Mike Stump | d9878a1 | 2009-10-13 10:55:21 +0000 | [diff] [blame] | 645 | test15_D d15; |
| 646 | test13_D d13; |
Mike Stump | b9871a2 | 2009-08-21 01:45:00 +0000 | [diff] [blame] | 647 | test11_D d11; |
Mike Stump | b983744 | 2009-08-20 07:22:17 +0000 | [diff] [blame] | 648 | test10_D d10; |
Mike Stump | 09765ec | 2009-08-19 02:53:08 +0000 | [diff] [blame] | 649 | test9_D d9; |
| 650 | test8_D d8; |
| 651 | |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 652 | test5_D d5; |
Mike Stump | 34fae9c | 2009-08-12 18:50:26 +0000 | [diff] [blame] | 653 | test4_D d4; |
| 654 | test3_D d3; |
Mike Stump | 7884678 | 2009-08-13 23:33:29 +0000 | [diff] [blame] | 655 | |
| 656 | test6_D d6; |
| 657 | test7_D d7; |
Mike Stump | e07b6e5 | 2010-01-22 22:06:55 +0000 | [diff] [blame] | 658 | |
| 659 | |
| 660 | int j; |
| 661 | void *vp; |
| 662 | void test2() { |
| 663 | F f; |
| 664 | static int sz = (char *)(&f.f) - (char *)(&f); |
| 665 | vp = &sz; |
| 666 | j = sz; |
| 667 | // FIXME: These should result in a frontend constant a la fold, no run time |
| 668 | // initializer |
| 669 | // CHECK-LPLL64: define void @_Z5test2v() |
| 670 | // CHECK-LPLL64: = getelementptr inbounds %class.F* %f, i32 0, i32 1 |
| 671 | } |
| 672 | |
| 673 | static_assert(sizeof(F) == sizeof(void*)*4, "invalid vbase size"); |
| 674 | |
| 675 | |
| 676 | void test12_foo() { |
| 677 | test12_pa->foo0(); |
| 678 | test12_pb->foo0(); |
| 679 | test12_pd->foo0(); |
| 680 | test12_pa->foo(); |
| 681 | test12_pb->foo(); |
| 682 | test12_pd->foo(); |
| 683 | test12_pa->test12_A::foo(); |
| 684 | } |
| 685 | |
| 686 | |
| 687 | // CHECK-LPLL64:define void @_Z10test12_foov() nounwind { |
| 688 | // CHECK-LPLL64: call void % |
| 689 | // CHECK-LPLL64: call void % |
| 690 | // CHECK-LPLL64: call void % |
| 691 | // CHECK-LPLL64: call void % |
| 692 | // CHECK-LPLL64: call void % |
| 693 | // CHECK-LPLL64: call void % |
| 694 | // CHECK-LPLL64: call void @_ZN8test12_A3fooEv(%class.test14* %{{.*}}) |
| 695 | |
| 696 | |
| 697 | // FIXME: This is the wrong thunk, but until these issues are fixed, better |
| 698 | // than nothing. |
| 699 | // CHECK-LPLL64:define weak %class.test8_D* @_ZTcvn16_n72_v16_n32_N8test16_D4foo1Ev(%class.test8_D*) |
| 700 | // CHECK-LPLL64: %{{retval|2}} = alloca %class.test8_D* |
| 701 | // CHECK-LPLL64: %.addr = alloca %class.test8_D* |
| 702 | // CHECK-LPLL64: store %class.test8_D* %0, %class.test8_D** %.addr |
| 703 | // CHECK-LPLL64: %{{this|3}} = load %class.test8_D** %.addr |
| 704 | // CHECK-LPLL64: %{{1|4}} = bitcast %class.test8_D* %{{this|3}} to i8* |
| 705 | // CHECK-LPLL64: %{{2|5}} = getelementptr inbounds i8* %{{1|4}}, i64 -16 |
| 706 | // CHECK-LPLL64: %{{3|6}} = bitcast i8* %{{2|5}} to %class.test8_D* |
| 707 | // CHECK-LPLL64: %{{4|7}} = bitcast %class.test8_D* %{{3|6}} to i8* |
| 708 | // CHECK-LPLL64: %{{5|8}} = bitcast %class.test8_D* %3 to i64** |
| 709 | // CHECK-LPLL64: %{{vtable|9}} = load i64** %{{5|8}} |
| 710 | // CHECK-LPLL64: %{{6|10}} = getelementptr inbounds i64* %{{vtable|9}}, i64 -9 |
| 711 | // CHECK-LPLL64: %{{7|11}} = load i64* %{{6|10}} |
| 712 | // CHECK-LPLL64: %{{8|12}} = getelementptr i8* %{{4|7}}, i64 %{{7|11}} |
| 713 | // CHECK-LPLL64: %{{9|13}} = bitcast i8* %{{8|12}} to %class.test8_D* |
| 714 | // CHECK-LPLL64: %{{call|14}} = call %class.test8_D* @_ZTch0_v16_n32_N8test16_D4foo1Ev(%class.test8_D* %{{9|13}}) |
| 715 | // CHECK-LPLL64: store %class.test8_D* %{{call|14}}, %class.test8_D** %{{retval|2}} |
| 716 | // CHECK-LPLL64: %{{10|15}} = load %class.test8_D** %{{retval|2}} |
| 717 | // CHECK-LPLL64: ret %class.test8_D* %{{10|15}} |
| 718 | // CHECK-LPLL64:} |
| 719 | |
| 720 | // CHECK-LPLL64:define weak %class.test8_D* @_ZTch0_v16_n32_N8test16_D4foo1Ev(%{{class.test8_D|.*}}*) |
| 721 | // CHECK-LPLL64: %{{retval|2}} = alloca %class.test8_D* |
| 722 | // CHECK-LPLL64: %.addr = alloca %class.test8_D* |
| 723 | // CHECK-LPLL64: store %class.test8_D* %0, %class.test8_D** %.addr |
| 724 | // CHECK-LPLL64: %{{this|3}} = load %class.test8_D** %.addr |
| 725 | // CHECK-LPLL64: %{{call|4}} = call %class.test8_D* @_ZN8test16_D4foo1Ev(%class.test8_D* %{{this|3}}) |
| 726 | // CHECK-LPLL64: %{{1|5}} = icmp ne %class.test8_D* %{{call|4}}, null |
| 727 | // CHECK-LPLL64: br i1 %{{1|5}}, label %{{2|6}}, label %{{12|17}} |
| 728 | // CHECK-LPLL64:; <label>:{{2|6}} |
| 729 | // CHECK-LPLL64: %{{3|7}} = bitcast %class.test8_D* %{{call|4}} to i8* |
| 730 | // CHECK-LPLL64: %{{4|8}} = getelementptr inbounds i8* %{{3|7}}, i64 16 |
| 731 | // CHECK-LPLL64: %{{5|9}} = bitcast i8* %4 to %class.test8_D* |
| 732 | // CHECK-LPLL64: %{{6|10}} = bitcast %class.test8_D* %{{5|9}} to i8* |
| 733 | // CHECK-LPLL64: %{{7|11}} = bitcast %class.test8_D* %{{5|9}} to i64** |
| 734 | // CHECK-LPLL64: %{{vtable|12}} = load i64** %{{7|11}} |
| 735 | // CHECK-LPLL64: %{{8|13}} = getelementptr inbounds i64* %vtable, i64 -4 |
| 736 | // CHECK-LPLL64: %{{9|14}} = load i64* %{{8|13}} |
| 737 | // CHECK-LPLL64: %{{10|15}} = getelementptr i8* %{{6|10}}, i64 %{{9|14}} |
| 738 | // CHECK-LPLL64: %{{11|16}} = bitcast i8* %{{10|15}} to %class.test8_D* |
| 739 | // CHECK-LPLL64: br label %{{13|18}} |
| 740 | // CHECK-LPLL64:; <label>:{{12|17}} |
| 741 | // CHECK-LPLL64: br label %{{13|18}} |
| 742 | // CHECK-LPLL64:; <label>:{{13|18}} |
| 743 | // CHECK-LPLL64: %{{14|19}} = phi %class.test8_D* [ %{{11|16}}, %{{2|6}} ], [ %{{call|4}}, %{{12|17}} ] |
| 744 | // CHECK-LPLL64: store %class.test8_D* %{{14|19}}, %class.test8_D** %{{retval|2}} |
| 745 | // CHECK-LPLL64: %{{15|20}} = load %class.test8_D** %{{retval|2}} |
| 746 | // CHECK-LPLL64: ret %class.test8_D* %{{15|20}} |
| 747 | // CHECK-LPLL64:} |