From af960a772df8e51459733e07f2503da519fe2d1a Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 11 Apr 2023 16:30:09 +0200 Subject: [PATCH] [FunctionAttrs] Add cleanuppad test (NFC) --- llvm/test/Transforms/FunctionAttrs/nounwind.ll | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/llvm/test/Transforms/FunctionAttrs/nounwind.ll b/llvm/test/Transforms/FunctionAttrs/nounwind.ll index 4d52e61..c8d0a87 100644 --- a/llvm/test/Transforms/FunctionAttrs/nounwind.ll +++ b/llvm/test/Transforms/FunctionAttrs/nounwind.ll @@ -264,6 +264,31 @@ unreachable: unreachable } +define void @cleanuppad() personality ptr @__gxx_personality_v0 { +; CHECK: Function Attrs: noreturn nounwind +; CHECK-LABEL: define {{[^@]+}}@cleanuppad +; CHECK-SAME: () #[[ATTR3]] personality ptr @__gxx_personality_v0 { +; CHECK-NEXT: invoke void @do_throw() +; CHECK-NEXT: to label [[UNREACHABLE:%.*]] unwind label [[CPAD:%.*]] +; CHECK: cpad: +; CHECK-NEXT: [[CP:%.*]] = cleanuppad within none [] +; CHECK-NEXT: call void @abort() +; CHECK-NEXT: unreachable +; CHECK: unreachable: +; CHECK-NEXT: unreachable +; + invoke void @do_throw() + to label %unreachable unwind label %cpad + +cpad: + %cp = cleanuppad within none [] + call void @abort() + unreachable + +unreachable: + unreachable +} + declare i32 @__gxx_personality_v0(...) declare ptr @__cxa_begin_catch(ptr) -- 2.7.4