diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-09-17 20:45:18 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-09-17 20:45:18 +0000 |
commit | 978902309a25254ce97bc142348df28ecb210655 (patch) | |
tree | 5ee51f1c98412374a46f055dd738156887a9622c /llvm/test/CodeGen/X86/funclet-layout.ll | |
parent | 5b8a46e771254fab0a50577ad47f0777d3777646 (diff) | |
download | bcm5719-llvm-978902309a25254ce97bc142348df28ecb210655.tar.gz bcm5719-llvm-978902309a25254ce97bc142348df28ecb210655.zip |
[WinEH] Add a funclet layout pass
Windows EH funclets need to be contiguous. The FuncletLayout pass will
ensure that the funclets are together and begin with a funclet entry MBB.
Differential Revision: http://reviews.llvm.org/D12943
llvm-svn: 247937
Diffstat (limited to 'llvm/test/CodeGen/X86/funclet-layout.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/funclet-layout.ll | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/funclet-layout.ll b/llvm/test/CodeGen/X86/funclet-layout.ll new file mode 100644 index 00000000000..9e6fbb6fbb5 --- /dev/null +++ b/llvm/test/CodeGen/X86/funclet-layout.ll @@ -0,0 +1,45 @@ +; RUN: llc -mtriple=x86_64-windows-msvc < %s | FileCheck %s + +target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-pc-windows-msvc" + +define void @f(i1 %B) personality i32 (...)* @__CxxFrameHandler3 { +entry: + invoke void @g() + to label %unreachable unwind label %catch.dispatch + +catch.dispatch: + %cp = catchpad [i8* null, i32 64, i8* null] + to label %catch unwind label %catchendblock + +catch: + br i1 %B, label %catchret, label %catch + +catchret: + catchret %cp to label %try.cont + +try.cont: + ret void + +catchendblock: + catchendpad unwind to caller + +unreachable: + unreachable +} + +; CHECK-LABEL: f: + +; The entry funclet contains %entry and %try.cont +; CHECK: # %entry +; CHECK: # %try.cont +; CHECK: retq + +; The catch funclet contains %catch and %catchret +; CHECK: # %catch +; CHECK: # %catchret +; CHECK: retq + +declare void @g() + +declare i32 @__CxxFrameHandler3(...) |