From: David Majnemer Date: Wed, 17 Jun 2015 20:53:19 +0000 (+0000) Subject: Update clang to take into account the changes to personality fns X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa3804032d59c11a345ef7558d7938db43e86497;p=clang Update clang to take into account the changes to personality fns git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239941 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp index d9a3f0b252..4c8501724b 100644 --- a/lib/CodeGen/CGException.cpp +++ b/lib/CodeGen/CGException.cpp @@ -698,13 +698,15 @@ llvm::BasicBlock *CodeGenFunction::EmitLandingPad() { const EHPersonality &personality = EHPersonality::get(*this); + if (!CurFn->hasPersonalityFn()) + CurFn->setPersonalityFn(getOpaquePersonalityFn(CGM, personality)); + // Create and configure the landing pad. llvm::BasicBlock *lpad = createBasicBlock("lpad"); EmitBlock(lpad); - llvm::LandingPadInst *LPadInst = - Builder.CreateLandingPad(llvm::StructType::get(Int8PtrTy, Int32Ty, nullptr), - getOpaquePersonalityFn(CGM, personality), 0); + llvm::LandingPadInst *LPadInst = Builder.CreateLandingPad( + llvm::StructType::get(Int8PtrTy, Int32Ty, nullptr), 0); llvm::Value *LPadExn = Builder.CreateExtractValue(LPadInst, 0); Builder.CreateStore(LPadExn, getExceptionSlot()); @@ -1193,9 +1195,12 @@ llvm::BasicBlock *CodeGenFunction::getTerminateLandingPad() { // Tell the backend that this is a landing pad. const EHPersonality &Personality = EHPersonality::get(*this); - llvm::LandingPadInst *LPadInst = - Builder.CreateLandingPad(llvm::StructType::get(Int8PtrTy, Int32Ty, nullptr), - getOpaquePersonalityFn(CGM, Personality), 0); + + if (!CurFn->hasPersonalityFn()) + CurFn->setPersonalityFn(getOpaquePersonalityFn(CGM, Personality)); + + llvm::LandingPadInst *LPadInst = Builder.CreateLandingPad( + llvm::StructType::get(Int8PtrTy, Int32Ty, nullptr), 0); LPadInst->addClause(getCatchAllValue(*this)); llvm::Value *Exn = 0; diff --git a/test/CXX/except/except.spec/p9-dynamic.cpp b/test/CXX/except/except.spec/p9-dynamic.cpp index 4559e0d467..1e7b29479f 100644 --- a/test/CXX/except/except.spec/p9-dynamic.cpp +++ b/test/CXX/except/except.spec/p9-dynamic.cpp @@ -7,6 +7,6 @@ void target() throw(int) // CHECK: invoke void @_Z8externalv() external(); } -// CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) +// CHECK: landingpad { i8*, i32 } // CHECK-NEXT: filter [1 x i8*] [i8* bitcast (i8** @_ZTIi to i8*)] // CHECK: call void @__cxa_call_unexpected diff --git a/test/CXX/except/except.spec/p9-noexcept.cpp b/test/CXX/except/except.spec/p9-noexcept.cpp index 3fd45c55da..d8cda2f622 100644 --- a/test/CXX/except/except.spec/p9-noexcept.cpp +++ b/test/CXX/except/except.spec/p9-noexcept.cpp @@ -7,7 +7,7 @@ void target() noexcept // CHECK: invoke void @_Z8externalv() external(); } -// CHECK: [[T0:%.*]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) +// CHECK: [[T0:%.*]] = landingpad { i8*, i32 } // CHECK-NEXT: catch i8* null // CHECK-NEXT: [[T1:%.*]] = extractvalue { i8*, i32 } [[T0]], 0 // CHECK-NEXT: call void @__clang_call_terminate(i8* [[T1]]) [[NR_NUW:#[0-9]+]] diff --git a/test/CodeGen/exceptions-seh.c b/test/CodeGen/exceptions-seh.c index d8135e805c..1b77ad6162 100644 --- a/test/CodeGen/exceptions-seh.c +++ b/test/CodeGen/exceptions-seh.c @@ -19,12 +19,12 @@ int safe_div(int numerator, int denominator, int *res) { *res = myres; return success; } -// CHECK-LABEL: define i32 @safe_div(i32 %numerator, i32 %denominator, i32* %res) +// CHECK-LABEL: define i32 @safe_div(i32 %numerator, i32 %denominator, i32* %res) {{.*}} personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) // CHECK: invoke void @try_body(i32 %{{.*}}, i32 %{{.*}}, i32* %{{.*}}) #[[NOINLINE:[0-9]+]] // CHECK: to label %{{.*}} unwind label %[[lpad:[^ ]*]] // // CHECK: [[lpad]] -// CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) +// CHECK: landingpad { i8*, i32 } // CHECK-NEXT: catch i8* null // CHECK-NOT: br i1 // CHECK: br label %[[except:[^ ]*]] @@ -46,7 +46,7 @@ int filter_expr_capture(void) { return r; } -// CHECK-LABEL: define i32 @filter_expr_capture() +// CHECK-LABEL: define i32 @filter_expr_capture() {{.*}} personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) // CHECK: call void (...) @llvm.frameescape(i32* %[[r:[^ ,]*]]) // CHECK: store i32 42, i32* %[[r]] // CHECK: invoke void @j() #[[NOINLINE]] @@ -77,7 +77,7 @@ int nested_try(void) { } return r; } -// CHECK-LABEL: define i32 @nested_try() +// CHECK-LABEL: define i32 @nested_try() {{.*}} personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) // CHECK: store i32 42, i32* %[[r:[^ ,]*]] // CHECK: invoke void @j() #[[NOINLINE]] // CHECK: to label %[[cont:[^ ]*]] unwind label %[[lpad:[^ ]*]] @@ -87,7 +87,7 @@ int nested_try(void) { // CHECK: br label %[[inner_try_cont:[^ ]*]] // // CHECK: [[lpad]] -// CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) +// CHECK: landingpad { i8*, i32 } // CHECK: catch i8* bitcast (i32 (i8*, i8*)* @"\01?filt$1@0@nested_try@@" to i8*) // CHECK: catch i8* bitcast (i32 (i8*, i8*)* @"\01?filt$0@0@nested_try@@" to i8*) // CHECK: store i8* %{{.*}}, i8** %[[ehptr_slot:[^ ]*]] @@ -125,7 +125,7 @@ void basic_finally(void) { --g; } } -// CHECK-LABEL: define void @basic_finally() +// CHECK-LABEL: define void @basic_finally() {{.*}} personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) // CHECK: load i32, i32* @g // CHECK: add i32 %{{.*}}, 1 // CHECK: store i32 %{{.*}}, i32* @g @@ -139,7 +139,7 @@ void basic_finally(void) { // CHECK: ret void // // CHECK: [[lpad]] -// CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) +// CHECK: landingpad { i8*, i32 } // CHECK-NEXT: cleanup // CHECK: %[[fp:[^ ]*]] = call i8* @llvm.frameaddress(i32 0) // CHECK: call void @"\01?fin$0@0@basic_finally@@"(i8 1, i8* %[[fp]]) diff --git a/test/CodeGen/exceptions.c b/test/CodeGen/exceptions.c index ae0af4dd9d..039ec84d2e 100644 --- a/test/CodeGen/exceptions.c +++ b/test/CodeGen/exceptions.c @@ -5,8 +5,8 @@ void test1() { extern void test1_helper(void (^)(int)); - // CHECK-LABEL: define void @test1() - // CHECK-ARM-LABEL: define arm_aapcscc void @test1() + // CHECK-LABEL: define void @test1() {{.*}} personality i8* bitcast (i32 (...)* @__gcc_personality_v0 to i8*) + // CHECK-ARM-LABEL: define arm_aapcscc void @test1() {{.*}} personality i8* bitcast (i32 (...)* @__gcc_personality_sj0 to i8*) __block int x = 10; @@ -14,9 +14,9 @@ void test1() { // CHECK-ARM: invoke arm_aapcscc void @test1_helper( test1_helper(^(int v) { x = v; }); - // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gcc_personality_v0 to i8*) + // CHECK: landingpad { i8*, i32 } // CHECK-NEXT: cleanup - // CHECK-ARM: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gcc_personality_sj0 to i8*) + // CHECK-ARM: landingpad { i8*, i32 } // CHECK-ARM-NEXT: cleanup } diff --git a/test/CodeGenCXX/arm.cpp b/test/CodeGenCXX/arm.cpp index 7d94cba7ff..0fadfe97b4 100644 --- a/test/CodeGenCXX/arm.cpp +++ b/test/CodeGenCXX/arm.cpp @@ -291,7 +291,7 @@ namespace test7 { // Static and guard tested at top of file - // CHECK-LABEL: define void @_ZN5test74testEv() + // CHECK-LABEL: define void @_ZN5test74testEv() {{.*}} personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) void test() { // CHECK: [[T0:%.*]] = load atomic i8, i8* bitcast (i32* @_ZGVZN5test74testEvE1x to i8*) acquire, align 1 // CHECK-NEXT: [[T1:%.*]] = and i8 [[T0]], 1 @@ -311,7 +311,7 @@ namespace test7 { // CHECK: ret void static int x = foo(); - // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + // CHECK: landingpad { i8*, i32 } // CHECK-NEXT: cleanup // CHECK: call void @__cxa_guard_abort(i32* @_ZGVZN5test74testEvE1x) // CHECK: resume { i8*, i32 } @@ -326,7 +326,7 @@ namespace test8 { // Static and guard tested at top of file - // CHECK-LABEL: define void @_ZN5test84testEv() + // CHECK-LABEL: define void @_ZN5test84testEv() {{.*}} personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) void test() { // CHECK: [[T0:%.*]] = load atomic i8, i8* bitcast (i32* @_ZGVZN5test84testEvE1x to i8*) acquire, align 1 // CHECK-NEXT: [[T1:%.*]] = and i8 [[T0]], 1 @@ -351,7 +351,7 @@ namespace test8 { // CHECK: ret void static A x; - // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + // CHECK: landingpad { i8*, i32 } // CHECK-NEXT: cleanup // CHECK: call void @__cxa_guard_abort(i32* @_ZGVZN5test84testEvE1x) // CHECK: resume { i8*, i32 } diff --git a/test/CodeGenCXX/cxx11-exception-spec.cpp b/test/CodeGenCXX/cxx11-exception-spec.cpp index 3fb5c15c2a..a3dff79fc4 100644 --- a/test/CodeGenCXX/cxx11-exception-spec.cpp +++ b/test/CodeGenCXX/cxx11-exception-spec.cpp @@ -13,7 +13,7 @@ template struct S { // CHECK: define {{.*}} @_Z1fIsEvv() [[NONE:#[0-9]+]] { template<> void f() { h(); } -// CHECK: define {{.*}} @_Z1fIA2_sEvv() [[NUW:#[0-9]+]] { +// CHECK: define {{.*}} @_Z1fIA2_sEvv() [[NUW:#[0-9]+]] personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { template<> void f() noexcept { h(); } // CHECK: define {{.*}} @_ZN1SIsE1fEv() @@ -24,7 +24,7 @@ template<> void S::f() noexcept { h(); } // CHECK: define {{.*}} @_Z1fIDsEvv() [[NONE]] comdat { template void f(); -// CHECK: define {{.*}} @_Z1fIA2_DsEvv() [[NUW]] comdat { +// CHECK: define {{.*}} @_Z1fIA2_DsEvv() [[NUW]] comdat personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { template void f(); // CHECK: define {{.*}} @_ZN1SIDsE1fEv() @@ -34,7 +34,7 @@ template void S::f(); template void S::f(); void h() { - // CHECK: define {{.*}} @_Z1fIiEvv() [[NUW]] comdat { + // CHECK: define {{.*}} @_Z1fIiEvv() [[NUW]] comdat personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { f(); // CHECK: define {{.*}} @_Z1fIA2_iEvv() [[NONE]] comdat { f(); @@ -45,7 +45,7 @@ void h() { // CHECK-NOT: [[NUW]] S::f(); - // CHECK: define {{.*}} @_Z1fIfEvv() [[NUW]] comdat { + // CHECK: define {{.*}} @_Z1fIfEvv() [[NUW]] comdat personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { void (*f1)() = &f; // CHECK: define {{.*}} @_Z1fIdEvv() [[NONE]] comdat { void (*f2)() = &f; @@ -56,7 +56,7 @@ void h() { // CHECK-NOT: [[NUW]] void (*f4)() = &S::f; - // CHECK: define {{.*}} @_Z1fIA4_cEvv() [[NUW]] comdat { + // CHECK: define {{.*}} @_Z1fIA4_cEvv() [[NUW]] comdat personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { (void)&f; // CHECK: define {{.*}} @_Z1fIcEvv() [[NONE]] comdat { (void)&f; diff --git a/test/CodeGenCXX/destructors.cpp b/test/CodeGenCXX/destructors.cpp index 2918cf3977..b47c6c6b1d 100644 --- a/test/CodeGenCXX/destructors.cpp +++ b/test/CodeGenCXX/destructors.cpp @@ -191,10 +191,11 @@ namespace test3 { // CHECK4: ret void // CHECK4-LABEL: define internal void @_ZN5test312_GLOBAL__N_11DD0Ev(%"struct.test3::(anonymous namespace)::D"* %this) unnamed_addr + // CHECK4-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) // CHECK4: invoke void {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev // CHECK4: call void @_ZdlPv({{.*}}) [[NUW:#[0-9]+]] // CHECK4: ret void - // CHECK4: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + // CHECK4: landingpad { i8*, i32 } // CHECK4-NEXT: cleanup // CHECK4: call void @_ZdlPv({{.*}}) [[NUW]] // CHECK4: resume { i8*, i32 } @@ -210,10 +211,11 @@ namespace test3 { // CHECK4: ret void // CHECK4-LABEL: define internal void @_ZN5test312_GLOBAL__N_11CD0Ev(%"struct.test3::(anonymous namespace)::C"* %this) unnamed_addr + // CHECK4-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) // CHECK4: invoke void @_ZN5test312_GLOBAL__N_11CD2Ev( // CHECK4: call void @_ZdlPv({{.*}}) [[NUW]] // CHECK4: ret void - // CHECK4: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + // CHECK4: landingpad { i8*, i32 } // CHECK4-NEXT: cleanup // CHECK4: call void @_ZdlPv({{.*}}) [[NUW]] // CHECK4: resume { i8*, i32 } diff --git a/test/CodeGenCXX/dynamic-cast.cpp b/test/CodeGenCXX/dynamic-cast.cpp index fe85e212b6..9467f3e80d 100644 --- a/test/CodeGenCXX/dynamic-cast.cpp +++ b/test/CodeGenCXX/dynamic-cast.cpp @@ -3,6 +3,7 @@ struct A { virtual void f(); }; struct B : A { }; // CHECK: {{define.*@_Z1fP1A}} +// CHECK-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) B fail; const B& f(A *a) { try { @@ -11,7 +12,7 @@ const B& f(A *a) { // CHECK: invoke void @__cxa_bad_cast() [[NR:#[0-9]+]] dynamic_cast(*a); } catch (...) { - // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + // CHECK: landingpad { i8*, i32 } // CHECK-NEXT: catch i8* null } return fail; diff --git a/test/CodeGenCXX/eh.cpp b/test/CodeGenCXX/eh.cpp index 77655f0b9f..b44e8144bb 100644 --- a/test/CodeGenCXX/eh.cpp +++ b/test/CodeGenCXX/eh.cpp @@ -102,6 +102,7 @@ namespace test6 { // PR7127 namespace test7 { // CHECK-LABEL: define i32 @_ZN5test73fooEv() +// CHECK-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) int foo() { // CHECK: [[CAUGHTEXNVAR:%.*]] = alloca i8* // CHECK-NEXT: [[SELECTORVAR:%.*]] = alloca i32 @@ -115,7 +116,7 @@ namespace test7 { throw 1; } -// CHECK: [[CAUGHTVAL:%.*]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) +// CHECK: [[CAUGHTVAL:%.*]] = landingpad { i8*, i32 } // CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*) // CHECK-NEXT: catch i8* null // CHECK-NEXT: [[CAUGHTEXN:%.*]] = extractvalue { i8*, i32 } [[CAUGHTVAL]], 0 @@ -137,7 +138,7 @@ namespace test7 { throw; } } -// CHECK: [[CAUGHTVAL:%.*]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) +// CHECK: [[CAUGHTVAL:%.*]] = landingpad { i8*, i32 } // CHECK-NEXT: catch i8* null // CHECK-NEXT: [[CAUGHTEXN:%.*]] = extractvalue { i8*, i32 } [[CAUGHTVAL]], 0 // CHECK-NEXT: store i8* [[CAUGHTEXN]], i8** [[CAUGHTEXNVAR]] @@ -186,11 +187,12 @@ namespace test9 { // CHECK-LABEL: define void @_ZN5test91AC2Ev(%"struct.test9::A"* %this) unnamed_addr + // CHECK-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) A::A() try { // CHECK: invoke void @_ZN5test96opaqueEv() opaque(); } catch (int x) { - // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + // CHECK: landingpad { i8*, i32 } // CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*) // CHECK: call i8* @__cxa_begin_catch diff --git a/test/CodeGenCXX/exceptions-seh.cpp b/test/CodeGenCXX/exceptions-seh.cpp index 3e77f12fb5..2cee4f77e5 100644 --- a/test/CodeGenCXX/exceptions-seh.cpp +++ b/test/CodeGenCXX/exceptions-seh.cpp @@ -22,6 +22,7 @@ extern "C" void use_cxx() { // Make sure we use __CxxFrameHandler3 for C++ EH. // CXXEH-LABEL: define void @use_cxx() +// CXXEH-SAME: personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) // CXXEH: call %struct.HasCleanup* @"\01??0HasCleanup@@QEAA@XZ"(%struct.HasCleanup* %{{.*}}) // CXXEH: invoke void @might_throw() // CXXEH: to label %[[cont:[^ ]*]] unwind label %[[lpad:[^ ]*]] @@ -31,7 +32,7 @@ extern "C" void use_cxx() { // CXXEH: ret void // // CXXEH: [[lpad]] -// CXXEH: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +// CXXEH: landingpad { i8*, i32 } // CXXEH-NEXT: cleanup // CXXEH: call void @"\01??1HasCleanup@@QEAA@XZ"(%struct.HasCleanup* %{{.*}}) // CXXEH: br label %[[resume:[^ ]*]] @@ -59,6 +60,7 @@ extern "C" void use_seh() { // Make sure we use __C_specific_handler for SEH. // CHECK-LABEL: define void @use_seh() +// CHECK-SAME: personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) // CHECK: invoke void @might_throw() #[[NOINLINE:[0-9]+]] // CHECK: to label %[[cont:[^ ]*]] unwind label %[[lpad:[^ ]*]] // @@ -66,7 +68,7 @@ extern "C" void use_seh() { // CHECK: br label %[[ret:[^ ]*]] // // CHECK: [[lpad]] -// CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) +// CHECK: landingpad { i8*, i32 } // CHECK-NEXT: catch i8* // // CHECK: br label %[[ret]] @@ -86,15 +88,17 @@ void use_seh_in_lambda() { } // CXXEH-LABEL: define void @"\01?use_seh_in_lambda@@YAXXZ"() -// CXXEH: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +// CXXEH-SAME: personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +// CXXEH: landingpad { i8*, i32 } // NOCXX-LABEL: define void @"\01?use_seh_in_lambda@@YAXXZ"() // NOCXX-NOT: invoke // NOCXX: ret void // CHECK-LABEL: define internal void @"\01??R@?use_seh_in_lambda@@YAXXZ@QEBAXXZ"(%class.anon* %this) +// CXXEH-SAME: personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) // CHECK: invoke void @might_throw() #[[NOINLINE]] -// CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) +// CHECK: landingpad { i8*, i32 } static int my_unique_global; @@ -114,10 +118,11 @@ void use_inline() { use_seh_in_inline_func(); } -// CHECK-LABEL: define linkonce_odr void @use_seh_in_inline_func() #{{[0-9]+}} comdat { +// CHECK-LABEL: define linkonce_odr void @use_seh_in_inline_func() #{{[0-9]+}} comdat +// CHECK-SAME: personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) // CHECK: invoke void @might_throw() // -// CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) +// CHECK: landingpad { i8*, i32 } // CHECK-NEXT: catch i8* bitcast (i32 (i8*, i8*)* @"\01?filt$0@0@use_seh_in_inline_func@@" to i8*) // // CHECK: invoke void @might_throw() @@ -126,7 +131,7 @@ void use_inline() { // CHECK: call void @"\01?fin$0@0@use_seh_in_inline_func@@"(i8 0, i8* %[[fp]]) // CHECK: ret void // -// CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) +// CHECK: landingpad { i8*, i32 } // CHECK-NEXT: cleanup // CHECK: %[[fp:[^ ]*]] = call i8* @llvm.frameaddress(i32 0) // CHECK: call void @"\01?fin$0@0@use_seh_in_inline_func@@"(i8 1, i8* %[[fp]]) diff --git a/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp b/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp index 5f6849dde0..89a62c2cb3 100644 --- a/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp +++ b/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp @@ -17,6 +17,7 @@ struct S { // CHECK-DAG: @"\01?$TSS0@?1??h@@YAAAUS@@_N@Z" = linkonce_odr global i32 0 // CHECK-LABEL: define {{.*}} @"\01?f@@YAAAUS@@XZ"() +// CHECK-SAME: personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) extern inline S &f() { static thread_local S s; // CHECK: %[[guard:.*]] = load i32, i32* @"\01??__J?1??f@@YAAAUS@@XZ@51" @@ -38,7 +39,7 @@ extern inline S &f() { // CHECK-NEXT: ret %struct.S* @"\01?s@?1??f@@YAAAUS@@XZ@4U2@A" // CHECK: [[lpad:.*]]: -// CHECK-NEXT: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +// CHECK-NEXT: landingpad { i8*, i32 } // CHECK-NEXT: cleanup // CHECK: %[[guard:.*]] = load i32, i32* @"\01??__J?1??f@@YAAAUS@@XZ@51" // CHECK-NEXT: %[[mask:.*]] = and i32 %[[guard]], -2 diff --git a/test/CodeGenCXX/mingw-w64-seh-exceptions.cpp b/test/CodeGenCXX/mingw-w64-seh-exceptions.cpp index bacddb2936..9025f877c5 100644 --- a/test/CodeGenCXX/mingw-w64-seh-exceptions.cpp +++ b/test/CodeGenCXX/mingw-w64-seh-exceptions.cpp @@ -16,9 +16,11 @@ extern "C" void test() { } // X64: define void @test() +// X64-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_seh0 to i8*) // X64: invoke void @foo() -// X64: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_seh0 to i8*) +// X64: landingpad { i8*, i32 } // X86: define void @test() +// X86-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) // X86: invoke void @foo() -// X86: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) +// X86: landingpad { i8*, i32 } diff --git a/test/CodeGenCXX/nrvo.cpp b/test/CodeGenCXX/nrvo.cpp index bf0e303d8f..8744d141dd 100644 --- a/test/CodeGenCXX/nrvo.cpp +++ b/test/CodeGenCXX/nrvo.cpp @@ -44,6 +44,7 @@ X test1(bool B) { // CHECK-LABEL: define void @_Z5test2b // CHECK-EH-LABEL: define void @_Z5test2b +// CHECK-EH-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) X test2(bool B) { // No NRVO. @@ -82,7 +83,7 @@ X test2(bool B) { // -> %cleanup, %lpad1 // %lpad: landing pad for ctor of 'y', dtor of 'y' - // CHECK-EH: [[CAUGHTVAL:%.*]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + // CHECK-EH: [[CAUGHTVAL:%.*]] = landingpad { i8*, i32 } // CHECK-EH-NEXT: cleanup // CHECK-EH-NEXT: extractvalue { i8*, i32 } [[CAUGHTVAL]], 0 // CHECK-EH-NEXT: extractvalue { i8*, i32 } [[CAUGHTVAL]], 1 @@ -116,7 +117,7 @@ X test2(bool B) { // CHECK-EH: resume { i8*, i32 } // %terminate.lpad: terminate landing pad. - // CHECK-EH: [[T0:%.*]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + // CHECK-EH: [[T0:%.*]] = landingpad { i8*, i32 } // CHECK-EH-NEXT: catch i8* null // CHECK-EH-NEXT: [[T1:%.*]] = extractvalue { i8*, i32 } [[T0]], 0 // CHECK-EH-NEXT: call void @__clang_call_terminate(i8* [[T1]]) [[NR_NUW:#[0-9]+]] diff --git a/test/CodeGenCXX/partial-destruction.cpp b/test/CodeGenCXX/partial-destruction.cpp index 01e289450d..d135149592 100644 --- a/test/CodeGenCXX/partial-destruction.cpp +++ b/test/CodeGenCXX/partial-destruction.cpp @@ -12,6 +12,7 @@ namespace test0 { opaque(); } // CHECK-LABEL: define void @_ZN5test04testEv() + // CHECK-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) // CHECK: [[AS:%.*]] = alloca [10 x [[A:%.*]]], align // CHECK-NEXT: [[ENDVAR:%.*]] = alloca [[A]]* // CHECK-NEXT: [[EXN:%.*]] = alloca i8* @@ -50,7 +51,7 @@ namespace test0 { // CHECK: ret void // Partial destroy for initialization. - // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + // CHECK: landingpad { i8*, i32 } // CHECK-NEXT: cleanup // CHECK: [[PARTIAL_END:%.*]] = load [[A]]*, [[A]]** [[ENDVAR]] // CHECK-NEXT: [[T0:%.*]] = icmp eq [[A]]* [[E_BEGIN]], [[PARTIAL_END]] @@ -62,7 +63,7 @@ namespace test0 { // CHECK-NEXT: br i1 [[T0]], // Primary EH destructor. - // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + // CHECK: landingpad { i8*, i32 } // CHECK-NEXT: cleanup // CHECK: [[E0:%.*]] = getelementptr inbounds [10 x [[A]]], [10 x [[A]]]* [[AS]], i32 0, i32 0 // CHECK-NEXT: [[E_END:%.*]] = getelementptr inbounds [[A]], [[A]]* [[E0]], i64 10 @@ -72,7 +73,7 @@ namespace test0 { // FIXME: There's some really bad block ordering here which causes // the partial destroy for the primary normal destructor to fall // within the primary EH destructor. - // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + // CHECK: landingpad { i8*, i32 } // CHECK-NEXT: cleanup // CHECK: [[T0:%.*]] = icmp eq [[A]]* [[ED_BEGIN]], [[ED_CUR]] // CHECK-NEXT: br i1 [[T0]] @@ -99,6 +100,7 @@ namespace test1 { B v = { 5, 6, 7, 8 }; } // CHECK-LABEL: define void @_ZN5test14testEv() + // CHECK-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) // CHECK: [[V:%.*]] = alloca [[B:%.*]], align 4 // CHECK-NEXT: alloca i8* // CHECK-NEXT: alloca i32 @@ -114,9 +116,9 @@ namespace test1 { // CHECK-NEXT: ret void // FIXME: again, the block ordering is pretty bad here - // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + // CHECK: landingpad { i8*, i32 } // CHECK-NEXT: cleanup - // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + // CHECK: landingpad { i8*, i32 } // CHECK-NEXT: cleanup // CHECK: invoke void @_ZN5test11AD1Ev([[A]]* [[Y]]) // CHECK: invoke void @_ZN5test11AD1Ev([[A]]* [[X]]) @@ -129,6 +131,7 @@ namespace test2 { A v[4][7]; // CHECK-LABEL: define void @_ZN5test24testEv() + // CHECK-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) // CHECK: [[V:%.*]] = alloca [4 x [7 x [[A:%.*]]]], align 1 // CHECK-NEXT: alloca i8* // CHECK-NEXT: alloca i32 @@ -144,7 +147,7 @@ namespace test2 { // CHECK-NEXT: br i1 [[DONE]], // Partial destruction landing pad. - // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + // CHECK: landingpad { i8*, i32 } // CHECK-NEXT: cleanup // CHECK: [[EMPTY:%.*]] = icmp eq [[A]]* [[BEGIN]], [[CUR]] // CHECK-NEXT: br i1 [[EMPTY]], diff --git a/test/CodeGenCXX/threadsafe-statics-exceptions.cpp b/test/CodeGenCXX/threadsafe-statics-exceptions.cpp index 70decc98a1..41325fa64f 100644 --- a/test/CodeGenCXX/threadsafe-statics-exceptions.cpp +++ b/test/CodeGenCXX/threadsafe-statics-exceptions.cpp @@ -8,6 +8,7 @@ struct X { struct Y { }; // CHECK-LABEL: define void @_Z1fv +// CHECK-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) void f() { // CHECK: call i32 @__cxa_guard_acquire(i64* @_ZGVZ1fvE1x) // CHECK: invoke void @_ZN1XC1Ev @@ -21,7 +22,7 @@ void f() { throw Y(); // Finally, the landing pad. - // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + // CHECK: landingpad { i8*, i32 } // CHECK: cleanup // CHECK: call void @__cxa_guard_abort(i64* @_ZGVZ1fvE1x) // CHECK: resume { i8*, i32 } diff --git a/test/CodeGenCXX/typeid.cpp b/test/CodeGenCXX/typeid.cpp index 9d212905e6..364f058c5b 100644 --- a/test/CodeGenCXX/typeid.cpp +++ b/test/CodeGenCXX/typeid.cpp @@ -31,13 +31,14 @@ const std::type_info &a_ti = typeid(a); const std::type_info &A10_c_ti = typeid(char const[10]); // CHECK-LABEL: define i8* @_ZN5Test11fEv +// CHECK-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) const char *f() { try { // CHECK: br i1 // CHECK: invoke void @__cxa_bad_typeid() [[NR:#[0-9]+]] return typeid(*static_cast(0)).name(); } catch (...) { - // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + // CHECK: landingpad { i8*, i32 } // CHECK-NEXT: catch i8* null } diff --git a/test/CodeGenCXX/windows-itanium-exceptions.cpp b/test/CodeGenCXX/windows-itanium-exceptions.cpp index 3694d2c813..b2c8707efc 100644 --- a/test/CodeGenCXX/windows-itanium-exceptions.cpp +++ b/test/CodeGenCXX/windows-itanium-exceptions.cpp @@ -20,7 +20,8 @@ void attempt() { // CHECK: unreachable // CHECK: } -// CHECK: define {{.*}}void @_Z7attemptv() {{.*}} { +// CHECK: define {{.*}}void @_Z7attemptv() +// CHECK-SAME: personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) // CHECK: %exn.slot = alloca i8* // CHECK: %ehselector.slot = alloca i32 // CHECK: invoke {{.*}}void @_Z6exceptv() @@ -28,7 +29,7 @@ void attempt() { // CHECK: invoke.cont: // CHECK: br label %try.cont // CHECK: lpad: -// CHECK: %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) +// CHECK: %0 = landingpad { i8*, i32 } // CHECK: catch i8* null // CHECK: %1 = extractvalue { i8*, i32 } %0, 0 // CHECK: store i8* %1, i8** %exn.slot diff --git a/test/CodeGenObjC/autorelease.m b/test/CodeGenObjC/autorelease.m index 6bb80fd2bd..ab65f8088d 100644 --- a/test/CodeGenObjC/autorelease.m +++ b/test/CodeGenObjC/autorelease.m @@ -46,7 +46,7 @@ int tryTo(int (*f)(void)) { // CHECK-NEXT: [[T2:%.*]] = invoke i32 [[T1]]() // CHECK: store i32 [[T2]], i32* [[RET]] // CHECK: invoke void @objc_autoreleasePoolPop(i8* [[T0]]) -// CHECK: landingpad { i8*, i32 } personality +// CHECK: landingpad { i8*, i32 } // CHECK-NEXT: catch i8* null // CHECK: call i8* @objc_begin_catch // CHECK-NEXT: store i32 0, i32* [[RET]] diff --git a/test/CodeGenObjC/blocks-2.m b/test/CodeGenObjC/blocks-2.m index 0c6bd562b5..b9562ad6d6 100644 --- a/test/CodeGenObjC/blocks-2.m +++ b/test/CodeGenObjC/blocks-2.m @@ -30,7 +30,7 @@ void test1() { // CHECK-NEXT: call void @_Block_object_dispose(i8* [[T1]], i32 8) // CHECK-NEXT: ret void - // CHECK: landingpad { i8*, i32 } personality + // CHECK: landingpad { i8*, i32 } // CHECK-NEXT: cleanup // CHECK: [[T1:%.*]] = bitcast [[N_T]]* [[N]] to i8* // CHECK-NEXT: call void @_Block_object_dispose(i8* [[T1]], i32 8) diff --git a/test/CodeGenObjC/gnu-exceptions.m b/test/CodeGenObjC/gnu-exceptions.m index 82eb6cb7bd..76e9e1ded3 100644 --- a/test/CodeGenObjC/gnu-exceptions.m +++ b/test/CodeGenObjC/gnu-exceptions.m @@ -6,7 +6,8 @@ void log(int i); @class C; -// CHECK: define void @test0() [[TF:#[0-9]+]] { +// CHECK: define void @test0() [[TF:#[0-9]+]] +// CHECK-SAME: personality i8* bitcast (i32 (...)* @__gnu_objc_personality_v0 to i8*) void test0() { @try { // CHECK: invoke void @opaque() @@ -15,7 +16,7 @@ void test0() { // CHECK: call void @log(i32 1) } @catch (C *c) { - // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gnu_objc_personality_v0 to i8*) + // CHECK: landingpad { i8*, i32 } // CHECK-NEXT: catch i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i64 0, i64 0) // CHECK: br i1 diff --git a/test/CodeGenObjC/terminate.m b/test/CodeGenObjC/terminate.m index 4992b998b3..a756bfba41 100644 --- a/test/CodeGenObjC/terminate.m +++ b/test/CodeGenObjC/terminate.m @@ -10,20 +10,22 @@ void test0(void) { test0_helper(); // CHECK-WITH-LABEL: define void @test0() + // CHECK-WITH-SAME: personality i8* bitcast (i32 (...)* @__gcc_personality_v0 to i8*) // CHECK-WITH: [[PTR:%.*]] = alloca i8*, // CHECK-WITH: call void @destroy(i8** [[PTR]]) // CHECK-WITH-NEXT: ret void // CHECK-WITH: invoke void @destroy(i8** [[PTR]]) - // CHECK-WITH: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gcc_personality_v0 to i8*) + // CHECK-WITH: landingpad { i8*, i32 } // CHECK-WITH-NEXT: catch i8* null // CHECK-WITH-NEXT: call void @objc_terminate() // CHECK-WITHOUT-LABEL: define void @test0() + // CHECK-WITHOUT-SAME: personality i8* bitcast (i32 (...)* @__gcc_personality_v0 to i8*) // CHECK-WITHOUT: [[PTR:%.*]] = alloca i8*, // CHECK-WITHOUT: call void @destroy(i8** [[PTR]]) // CHECK-WITHOUT-NEXT: ret void // CHECK-WITHOUT: invoke void @destroy(i8** [[PTR]]) - // CHECK-WITHOUT: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gcc_personality_v0 to i8*) + // CHECK-WITHOUT: landingpad { i8*, i32 } // CHECK-WITHOUT-NEXT: catch i8* null // CHECK-WITHOUT-NEXT: call void @abort() } diff --git a/test/CodeGenObjCXX/catch-id-type.mm b/test/CodeGenObjCXX/catch-id-type.mm index 0a2b940ff1..aa861cb680 100644 --- a/test/CodeGenObjCXX/catch-id-type.mm +++ b/test/CodeGenObjCXX/catch-id-type.mm @@ -30,7 +30,7 @@ id FUNC() { } catch( id error ) { - // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + // CHECK: landingpad { i8*, i32 } // CHECK-NEXT: catch i8* bitcast ({ i8*, i8*, i32, i8* }* @_ZTIPU11objcproto1P4INTF to i8*) // CHECK-NEXT: catch i8* bitcast ({ i8*, i8*, i32, i8* }* @_ZTIP11objc_object to i8*) // CHECK-NEXT: catch i8* bitcast ({ i8*, i8*, i32, i8* }* @_ZTIP10objc_class to i8*) diff --git a/test/CodeGenObjCXX/exceptions.mm b/test/CodeGenObjCXX/exceptions.mm index a62a82b08c..ef25f359e8 100644 --- a/test/CodeGenObjCXX/exceptions.mm +++ b/test/CodeGenObjCXX/exceptions.mm @@ -6,12 +6,13 @@ void opaque(); namespace test0 { // CHECK-LABEL: define void @_ZN5test03fooEv + // CHECK-SAME: personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) void foo() { try { // CHECK: invoke void @_Z6opaquev opaque(); } catch (OCType *T) { - // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) + // CHECK: landingpad { i8*, i32 } // CHECK-NEXT: catch %struct._objc_typeinfo* @"OBJC_EHTYPE_$_OCType" } }