1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fapple-kext -fno-rtti -emit-llvm -o - %s | FileCheck %s
3 // CHECK: @_ZTV1A ={{.*}} unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr null, ptr @_ZNK1A3abcEv, ptr null] }
4 // CHECK: @_ZTV4Base ={{.*}} unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr null, ptr @_ZNK4Base3abcEv, ptr null] }
5 // CHECK: @_ZTV8Derived2 ={{.*}} unnamed_addr constant { [5 x ptr] } { [5 x ptr] [ptr null, ptr null, ptr null, ptr @_ZNK8Derived23efgEv, ptr null] }
6 // CHECK: @_ZTV2D2 ={{.*}} unnamed_addr constant { [5 x ptr] } { [5 x ptr] [ptr null, ptr null, ptr null, ptr @_ZNK2D23abcEv, ptr null] }
9 virtual const char* abc(void) const;
12 const char* A::abc(void) const {return "A"; };
14 struct B
: virtual A
{
21 // CHECK: [[T1:%.*]] = load ptr, ptr getelementptr inbounds (ptr, ptr @_ZTV1A, i64 2)
22 // CHECK-NEXT: [[T2:%.*]] = call noundef ptr [[T1]]
23 const char* c
= p
->A::abc();
28 struct Base
{ virtual char* abc(void) const; };
30 char* Base::abc() const { return 0; }
32 struct Derived
: public Base
{
35 void FUNC1(Derived
* p
) {
36 // CHECK: [[U1:%.*]] = load ptr, ptr getelementptr inbounds (ptr, ptr @_ZTV4Base, i64 2)
37 // CHECK-NEXT: [[U2:%.*]] = call noundef ptr [[U1]]
38 char* c
= p
->Base::abc();
45 struct Derived2
: virtual Base2
{
46 virtual char* efg(void) const;
49 char* Derived2::efg(void) const { return 0; }
51 void FUNC2(Derived2
* p
) {
52 // CHECK: [[V1:%.*]] = load ptr, ptr getelementptr inbounds (ptr, ptr @_ZTV8Derived2, i64 3)
53 // CHECK-NEXT: [[V2:%.*]] = call noundef ptr [[V1]]
54 char* c
= p
->Derived2::efg();
60 struct D1
: virtual Base3
{
63 struct D2
: virtual Base3
{
64 virtual char *abc(void) const;
70 char* D2::abc(void) const { return 0; }
73 // CHECK: [[W1:%.*]] = load ptr, ptr getelementptr inbounds (ptr, ptr @_ZTV2D2, i64 3)
74 // CHECK-NEXT: [[W2:%.*]] = call noundef ptr [[W1]]
75 char* c
= p
->D2::abc();