diff options
author | Robert Widmann <devteam.codafi@gmail.com> | 2018-03-30 17:49:53 +0000 |
---|---|---|
committer | Robert Widmann <devteam.codafi@gmail.com> | 2018-03-30 17:49:53 +0000 |
commit | 478fce9ebfa809e0f75741bbcf1de1a7a379f5c4 (patch) | |
tree | 400a138835389691a03eb7368aa1847d322daf09 /llvm/test/Bindings/llvm-c | |
parent | 5f8c3e85aae8f0a34c69053e746af439622bf96e (diff) | |
download | bcm5719-llvm-478fce9ebfa809e0f75741bbcf1de1a7a379f5c4.tar.gz bcm5719-llvm-478fce9ebfa809e0f75741bbcf1de1a7a379f5c4.zip |
[LLVM-C] Finish exception instruction bindings - Round 2
Summary:
Previous revision caused a leak in the echo test that got caught by the ASAN bots because of missing free of the handlers array and was reverted in r328759. Resubmitting the patch with that correction.
Add support for cleanupret, catchret, catchpad, cleanuppad and catchswitch and their associated accessors.
Test is modified from SimplifyCFG because it contains many diverse usages of these instructions.
Reviewers: whitequark, deadalnix
Reviewed By: whitequark
Subscribers: llvm-commits, vlad.tsyrklevich
Differential Revision: https://reviews.llvm.org/D45100
llvm-svn: 328883
Diffstat (limited to 'llvm/test/Bindings/llvm-c')
-rw-r--r-- | llvm/test/Bindings/llvm-c/echo.ll | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/llvm/test/Bindings/llvm-c/echo.ll b/llvm/test/Bindings/llvm-c/echo.ll index dbe2eed910b..8c9cd7bd723 100644 --- a/llvm/test/Bindings/llvm-c/echo.ll +++ b/llvm/test/Bindings/llvm-c/echo.ll @@ -122,3 +122,38 @@ do: done: ret i32 %p } + +declare void @personalityFn() + +define void @exn() personality void ()* @personalityFn { +entry: + invoke void @decl() + to label %via.cleanup unwind label %exn.dispatch +via.cleanup: + invoke void @decl() + to label %via.catchswitch unwind label %cleanup.inner +cleanup.inner: + %cp.inner = cleanuppad within none [] + cleanupret from %cp.inner unwind label %exn.dispatch +via.catchswitch: + invoke void @decl() + to label %exit unwind label %dispatch.inner +dispatch.inner: + %cs.inner = catchswitch within none [label %pad.inner] unwind label %exn.dispatch +pad.inner: + %catch.inner = catchpad within %cs.inner [i32 0] + catchret from %catch.inner to label %exit +exn.dispatch: + %cs = catchswitch within none [label %pad1, label %pad2] unwind label %cleanup +pad1: + catchpad within %cs [i32 1] + unreachable +pad2: + catchpad within %cs [i32 2] + unreachable +cleanup: + %cp = cleanuppad within none [] + cleanupret from %cp unwind to caller +exit: + ret void +} |