From b987eda3e3cedc2ff9d37700c8f6c3498b72384a Mon Sep 17 00:00:00 2001 From: Stephen Lin Date: Tue, 18 Jun 2013 20:24:04 +0000 Subject: [PATCH] Fix C++ constructor/destructor tests when run on ARM git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184225 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGenCXX/copy-constructor-synthesis-2.cpp | 10 +++++++--- .../default-constructor-template-member.cpp | 14 ++++++++++---- test/CodeGenCXX/mangle-template.cpp | 4 ++-- test/CodeGenCXX/virtual-base-destructor-call.cpp | 12 ++++++------ 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/test/CodeGenCXX/copy-constructor-synthesis-2.cpp b/test/CodeGenCXX/copy-constructor-synthesis-2.cpp index d028a28fdd..e84ffd93be 100644 --- a/test/CodeGenCXX/copy-constructor-synthesis-2.cpp +++ b/test/CodeGenCXX/copy-constructor-synthesis-2.cpp @@ -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) diff --git a/test/CodeGenCXX/default-constructor-template-member.cpp b/test/CodeGenCXX/default-constructor-template-member.cpp index 0dd64dfcb4..27f2ba2620 100644 --- a/test/CodeGenCXX/default-constructor-template-member.cpp +++ b/test/CodeGenCXX/default-constructor-template-member.cpp @@ -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 struct A { A(); }; struct B { A 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 diff --git a/test/CodeGenCXX/mangle-template.cpp b/test/CodeGenCXX/mangle-template.cpp index 15a85c7bd2..03eae53ad0 100644 --- a/test/CodeGenCXX/mangle-template.cpp +++ b/test/CodeGenCXX/mangle-template.cpp @@ -82,7 +82,7 @@ namespace test7 { X(U*, typename int_c<(meta::value + meta::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::X(double*, float*); } @@ -101,7 +101,7 @@ namespace test8 { template void f(int_c::type::value>) { } - // CHECK: define weak_odr void @_ZN5test81fIiEEvNS_5int_cIXsr4metaIT_E4typeE5valueEEE + // CHECK: define weak_odr void @_ZN5test81fIiEEvNS_5int_cIXsr4metaIT_E4typeE5valueEEE( template void f(int_c); } diff --git a/test/CodeGenCXX/virtual-base-destructor-call.cpp b/test/CodeGenCXX/virtual-base-destructor-call.cpp index 2424d218d6..a8d4520b5e 100644 --- a/test/CodeGenCXX/virtual-base-destructor-call.cpp +++ b/test/CodeGenCXX/virtual-base-destructor-call.cpp @@ -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: } -- 2.40.0