summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2016-11-09 22:39:54 +0000
committerTim Northover <tnorthover@apple.com>2016-11-09 22:39:54 +0000
commita9105be437546b3f5398781006c1479c9cfecba8 (patch)
treed0ae6d020f1ddc31e952a761bf20d3824556a613 /llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll
parent58026af7f074dcf198d15d5b80452e178d962ab2 (diff)
downloadbcm5719-llvm-a9105be437546b3f5398781006c1479c9cfecba8.tar.gz
bcm5719-llvm-a9105be437546b3f5398781006c1479c9cfecba8.zip
GlobalISel: translate invoke and landingpad instructions
Pretty bare-bones support for exception handling (no weird MSVC stuff, no SjLj etc), but it should get things going. llvm-svn: 286407
Diffstat (limited to 'llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll')
-rw-r--r--llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll44
1 files changed, 44 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll b/llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll
new file mode 100644
index 00000000000..47a085e9845
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll
@@ -0,0 +1,44 @@
+; RUN: llc -O0 -mtriple=aarch64-apple-ios -global-isel -stop-after=irtranslator %s -o - | FileCheck %s
+
+@_ZTIi = external global i8*
+
+declare i32 @foo(i32)
+declare i32 @__gxx_personality_v0(...)
+declare i32 @llvm.eh.typeid.for(i8*)
+
+; CHECK: name: bar
+; CHECK: body:
+; CHECK: bb.0:
+; CHECK: successors: %bb.2{{.*}}%bb.1
+; CHECK: EH_LABEL
+; CHECK: %w0 = COPY
+; CHECK: BL @foo, csr_aarch64_aapcs, implicit-def %lr, implicit %sp, implicit %w0, implicit-def %w0
+; CHECK: {{%[0-9]+}}(s32) = COPY %w0
+; CHECK: EH_LABEL
+
+; CHECK: bb.1
+; CHECK: EH_LABEL
+; CHECK: [[PTR:%[0-9]+]](p0) = COPY %x0
+; CHECK: [[SEL:%[0-9]+]](p0) = COPY %x1
+; CHECK: [[PTR_SEL:%[0-9]+]](s128) = G_SEQUENCE [[PTR]](p0), 0, [[SEL]](p0), 64
+; CHECK: [[PTR_RET:%[0-9]+]](s64), [[SEL_RET:%[0-9]+]](s32) = G_EXTRACT [[PTR_SEL]](s128), 0, 64
+; CHECK: %x0 = COPY [[PTR_RET]]
+; CHECK: %w1 = COPY [[SEL_RET]]
+
+; CHECK: bb.2:
+; CHECK: [[SEL:%[0-9]+]](s32) = G_CONSTANT 1
+; CHECK: {{%[0-9]+}}(s128) = G_INSERT {{%[0-9]+}}(s128), [[SEL]](s32), 64
+
+define { i8*, i32 } @bar() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+ %res32 = invoke i32 @foo(i32 42) to label %continue unwind label %broken
+
+
+broken:
+ %ptr.sel = landingpad { i8*, i32 } catch i8* bitcast(i8** @_ZTIi to i8*)
+ ret { i8*, i32 } %ptr.sel
+
+continue:
+ %sel.int = tail call i32 @llvm.eh.typeid.for(i8* bitcast(i8** @_ZTIi to i8*))
+ %res.good = insertvalue { i8*, i32 } undef, i32 %sel.int, 1
+ ret { i8*, i32 } %res.good
+}
OpenPOWER on IntegriCloud