summaryrefslogtreecommitdiff
path: root/test/Transforms/InstSimplify
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2011-09-05 06:52:48 +0000
committerDuncan Sands <baldrick@free.fr>2011-09-05 06:52:48 +0000
commitdabc2806726a286b00313419fac8461ebe0f774c (patch)
treeb0e316861d47fb91235ebff6b1aeb19bf4729f40 /test/Transforms/InstSimplify
parent26eb870d7e0e28ecb25a0cd77e6cdc0490707eff (diff)
downloadllvm-dabc2806726a286b00313419fac8461ebe0f774c.tar.gz
llvm-dabc2806726a286b00313419fac8461ebe0f774c.tar.bz2
llvm-dabc2806726a286b00313419fac8461ebe0f774c.tar.xz
Add some simple insertvalue simplifications, for the purpose of cleaning
up do-nothing exception handling code produced by dragonegg. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139113 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstSimplify')
-rw-r--r--test/Transforms/InstSimplify/2011-09-05-InsertExtractValue.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Transforms/InstSimplify/2011-09-05-InsertExtractValue.ll b/test/Transforms/InstSimplify/2011-09-05-InsertExtractValue.ll
new file mode 100644
index 0000000000..4067d5dc76
--- /dev/null
+++ b/test/Transforms/InstSimplify/2011-09-05-InsertExtractValue.ll
@@ -0,0 +1,22 @@
+; RUN: opt < %s -instsimplify -S | FileCheck %s
+
+; CHECK-NOT: extractvalue
+; CHECK-NOT: insertvalue
+
+declare void @bar()
+
+define void @foo() {
+entry:
+ invoke void @bar() to label %cont unwind label %lpad
+cont:
+ ret void
+lpad:
+ %ex = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0 cleanup
+ %exc_ptr = extractvalue { i8*, i32 } %ex, 0
+ %filter = extractvalue { i8*, i32 } %ex, 1
+ %exc_ptr2 = insertvalue { i8*, i32 } undef, i8* %exc_ptr, 0
+ %filter2 = insertvalue { i8*, i32 } %exc_ptr2, i32 %filter, 1
+ resume { i8*, i32 } %filter2
+}
+
+declare i32 @__gxx_personality_v0(i32, i64, i8*, i8*)