diff options
author | John McCall <rjmccall@apple.com> | 2010-02-17 03:52:49 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-02-17 03:52:49 +0000 |
commit | 92ac9ffecd236a6be0d6ab30cef56100e56b171c (patch) | |
tree | dcadd027e9cec747a31fc2b15cbf3da0bbfed085 /test | |
parent | 340963fd040d79ebfd868f976743645254113183 (diff) |
Emit complete constructors and destructors as aliases to base constructors
and destructors when the two entities are semantically identical, i.e. when
the class has no virtual base classes. We only do this for linkage types
for which aliases are supported, i.e. internal and external, i.e. not linkonce.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96451 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGenCXX/default-arguments.cpp | 9 | ||||
-rw-r--r-- | test/CodeGenCXX/mangle-subst-std.cpp | 3 | ||||
-rw-r--r-- | test/CodeGenCXX/mangle.cpp | 3 | ||||
-rw-r--r-- | test/CodeGenCXX/member-templates.cpp | 2 | ||||
-rw-r--r-- | test/CodeGenCXX/virtual-bases.cpp | 6 | ||||
-rw-r--r-- | test/CodeGenCXX/virtual-destructor-calls.cpp | 3 | ||||
-rw-r--r-- | test/CodeGenCXX/vtable-pointer-initialization.cpp | 4 |
7 files changed, 13 insertions, 17 deletions
diff --git a/test/CodeGenCXX/default-arguments.cpp b/test/CodeGenCXX/default-arguments.cpp index 282e5d0d50..de53a6958f 100644 --- a/test/CodeGenCXX/default-arguments.cpp +++ b/test/CodeGenCXX/default-arguments.cpp @@ -26,6 +26,8 @@ struct B { B(const A1& = A1(), const A2& = A2()); }; +// CHECK: @_ZN1CC1Ev = alias {{.*}} @_ZN1CC2Ev + // CHECK: define void @_Z2f1v() void f1() { @@ -42,13 +44,6 @@ struct C { C(); }; -// CHECK: define void @_ZN1CC1Ev( -// CHECK: call void @_ZN2A1C1Ev( -// CHECK: call void @_ZN2A2C1Ev( -// CHECK: call void @_ZN1BC1ERK2A1RK2A2( -// CHECK: call void @_ZN2A2D1Ev -// CHECK: call void @_ZN2A1D1Ev - // CHECK: define void @_ZN1CC2Ev( // CHECK: call void @_ZN2A1C1Ev( // CHECK: call void @_ZN2A2C1Ev( diff --git a/test/CodeGenCXX/mangle-subst-std.cpp b/test/CodeGenCXX/mangle-subst-std.cpp index 913c8f101b..aea841557c 100644 --- a/test/CodeGenCXX/mangle-subst-std.cpp +++ b/test/CodeGenCXX/mangle-subst-std.cpp @@ -1,9 +1,10 @@ // RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 | FileCheck %s +// CHECK: @_ZNSt1AC1Ev = alias {{.*}} @_ZNSt1AC2Ev + namespace std { struct A { A(); }; - // CHECK: define void @_ZNSt1AC1Ev // CHECK: define void @_ZNSt1AC2Ev A::A() { } }; diff --git a/test/CodeGenCXX/mangle.cpp b/test/CodeGenCXX/mangle.cpp index 07183782e7..320b681ac8 100644 --- a/test/CodeGenCXX/mangle.cpp +++ b/test/CodeGenCXX/mangle.cpp @@ -11,6 +11,8 @@ struct Y { }; //CHECK: @pr5966_i = external global //CHECK: @_ZL8pr5966_i = internal global +// CHECK: @_ZN2S7C1Ev = alias {{.*}} @_ZN2S7C2Ev + // CHECK: define zeroext i1 @_ZplRK1YRA100_P1X bool operator+(const Y&, X* (&xs)[100]) { return false; } @@ -219,7 +221,6 @@ struct S7 { }; // PR5139 -// CHECK: @_ZN2S7C1Ev // CHECK: @_ZN2S7C2Ev // CHECK: @"_ZN2S73$_0C1Ev" S7::S7() {} diff --git a/test/CodeGenCXX/member-templates.cpp b/test/CodeGenCXX/member-templates.cpp index 355ba20e17..5ec3226296 100644 --- a/test/CodeGenCXX/member-templates.cpp +++ b/test/CodeGenCXX/member-templates.cpp @@ -15,7 +15,7 @@ struct B { template<typename T> B::B(T) {} -// CHECK: define void @_ZN1BC1IiEET_(%struct.B* %this, i32) +// CHECK: @_ZN1BC1IiEET_ = alias {{.*}} @_ZN1BC2IiEET_ // CHECK: define void @_ZN1BC2IiEET_(%struct.B* %this, i32) template B::B(int); diff --git a/test/CodeGenCXX/virtual-bases.cpp b/test/CodeGenCXX/virtual-bases.cpp index 200f21a5da..bd29b8d9d3 100644 --- a/test/CodeGenCXX/virtual-bases.cpp +++ b/test/CodeGenCXX/virtual-bases.cpp @@ -4,7 +4,7 @@ struct A { A(); }; -// CHECK: define void @_ZN1AC1Ev(%struct.A* %this) +// CHECK: @_ZN1AC1Ev = alias {{.*}} @_ZN1AC2Ev // CHECK: define void @_ZN1AC2Ev(%struct.A* %this) A::A() { } @@ -12,14 +12,14 @@ struct B : virtual A { B(); }; -// CHECK: define void @_ZN1BC1Ev(%struct.B* %this) // CHECK: define void @_ZN1BC2Ev(%struct.B* %this, i8** %vtt) +// CHECK: define void @_ZN1BC1Ev(%struct.B* %this) B::B() { } struct C : virtual A { C(bool); }; -// CHECK: define void @_ZN1CC1Eb(%struct.B* %this, i1 zeroext) // CHECK: define void @_ZN1CC2Eb(%struct.B* %this, i8** %vtt, i1 zeroext) +// CHECK: define void @_ZN1CC1Eb(%struct.B* %this, i1 zeroext) C::C(bool) { } diff --git a/test/CodeGenCXX/virtual-destructor-calls.cpp b/test/CodeGenCXX/virtual-destructor-calls.cpp index 01ca1442f2..650fd69bbe 100644 --- a/test/CodeGenCXX/virtual-destructor-calls.cpp +++ b/test/CodeGenCXX/virtual-destructor-calls.cpp @@ -9,8 +9,7 @@ struct B : A { }; // Complete dtor. -// CHECK: define void @_ZN1BD1Ev -// CHECK: call void @_ZN1AD2Ev +// CHECK: @_ZN1BD1Ev = alias {{.*}} @_ZN1BD2Ev // Deleting dtor. // CHECK: define void @_ZN1BD0Ev diff --git a/test/CodeGenCXX/vtable-pointer-initialization.cpp b/test/CodeGenCXX/vtable-pointer-initialization.cpp index 92e011752f..ebe531529b 100644 --- a/test/CodeGenCXX/vtable-pointer-initialization.cpp +++ b/test/CodeGenCXX/vtable-pointer-initialization.cpp @@ -19,14 +19,14 @@ struct A : Base { Field field; }; -// CHECK: define void @_ZN1AC1Ev( +// CHECK: define void @_ZN1AC2Ev( // CHECK: call void @_ZN4BaseC2Ev( // CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1A, i64 0, i64 2) // CHECK: call void @_ZN5FieldC1Ev( // CHECK: ret void A::A() { } -// CHECK: define void @_ZN1AD1Ev( +// CHECK: define void @_ZN1AD2Ev( // CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1A, i64 0, i64 2) // CHECK: call void @_ZN5FieldD1Ev( // CHECK: call void @_ZN4BaseD2Ev( |