aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-09-04 20:39:26 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-09-04 20:39:26 +0000
commita34d395358ea8aa039566926650a12d0962ded38 (patch)
tree963ab6295c8b6f0e1334496b380c7988acdfff57 /test/CodeGen
parent67c906dce729d64861af8ca708f5e19d6a058b35 (diff)
downloadexternal_llvm-a34d395358ea8aa039566926650a12d0962ded38.zip
external_llvm-a34d395358ea8aa039566926650a12d0962ded38.tar.gz
external_llvm-a34d395358ea8aa039566926650a12d0962ded38.tar.bz2
Fix for PR1632. EHSELECTION always produces a i32 value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41712 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/X86/2007-09-03-X86-64-EhSelector.ll38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/CodeGen/X86/2007-09-03-X86-64-EhSelector.ll b/test/CodeGen/X86/2007-09-03-X86-64-EhSelector.ll
new file mode 100644
index 0000000..c3ba839
--- /dev/null
+++ b/test/CodeGen/X86/2007-09-03-X86-64-EhSelector.ll
@@ -0,0 +1,38 @@
+; RUN: llvm-as < %s | llc -march=x86-64 -enable-eh
+; PR1632
+
+define void @_Z1fv() {
+entry:
+ invoke void @_Z1gv( )
+ to label %return unwind label %unwind
+
+unwind: ; preds = %entry
+ br i1 false, label %eh_then, label %cleanup20
+
+eh_then: ; preds = %unwind
+ invoke void @__cxa_end_catch( )
+ to label %return unwind label %unwind10
+
+unwind10: ; preds = %eh_then
+ %eh_select13 = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector( i8* null, i8* bitcast (void ()* @__gxx_personality_v0 to i8*), i32 1 ) ; <i32> [#uses=2]
+ %tmp18 = icmp slt i32 %eh_select13, 0 ; <i1> [#uses=1]
+ br i1 %tmp18, label %filter, label %cleanup20
+
+filter: ; preds = %unwind10
+ unreachable
+
+cleanup20: ; preds = %unwind10, %unwind
+ %eh_selector.0 = phi i32 [ 0, %unwind ], [ %eh_select13, %unwind10 ] ; <i32> [#uses=0]
+ ret void
+
+return: ; preds = %eh_then, %entry
+ ret void
+}
+
+declare void @_Z1gv()
+
+declare i32 @llvm.eh.selector(i8*, i8*, ...)
+
+declare void @__gxx_personality_v0()
+
+declare void @__cxa_end_catch()