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 | |
Douglas Gregor | b5b3b30 | 2010-04-02 19:02:06 +0000 | [diff] [blame] | 107 | // FIXME: we were checking for an alignment of 3 (?) |
| 108 | // CHECK-LP64: .zerofill __DATA,__common,_d7,16, |
Mike Stump | 94d0bce | 2009-08-13 00:34:14 +0000 | [diff] [blame] | 109 | |
| 110 | |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 111 | struct test3_B3 { virtual void funcB3(); }; |
| 112 | struct test3_B2 : virtual test3_B3 { virtual void funcB2(); }; |
| 113 | struct test3_B1 : virtual test3_B2 { virtual void funcB1(); }; |
| 114 | |
Mike Stump | f0070db | 2009-08-26 20:46:33 +0000 | [diff] [blame] | 115 | struct test3_D : virtual test3_B1 { |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 116 | virtual void funcD() { } |
| 117 | }; |
| 118 | |
Mike Stump | e07b6e5 | 2010-01-22 22:06:55 +0000 | [diff] [blame] | 119 | // 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*)] |
| 120 | |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 121 | |
Mike Stump | 34fae9c | 2009-08-12 18:50:26 +0000 | [diff] [blame] | 122 | struct test4_D : virtual B, virtual C { |
| 123 | }; |
| 124 | |
Mike Stump | e07b6e5 | 2010-01-22 22:06:55 +0000 | [diff] [blame] | 125 | // 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] | 126 | |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 127 | |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 128 | struct test5_B3 { virtual void funcB3(); }; |
| 129 | struct test5_B2 : virtual test5_B3 { virtual void funcB2(); }; |
| 130 | struct test5_B1 : virtual test5_B2 { virtual void funcB1(); }; |
| 131 | |
| 132 | struct test5_B23 { virtual void funcB23(); }; |
| 133 | struct test5_B22 : virtual test5_B23 { virtual void funcB22(); }; |
| 134 | struct test5_B21 : virtual test5_B22 { virtual void funcB21(); }; |
| 135 | |
| 136 | |
| 137 | struct B232 { virtual void funcB232(); }; |
| 138 | struct B231 { virtual void funcB231(); }; |
| 139 | |
| 140 | struct test5_B33 { virtual void funcB33(); }; |
| 141 | struct test5_B32 : virtual test5_B33, virtual B232 { virtual void funcB32(); }; |
| 142 | struct test5_B31 : virtual test5_B32, virtual B231 { virtual void funcB31(); }; |
| 143 | |
| 144 | struct test5_D : virtual test5_B1, virtual test5_B21, virtual test5_B31 { |
| 145 | virtual void funcD() { } |
| 146 | }; |
| 147 | |
Mike Stump | e07b6e5 | 2010-01-22 22:06:55 +0000 | [diff] [blame] | 148 | // 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] | 149 | |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 150 | struct test8_B1 { |
| 151 | virtual void ftest8_B1() { } |
| 152 | }; |
| 153 | struct test8_B2aa { |
| 154 | virtual void ftest8_B2aa() { } |
| 155 | int i; |
| 156 | }; |
| 157 | struct test8_B2ab { |
| 158 | virtual void ftest8_B2ab() { } |
| 159 | int i; |
| 160 | }; |
| 161 | struct test8_B2a : virtual test8_B2aa, virtual test8_B2ab { |
| 162 | virtual void ftest8_B2a() { } |
| 163 | }; |
| 164 | struct test8_B2b { |
| 165 | virtual void ftest8_B2b() { } |
| 166 | }; |
| 167 | struct test8_B2 : test8_B2a, test8_B2b { |
| 168 | virtual void ftest8_B2() { } |
| 169 | }; |
| 170 | struct test8_B3 { |
| 171 | virtual void ftest8_B3() { } |
| 172 | }; |
| 173 | class test8_D : test8_B1, test8_B2, test8_B3 { |
Mike Stump | 09765ec | 2009-08-19 02:53:08 +0000 | [diff] [blame] | 174 | }; |
Mike Stump | 276b9f1 | 2009-08-16 01:46:26 +0000 | [diff] [blame] | 175 | |
Mike Stump | e07b6e5 | 2010-01-22 22:06:55 +0000 | [diff] [blame] | 176 | // 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] | 177 | |
Mike Stump | e07b6e5 | 2010-01-22 22:06:55 +0000 | [diff] [blame] | 178 | // 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] | 179 | |
Mike Stump | e07b6e5 | 2010-01-22 22:06:55 +0000 | [diff] [blame] | 180 | // 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] | 181 | |
Mike Stump | e07b6e5 | 2010-01-22 22:06:55 +0000 | [diff] [blame] | 182 | // 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] | 183 | |
Mike Stump | 4952094 | 2009-08-11 04:03:59 +0000 | [diff] [blame] | 184 | |
Mike Stump | 09765ec | 2009-08-19 02:53:08 +0000 | [diff] [blame] | 185 | struct test9_B3 { virtual void funcB3(); int i; }; |
| 186 | struct test9_B2 : virtual test9_B3 { virtual void funcB2(); int i; }; |
| 187 | struct test9_B1 : virtual test9_B2 { virtual void funcB1(); int i; }; |
| 188 | |
| 189 | struct test9_B23 { virtual void funcB23(); int i; }; |
| 190 | struct test9_B22 : virtual test9_B23 { virtual void funcB22(); int i; }; |
| 191 | struct test9_B21 : virtual test9_B22 { virtual void funcB21(); int i; }; |
| 192 | |
| 193 | |
| 194 | struct test9_B232 { virtual void funcB232(); int i; }; |
| 195 | struct test9_B231 { virtual void funcB231(); int i; }; |
| 196 | |
| 197 | struct test9_B33 { virtual void funcB33(); int i; }; |
| 198 | struct test9_B32 : virtual test9_B33, virtual test9_B232 { virtual void funcB32(); int i; }; |
| 199 | struct test9_B31 : virtual test9_B32, virtual test9_B231 { virtual void funcB31(); int i; }; |
| 200 | |
| 201 | struct test9_D : virtual test9_B1, virtual test9_B21, virtual test9_B31 { |
| 202 | virtual void funcD() { } |
| 203 | }; |
| 204 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 205 | // 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] | 206 | |
Mike Stump | 09765ec | 2009-08-19 02:53:08 +0000 | [diff] [blame] | 207 | |
Mike Stump | b983744 | 2009-08-20 07:22:17 +0000 | [diff] [blame] | 208 | struct test10_O { int i; }; |
| 209 | |
| 210 | struct test10_B1 : virtual test10_O { |
| 211 | virtual void ftest10_B1() { } |
| 212 | }; |
| 213 | |
| 214 | struct test10_B2aa : virtual test10_O { |
| 215 | int i; |
| 216 | }; |
| 217 | struct test10_B2ab : virtual test10_O { |
| 218 | int i; |
| 219 | }; |
| 220 | struct test10_B2a : virtual test10_B2aa, virtual test10_B2ab,virtual test10_O { |
| 221 | virtual void ftest10_B2a() { } |
| 222 | }; |
| 223 | struct test10_B2b : virtual test10_O { |
| 224 | virtual void ftest10_B2b() { } |
| 225 | }; |
| 226 | struct test10_B2 : test10_B2a { |
| 227 | virtual void ftest10_B2() { } |
| 228 | }; |
| 229 | class test10_D : test10_B1, test10_B2 { |
| 230 | |
| 231 | void ftest10_B2aa() { } |
| 232 | }; |
| 233 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 234 | // 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] | 235 | |
Mike Stump | b983744 | 2009-08-20 07:22:17 +0000 | [diff] [blame] | 236 | |
Mike Stump | b9871a2 | 2009-08-21 01:45:00 +0000 | [diff] [blame] | 237 | struct test11_B { |
| 238 | virtual void B1() { } |
| 239 | virtual void D() { } |
| 240 | virtual void B2() { } |
| 241 | }; |
| 242 | |
| 243 | struct test11_D : test11_B { |
| 244 | virtual void D1() { } |
| 245 | virtual void D() { } |
| 246 | virtual void D2() { } |
| 247 | }; |
| 248 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 249 | // 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*)] |
| 250 | |
Mike Stump | b983744 | 2009-08-20 07:22:17 +0000 | [diff] [blame] | 251 | |
Mike Stump | dec025b | 2009-09-07 04:27:52 +0000 | [diff] [blame] | 252 | struct test13_B { |
| 253 | virtual void B1() { } |
| 254 | virtual void D() { } |
| 255 | virtual void Da(); |
| 256 | virtual void Db() { } |
| 257 | virtual void Dc() { } |
| 258 | virtual void B2() { } |
| 259 | int i; |
| 260 | }; |
| 261 | |
| 262 | |
| 263 | struct test13_NV1 { |
| 264 | virtual void fooNV1() { } |
| 265 | virtual void D() { } |
| 266 | }; |
| 267 | |
| 268 | |
| 269 | struct test13_B2 : /* test13_NV1, */ virtual test13_B { |
| 270 | virtual void B2a() { } |
| 271 | virtual void B2() { } |
| 272 | virtual void D() { } |
| 273 | virtual void Da(); |
| 274 | virtual void Dd() { } |
| 275 | virtual void B2b() { } |
| 276 | int i; |
| 277 | }; |
| 278 | |
| 279 | |
| 280 | struct test13_D : test13_NV1, virtual test13_B2 { |
| 281 | virtual void D1() { } |
| 282 | virtual void D() { } |
| 283 | virtual void Db() { } |
| 284 | virtual void Dd() { } |
| 285 | virtual void D2() { } |
| 286 | virtual void fooNV1() { } |
Mike Stump | d9878a1 | 2009-10-13 10:55:21 +0000 | [diff] [blame] | 287 | }; |
Mike Stump | dec025b | 2009-09-07 04:27:52 +0000 | [diff] [blame] | 288 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 289 | // 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] | 290 | |
Mike Stump | 09765ec | 2009-08-19 02:53:08 +0000 | [diff] [blame] | 291 | |
Mike Stump | d9878a1 | 2009-10-13 10:55:21 +0000 | [diff] [blame] | 292 | class test14 { |
| 293 | public: |
| 294 | virtual void initWithInt(int a); |
| 295 | static test14 *withInt(int a); |
| 296 | }; |
| 297 | |
| 298 | void test14::initWithInt(int a) { } |
| 299 | |
| 300 | test14 *test14::withInt(int a) { |
| 301 | test14 *me = new test14; |
| 302 | me->initWithInt(a); |
| 303 | return me; |
| 304 | } |
| 305 | |
| 306 | |
| 307 | struct test15_B { |
| 308 | virtual test15_B *foo1() { return 0; } |
| 309 | virtual test15_B *foo2() { return 0; } |
| 310 | virtual test15_B *foo3() { return 0; } |
| 311 | int i; |
| 312 | }; |
| 313 | |
| 314 | struct test15_NV1 { |
| 315 | virtual void fooNV1() { } |
| 316 | int i; |
| 317 | }; |
| 318 | |
| 319 | struct test15_B2 : test15_NV1, virtual test15_B { |
| 320 | virtual test15_B2 *foo1() { return 0; } |
| 321 | virtual test15_B2 *foo2() { return 0; } |
| 322 | int i; |
| 323 | }; |
| 324 | |
| 325 | struct test15_D : test15_NV1, virtual test15_B2 { |
| 326 | virtual test15_D *foo1() { return 0; } |
| 327 | }; |
| 328 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 329 | // 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] | 330 | |
Mike Stump | d9878a1 | 2009-10-13 10:55:21 +0000 | [diff] [blame] | 331 | |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 332 | struct test16_NV1 { |
| 333 | virtual void fooNV1() { } |
| 334 | virtual void foo_NV1() { } |
| 335 | int i; |
| 336 | }; |
| 337 | |
| 338 | struct test16_NV2 { |
| 339 | virtual test16_NV2* foo1() { return 0; } |
| 340 | virtual void foo_NV2() { } |
| 341 | virtual void foo_NV2b() { } |
| 342 | int i; |
| 343 | }; |
| 344 | |
| 345 | struct test16_B : public test16_NV1, test16_NV2 { |
| 346 | virtual test16_B *foo1() { return 0; } |
| 347 | virtual test16_B *foo2() { return 0; } |
| 348 | virtual test16_B *foo3() { return 0; } |
| 349 | virtual void foo_B() { } |
| 350 | int i; |
| 351 | }; |
| 352 | |
| 353 | struct test16_B2 : test16_NV1, virtual test16_B { |
| 354 | virtual test16_B2 *foo1() { return 0; } |
| 355 | virtual test16_B2 *foo2() { return 0; } |
| 356 | virtual void foo_B2() { } |
| 357 | int i; |
| 358 | }; |
| 359 | |
| 360 | struct test16_D : test16_NV1, virtual test16_B2 { |
Mike Stump | a84b404 | 2009-11-20 00:02:19 +0000 | [diff] [blame] | 361 | virtual void bar() { } |
| 362 | virtual test16_D *foo1() { return 0; } |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 363 | }; |
| 364 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 365 | // FIXME: |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 366 | // CHECK-LP64: __ZTV8test16_D: |
| 367 | // CHECK-LP64-NEXT: .quad 32 |
| 368 | // CHECK-LP64-NEXT: .quad 16 |
Chris Lattner | f79df05 | 2010-01-20 07:45:09 +0000 | [diff] [blame] | 369 | // CHECK-LP64-NEXT: .quad 0 |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 370 | // CHECK-LP64-NEXT: .quad __ZTI8test16_D |
| 371 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV16fooNV1Ev |
| 372 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV17foo_NV1Ev |
Mike Stump | 941e3f3 | 2009-11-05 05:01:19 +0000 | [diff] [blame] | 373 | // CHECK-LP64-NEXT: .quad __ZN8test16_D3barEv |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 374 | // CHECK-LP64-NEXT: .quad __ZN8test16_D4foo1Ev |
Chris Lattner | f79df05 | 2010-01-20 07:45:09 +0000 | [diff] [blame] | 375 | // CHECK-LP64-NEXT: .quad 0 |
| 376 | // CHECK-LP64-NEXT: .quad 0 |
Benjamin Kramer | 56c75a7 | 2010-01-23 10:15:32 +0000 | [diff] [blame] | 377 | // CHECK-LP64-NEXT: .quad -16 |
Chris Lattner | f79df05 | 2010-01-20 07:45:09 +0000 | [diff] [blame] | 378 | // CHECK-LP64-NEXT: .quad 0 |
| 379 | // CHECK-LP64-NEXT: .quad 0 |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 380 | // CHECK-LP64-NEXT: .quad 16 |
Benjamin Kramer | 56c75a7 | 2010-01-23 10:15:32 +0000 | [diff] [blame] | 381 | // CHECK-LP64-NEXT: .quad -16 |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 382 | // CHECK-LP64-NEXT: .quad __ZTI8test16_D |
| 383 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV16fooNV1Ev |
| 384 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV17foo_NV1Ev |
| 385 | // CHECK-LP64-NEXT: .quad __ZTcv0_n48_v0_n24_N8test16_D4foo1Ev |
| 386 | // CHECK-LP64-NEXT: .quad __ZN9test16_B24foo2Ev |
| 387 | // CHECK-LP64-NEXT: .quad __ZN9test16_B26foo_B2Ev |
Mike Stump | cf0b9cc | 2010-01-26 00:05:04 +0000 | [diff] [blame] | 388 | // CHECK-LP64-NEXT: .quad 16 |
| 389 | // CHECK-LP64-NEXT: .quad 16 |
Chris Lattner | f79df05 | 2010-01-20 07:45:09 +0000 | [diff] [blame] | 390 | // CHECK-LP64-NEXT: .quad 0 |
| 391 | // CHECK-LP64-NEXT: .quad 0 |
Mike Stump | cf0b9cc | 2010-01-26 00:05:04 +0000 | [diff] [blame] | 392 | // CHECK-LP64-NEXT: .quad -16 |
Mike Stump | d99a4d2 | 2010-01-26 03:42:22 +0000 | [diff] [blame] | 393 | // CHECK-LP64-NEXT: .quad -32 |
| 394 | // CHECK-LP64-NEXT: .quad 0 |
Chris Lattner | f79df05 | 2010-01-20 07:45:09 +0000 | [diff] [blame] | 395 | // CHECK-LP64-NEXT: .quad 0 |
Benjamin Kramer | 56c75a7 | 2010-01-23 10:15:32 +0000 | [diff] [blame] | 396 | // CHECK-LP64-NEXT: .quad -32 |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 397 | // CHECK-LP64-NEXT: .quad __ZTI8test16_D |
| 398 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV16fooNV1Ev |
| 399 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV17foo_NV1Ev |
| 400 | // CHECK-LP64-NEXT: .quad __ZTcv0_n40_v0_n32_N8test16_D4foo1Ev |
| 401 | // CHECK-LP64-NEXT: .quad __ZTcv0_n48_v0_n24_N9test16_B24foo2Ev |
| 402 | // CHECK-LP64-NEXT: .quad __ZN8test16_B4foo3Ev |
| 403 | // CHECK-LP64-NEXT: .quad __ZN8test16_B5foo_BEv |
Benjamin Kramer | 56c75a7 | 2010-01-23 10:15:32 +0000 | [diff] [blame] | 404 | // CHECK-LP64-NEXT: .quad -48 |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 405 | // CHECK-LP64-NEXT: .quad __ZTI8test16_D |
Mike Stump | 15189fb | 2010-01-26 21:35:27 +0000 | [diff] [blame] | 406 | // CHECK-LP64-NEXT: .quad __ZTcvn16_n40_v16_n32_N8test16_D4foo1Ev |
| 407 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV27foo_NV2Ev |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 408 | // CHECK-LP64-NEXT: .quad __ZN10test16_NV28foo_NV2bEv |
| 409 | |
Mike Stump | d9878a1 | 2009-10-13 10:55:21 +0000 | [diff] [blame] | 410 | |
Mike Stump | 941e3f3 | 2009-11-05 05:01:19 +0000 | [diff] [blame] | 411 | |
| 412 | |
Mike Stump | 7809e0d | 2009-10-28 00:35:46 +0000 | [diff] [blame] | 413 | class test17_B1 { |
| 414 | virtual void foo() = 0; |
| 415 | virtual void bar() { } |
| 416 | }; |
| 417 | |
| 418 | class test17_B2 : public test17_B1 { |
| 419 | void foo() { } |
| 420 | virtual void bar() = 0; |
| 421 | }; |
| 422 | |
| 423 | class test17_D : public test17_B2 { |
| 424 | void bar() { } |
Mike Stump | 62db245 | 2009-11-03 19:28:52 +0000 | [diff] [blame] | 425 | }; |
Mike Stump | 7809e0d | 2009-10-28 00:35:46 +0000 | [diff] [blame] | 426 | |
| 427 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 428 | // 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] | 429 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 430 | // 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] | 431 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 432 | // 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] | 433 | |
| 434 | |
Mike Stump | 9c21289 | 2009-11-03 19:03:17 +0000 | [diff] [blame] | 435 | struct test18_NV1 { |
| 436 | virtual void fooNV1() { } |
| 437 | virtual void foo_NV1() { } |
| 438 | int i; |
| 439 | }; |
| 440 | |
| 441 | struct test18_NV2 { |
| 442 | virtual test18_NV2& foo1() { return *this; } |
| 443 | virtual void foo_NV2() { } |
| 444 | virtual void foo_NV2b() { } |
| 445 | int i; |
| 446 | }; |
| 447 | |
| 448 | struct test18_B : public test18_NV1, test18_NV2 { |
| 449 | virtual test18_B& foo1() { return *this; } |
| 450 | virtual test18_B *foo2() { return 0; } |
| 451 | virtual test18_B *foo3() { return 0; } |
| 452 | virtual void foo_B() { } |
| 453 | int i; |
| 454 | }; |
| 455 | |
| 456 | struct test18_B2 : test18_NV1, virtual test18_B { |
| 457 | virtual test18_B2& foo1() { return *this; } |
| 458 | virtual test18_B2 *foo2() { return 0; } |
| 459 | virtual void foo_B2() { } |
| 460 | int i; |
| 461 | }; |
| 462 | |
| 463 | struct test18_D : test18_NV1, virtual test18_B2 { |
| 464 | virtual test18_D& foo1() { return *this; } |
Mike Stump | 62db245 | 2009-11-03 19:28:52 +0000 | [diff] [blame] | 465 | }; |
| 466 | |
| 467 | |
| 468 | struct test19_VB1 { }; |
| 469 | struct test19_B1 : public virtual test19_VB1 { |
| 470 | virtual void fB1() { } |
| 471 | virtual void foB1B2() { } |
| 472 | virtual void foB1B3() { } |
| 473 | virtual void foB1B4() { } |
| 474 | }; |
| 475 | |
| 476 | struct test19_VB2 { }; |
| 477 | struct test19_B2: public test19_B1, public virtual test19_VB2 { |
| 478 | virtual void foB1B2() { } |
| 479 | virtual void foB1B3() { } |
| 480 | virtual void foB1B4() { } |
| 481 | |
| 482 | virtual void fB2() { } |
| 483 | virtual void foB2B3() { } |
| 484 | virtual void foB2B4() { } |
| 485 | }; |
| 486 | |
| 487 | struct test19_VB3 { }; |
| 488 | struct test19_B3: virtual public test19_B2, public virtual test19_VB3 { |
| 489 | virtual void foB1B3() { } |
| 490 | virtual void foB1B4() { } |
| 491 | |
| 492 | virtual void foB2B3() { } |
| 493 | virtual void foB2B4() { } |
| 494 | |
| 495 | virtual void fB3() { } |
| 496 | virtual void foB3B4() { } |
| 497 | }; |
| 498 | |
| 499 | struct test19_VB4 { }; |
| 500 | struct test19_B4: public test19_B3, public virtual test19_VB4 { |
| 501 | virtual void foB1B4() { } |
| 502 | |
| 503 | virtual void foB2B4() { } |
| 504 | |
| 505 | virtual void foB3B4() { } |
| 506 | |
| 507 | virtual void fB4() { } |
| 508 | }; |
| 509 | |
| 510 | struct test19_D : virtual test19_B4 { |
| 511 | }; |
| 512 | |
| 513 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 514 | // 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] | 515 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 516 | // FIXME: |
Mike Stump | 2cdcbdb | 2009-11-13 21:40:38 +0000 | [diff] [blame] | 517 | // CHECK-LP64: __ZTT8test19_D: |
Benjamin Kramer | 56c75a7 | 2010-01-23 10:15:32 +0000 | [diff] [blame] | 518 | // CHECK-LP64-NEXT: .quad __ZTV8test19_D+144 |
| 519 | // CHECK-LP64-NEXT: .quad __ZTV8test19_D+144 |
| 520 | // CHECK-LP64-NEXT .quad __ZTV8test19_D+144 |
| 521 | // CHECK-LP64-NEXT .quad __ZTC8test19_D0_9test19_B4+136 |
| 522 | // CHECK-LP64-NEXT .quad __ZTC8test19_D0_9test19_B3+104 |
| 523 | // CHECK-LP64-NEXT .quad __ZTC8test19_D0_9test19_B3+104 |
| 524 | // CHECK-LP64-NEXT .quad __ZTC8test19_D0_9test19_B4+136 |
| 525 | // CHECK-LP64-NEXT .quad __ZTC8test19_D0_9test19_B2+88 |
| 526 | // CHECK-LP64-NEXT .quad __ZTC8test19_D0_9test19_B1+24 |
Mike Stump | 2cdcbdb | 2009-11-13 21:40:38 +0000 | [diff] [blame] | 527 | |
Mike Stump | 99faefd | 2009-11-05 05:26:28 +0000 | [diff] [blame] | 528 | class test20_V { |
| 529 | virtual void foo1(); |
| 530 | }; |
| 531 | class test20_V1 { |
| 532 | virtual void foo2(); |
| 533 | }; |
| 534 | class test20_B : virtual test20_V { |
| 535 | } b; |
| 536 | class test20_B1 : virtual test20_V1 { |
| 537 | }; |
| 538 | class test20_D : public test20_B, public test20_B1 { |
Mike Stump | 33c530e | 2009-11-06 02:38:24 +0000 | [diff] [blame] | 539 | }; |
Mike Stump | 99faefd | 2009-11-05 05:26:28 +0000 | [diff] [blame] | 540 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 541 | // 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] | 542 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 543 | // 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] | 544 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 545 | // 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] | 546 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 547 | // FIXME: |
Mike Stump | 2cdcbdb | 2009-11-13 21:40:38 +0000 | [diff] [blame] | 548 | // CHECK-LP64: __ZTT8test20_D: |
Benjamin Kramer | 56c75a7 | 2010-01-23 10:15:32 +0000 | [diff] [blame] | 549 | // CHECK-LP64-NEXT: .quad __ZTV8test20_D+40 |
| 550 | // CHECK-LP64-NEXT: .quad __ZTC8test20_D0_8test20_B+32 |
| 551 | // CHECK-LP64-NEXT: .quad __ZTC8test20_D0_8test20_B+32 |
| 552 | // CHECK-LP64-NEXT: .quad __ZTC8test20_D8_9test20_B1+32 |
| 553 | // CHECK-LP64-NEXT: .quad __ZTC8test20_D8_9test20_B1+32 |
| 554 | // CHECK-LP64-NEXT .quad __ZTV8test20_D+40 |
| 555 | // CHECK-LP64-NEXT .quad __ZTV8test20_D+80 |
| 556 | // CHECK-LP64-NEXT .quad __ZTV8test20_D+80 |
Mike Stump | 2cdcbdb | 2009-11-13 21:40:38 +0000 | [diff] [blame] | 557 | |
Mike Stump | 99faefd | 2009-11-05 05:26:28 +0000 | [diff] [blame] | 558 | |
Mike Stump | 33c530e | 2009-11-06 02:38:24 +0000 | [diff] [blame] | 559 | class test21_V { |
Mike Stump | a660440 | 2009-11-13 18:53:35 +0000 | [diff] [blame] | 560 | virtual void foo() { } |
Mike Stump | 33c530e | 2009-11-06 02:38:24 +0000 | [diff] [blame] | 561 | }; |
| 562 | class test21_V1 { |
Mike Stump | a660440 | 2009-11-13 18:53:35 +0000 | [diff] [blame] | 563 | virtual void foo() { } |
Mike Stump | 33c530e | 2009-11-06 02:38:24 +0000 | [diff] [blame] | 564 | }; |
| 565 | class test21_B : virtual test21_V { |
| 566 | }; |
| 567 | class test21_B1 : virtual test21_V1 { |
| 568 | }; |
| 569 | class test21_D : public test21_B, public test21_B1 { |
| 570 | void foo() { } |
| 571 | }; |
| 572 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 573 | // 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] | 574 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 575 | // 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] | 576 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 577 | // 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] | 578 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 579 | // FIXME: |
Mike Stump | 9326c56 | 2009-11-13 19:36:46 +0000 | [diff] [blame] | 580 | // CHECK-LP64: __ZTT8test21_D: |
Benjamin Kramer | 56c75a7 | 2010-01-23 10:15:32 +0000 | [diff] [blame] | 581 | // CHECK-LP64-NEXT: .quad __ZTV8test21_D+40 |
| 582 | // CHECK-LP64-NEXT: .quad __ZTC8test21_D0_8test21_B+32 |
| 583 | // CHECK-LP64-NEXT: .quad __ZTC8test21_D0_8test21_B+32 |
| 584 | // CHECK-LP64-NEXT: .quad __ZTC8test21_D8_9test21_B1+32 |
| 585 | // CHECK-LP64-NEXT: .quad __ZTC8test21_D8_9test21_B1+32 |
| 586 | // CHECK-LP64-NEXT .quad __ZTV8test21_D+40 |
| 587 | // CHECK-LP64-NEXT .quad __ZTV8test21_D+80 |
| 588 | // CHECK-LP64-NEXT .quad __ZTV8test21_D+80 |
Mike Stump | 9326c56 | 2009-11-13 19:36:46 +0000 | [diff] [blame] | 589 | |
Mike Stump | 33c530e | 2009-11-06 02:38:24 +0000 | [diff] [blame] | 590 | |
Mike Stump | fc9f16c | 2010-01-22 06:45:05 +0000 | [diff] [blame] | 591 | struct test22_s1 { virtual void dtor() { } }; |
| 592 | struct test22_s2 { virtual void dtor() { } }; |
| 593 | struct test22_s3 : test22_s1, test22_s2 { virtual void dtor() { } }; |
| 594 | struct test22_D : test22_s3 { virtual void dtor() { } }; |
Mike Stump | 7809e0d | 2009-10-28 00:35:46 +0000 | [diff] [blame] | 595 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 596 | // 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] | 597 | |
| 598 | |
Mike Stump | 6ebee07 | 2010-01-22 20:27:17 +0000 | [diff] [blame] | 599 | class test23_s1 { |
| 600 | virtual void fun1(char *t) { } |
| 601 | }; |
| 602 | class test23_s2 { |
| 603 | virtual void fun2(char *t) { } |
| 604 | }; |
| 605 | class test23_s3 { |
| 606 | virtual void fun3(char *t) { } |
| 607 | }; |
| 608 | class test23_s4: virtual test23_s1, test23_s2, test23_s3 { |
| 609 | virtual void fun4(char *t) { } |
| 610 | }; |
| 611 | class test23_D: virtual test23_s4 { |
| 612 | virtual void fun5(char *t) { } |
| 613 | }; |
| 614 | |
| 615 | |
Mike Stump | f9d3e9b | 2010-01-22 22:37:17 +0000 | [diff] [blame] | 616 | // FIXME: |
Mike Stump | 6ebee07 | 2010-01-22 20:27:17 +0000 | [diff] [blame] | 617 | // CHECK-LP64: __ZTV8test23_D: |
| 618 | // CHECK-LP64-NEXT: .quad 0 |
| 619 | // CHECK-LP64-NEXT: .quad 8 |
| 620 | // CHECK-LP64-NEXT: .quad 0 |
| 621 | // CHECK-LP64-NEXT: .quad 0 |
| 622 | // CHECK-LP64-NEXT: .quad __ZTI8test23_D |
| 623 | // CHECK-LP64-NEXT: .quad __ZN9test23_s14fun1EPc |
| 624 | // CHECK-LP64-NEXT: .quad __ZN8test23_D4fun5EPc |
| 625 | // CHECK-LP64-NEXT .quad 8 |
| 626 | // CHECK-LP64: .quad 0 |
| 627 | // CHECK-LP64-NEXT: .quad 0 |
Benjamin Kramer | 56c75a7 | 2010-01-23 10:15:32 +0000 | [diff] [blame] | 628 | // CHECK-LP64: .quad -8 |
| 629 | // CHECK-LP64-NEXT: .quad -8 |
Mike Stump | 6ebee07 | 2010-01-22 20:27:17 +0000 | [diff] [blame] | 630 | // CHECK-LP64-NEXT: .quad __ZTI8test23_D |
| 631 | // CHECK-LP64-NEXT: .quad __ZN9test23_s24fun2EPc |
| 632 | // CHECK-LP64-NEXT: .quad __ZN9test23_s44fun4EPc |
Benjamin Kramer | 56c75a7 | 2010-01-23 10:15:32 +0000 | [diff] [blame] | 633 | // CHECK-LP64-NEXT: .quad -16 |
Mike Stump | 6ebee07 | 2010-01-22 20:27:17 +0000 | [diff] [blame] | 634 | // CHECK-LP64-NEXT: .quad __ZTI8test23_D |
| 635 | // CHECK-LP64-NEXT: .quad __ZN9test23_s34fun3EPc |
| 636 | |
| 637 | |
| 638 | test23_D d23; |
Mike Stump | fc9f16c | 2010-01-22 06:45:05 +0000 | [diff] [blame] | 639 | test22_D d22; |
Mike Stump | 33c530e | 2009-11-06 02:38:24 +0000 | [diff] [blame] | 640 | test21_D d21; |
| 641 | test20_D d20; |
Mike Stump | 62db245 | 2009-11-03 19:28:52 +0000 | [diff] [blame] | 642 | test19_D d19; |
| 643 | test18_D d18; |
| 644 | test17_D d17; |
Mike Stump | 54150d9 | 2009-10-14 18:38:01 +0000 | [diff] [blame] | 645 | test16_D d16; |
Mike Stump | d9878a1 | 2009-10-13 10:55:21 +0000 | [diff] [blame] | 646 | test15_D d15; |
| 647 | test13_D d13; |
Mike Stump | b9871a2 | 2009-08-21 01:45:00 +0000 | [diff] [blame] | 648 | test11_D d11; |
Mike Stump | b983744 | 2009-08-20 07:22:17 +0000 | [diff] [blame] | 649 | test10_D d10; |
Mike Stump | 09765ec | 2009-08-19 02:53:08 +0000 | [diff] [blame] | 650 | test9_D d9; |
| 651 | test8_D d8; |
| 652 | |
Mike Stump | d76264e | 2009-08-12 21:50:08 +0000 | [diff] [blame] | 653 | test5_D d5; |
Mike Stump | 34fae9c | 2009-08-12 18:50:26 +0000 | [diff] [blame] | 654 | test4_D d4; |
| 655 | test3_D d3; |
Mike Stump | 7884678 | 2009-08-13 23:33:29 +0000 | [diff] [blame] | 656 | |
| 657 | test6_D d6; |
| 658 | test7_D d7; |
Mike Stump | e07b6e5 | 2010-01-22 22:06:55 +0000 | [diff] [blame] | 659 | |
| 660 | |
| 661 | int j; |
| 662 | void *vp; |
| 663 | void test2() { |
| 664 | F f; |
| 665 | static int sz = (char *)(&f.f) - (char *)(&f); |
| 666 | vp = &sz; |
| 667 | j = sz; |
| 668 | // FIXME: These should result in a frontend constant a la fold, no run time |
| 669 | // initializer |
| 670 | // CHECK-LPLL64: define void @_Z5test2v() |
| 671 | // CHECK-LPLL64: = getelementptr inbounds %class.F* %f, i32 0, i32 1 |
| 672 | } |
| 673 | |
| 674 | static_assert(sizeof(F) == sizeof(void*)*4, "invalid vbase size"); |
| 675 | |
| 676 | |
| 677 | void test12_foo() { |
| 678 | test12_pa->foo0(); |
| 679 | test12_pb->foo0(); |
| 680 | test12_pd->foo0(); |
| 681 | test12_pa->foo(); |
| 682 | test12_pb->foo(); |
| 683 | test12_pd->foo(); |
| 684 | test12_pa->test12_A::foo(); |
| 685 | } |
| 686 | |
| 687 | |
| 688 | // CHECK-LPLL64:define void @_Z10test12_foov() nounwind { |
| 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 % |
| 695 | // CHECK-LPLL64: call void @_ZN8test12_A3fooEv(%class.test14* %{{.*}}) |
| 696 | |