Fix C++ constructor/destructor tests when run on ARM

llvm-svn: 184225
This commit is contained in:
Stephen Lin 2013-06-18 20:24:04 +00:00
parent c5d0935788
commit 6d51d86698
4 changed files with 25 additions and 15 deletions

View File

@ -1,7 +1,11 @@
// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-unknown-linux | FileCheck --check-prefix=CHECKX86 %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=arm-linux-gnueabihf | FileCheck --check-prefix=CHECKARM %s
struct A { virtual void a(); };
A x(A& y) { return y; }
// CHECK: define linkonce_odr {{.*}} @_ZN1AC1ERKS_(%struct.A* %this, %struct.A*) unnamed_addr
// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1A, i64 0, i64 2)
// CHECKX86: define linkonce_odr {{.*}} @_ZN1AC1ERKS_(%struct.A* %this, %struct.A*) unnamed_addr
// CHECKX86: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1A, i64 0, i64 2)
// CHECKARM: define linkonce_odr {{.*}} @_ZN1AC1ERKS_(%struct.A* returned %this, %struct.A*) unnamed_addr
// CHECKARM: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1A, i64 0, i64 2)

View File

@ -1,10 +1,16 @@
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-unknown-linux | FileCheck --check-prefix=CHECKX86 %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=arm-linux-gnueabihf | FileCheck --check-prefix=CHECKARM %s
template <class T> struct A { A(); };
struct B { A<int> x; };
void a() {
B b;
}
// CHECK: call {{.*}} @_ZN1BC1Ev
// CHECK: define linkonce_odr {{.*}} @_ZN1BC1Ev(%struct.B* %this) unnamed_addr
// CHECK: call {{.*}} @_ZN1AIiEC1Ev
// CHECKX86: call {{.*}} @_ZN1BC1Ev
// CHECKX86: define linkonce_odr {{.*}} @_ZN1BC1Ev(%struct.B* %this) unnamed_addr
// CHECKX86: call {{.*}} @_ZN1AIiEC1Ev
// CHECKARM: call {{.*}} @_ZN1BC1Ev
// CHECKARM: define linkonce_odr {{.*}} @_ZN1BC1Ev(%struct.B* returned %this) unnamed_addr
// CHECKARM: call {{.*}} @_ZN1AIiEC1Ev

View File

@ -82,7 +82,7 @@ namespace test7 {
X(U*, typename int_c<(meta<T>::value + meta<U>::value)>::type *) { }
};
// CHECK: define weak_odr {{.*}} @_ZN5test71XIiEC1IdEEPT_PNS_5int_cIXplL_ZNS_4metaIiE5valueEEsr4metaIS3_EE5valueEE4typeE(%"struct.test7::X"* %this, double*, float*) unnamed_addr
// CHECK: define weak_odr {{.*}} @_ZN5test71XIiEC1IdEEPT_PNS_5int_cIXplL_ZNS_4metaIiE5valueEEsr4metaIS3_EE5valueEE4typeE(
template X<int>::X(double*, float*);
}
@ -101,7 +101,7 @@ namespace test8 {
template<typename T>
void f(int_c<meta<T>::type::value>) { }
// CHECK: define weak_odr void @_ZN5test81fIiEEvNS_5int_cIXsr4metaIT_E4typeE5valueEEE
// CHECK: define weak_odr void @_ZN5test81fIiEEvNS_5int_cIXsr4metaIT_E4typeE5valueEEE(
template void f<int>(int_c<sizeof(int)>);
}

View File

@ -18,34 +18,34 @@ int main() {
// basic_iostream's complete dtor calls its base dtor, then its
// virtual base's dtor.
// CHECK: define linkonce_odr {{.*}} @_ZN14basic_iostreamIcED1Ev(%struct.basic_iostream* %this) unnamed_addr
// CHECK: define linkonce_odr {{.*}} @_ZN14basic_iostreamIcED1Ev(%struct.basic_iostream* {{.*}}%this) unnamed_addr
// CHECK: call {{.*}} @_ZN14basic_iostreamIcED2Ev
// CHECK: call {{.*}} @_ZN9basic_iosD2Ev
// basic_iostream's base dtor calls its non-virtual base dtor.
// CHECK: define linkonce_odr {{.*}} @_ZN14basic_iostreamIcED2Ev(%struct.basic_iostream* %this, i8** %vtt) unnamed_addr
// CHECK: define linkonce_odr {{.*}} @_ZN14basic_iostreamIcED2Ev(%struct.basic_iostream* {{.*}}%this, i8** %vtt) unnamed_addr
// CHECK: call {{.*}} @_ZN13basic_istreamIcED2Ev
// CHECK: }
// basic_iostream's deleting dtor calls its complete dtor, then
// operator delete().
// CHECK: define linkonce_odr {{.*}} @_ZN14basic_iostreamIcED0Ev(%struct.basic_iostream* %this) unnamed_addr
// CHECK: define linkonce_odr {{.*}} @_ZN14basic_iostreamIcED0Ev(%struct.basic_iostream* {{.*}}%this) unnamed_addr
// CHECK: call {{.*}} @_ZN14basic_iostreamIcED1Ev
// CHECK: call {{.*}} @_ZdlPv
// basic_istream's complete dtor calls the base dtor,
// then its virtual base's base dtor.
// CHECK: define linkonce_odr {{.*}} @_ZN13basic_istreamIcED1Ev(%struct.basic_istream* %this) unnamed_addr
// CHECK: define linkonce_odr {{.*}} @_ZN13basic_istreamIcED1Ev(%struct.basic_istream* {{.*}}%this) unnamed_addr
// CHECK: call {{.*}} @_ZN13basic_istreamIcED2Ev
// CHECK: call {{.*}} @_ZN9basic_iosD2Ev
// basic_istream's deleting dtor calls the complete dtor, then
// operator delete().
// CHECK: define linkonce_odr {{.*}} @_ZN13basic_istreamIcED0Ev(%struct.basic_istream* %this) unnamed_addr
// CHECK: define linkonce_odr {{.*}} @_ZN13basic_istreamIcED0Ev(%struct.basic_istream* {{.*}}%this) unnamed_addr
// CHECK: call {{.*}} @_ZN13basic_istreamIcED1Ev
// CHECK: call {{.*}} @_ZdlPv
// basic_istream's base dtor is a no-op.
// CHECK: define linkonce_odr {{.*}} @_ZN13basic_istreamIcED2Ev(%struct.basic_istream* %this, i8** %vtt) unnamed_addr
// CHECK: define linkonce_odr {{.*}} @_ZN13basic_istreamIcED2Ev(%struct.basic_istream* {{.*}}%this, i8** %vtt) unnamed_addr
// CHECK-NOT: call
// CHECK: }