Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields.
[oota-llvm.git] / test / Transforms / SimplifyCFG / invoke.ll
index ddced6b94df18f5e072d357bd38db68b95c7714e..5f513ac3e6dee7109db72d112ebeb2c03e2d0860 100644 (file)
@@ -3,12 +3,13 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
 
 declare i32 @__gxx_personality_v0(...)
 declare void @__cxa_call_unexpected(i8*)
+declare void @purefn() nounwind readnone
 declare i32 @read_only() nounwind readonly
 declare i32 @nounwind_fn() nounwind
 declare i32 @fn()
 
 
-; CHECK: @f1
+; CHECK-LABEL: @f1(
 define i8* @f1() nounwind uwtable ssp {
 entry:
 ; CHECK: call void @llvm.trap()
@@ -27,7 +28,7 @@ lpad:
   unreachable
 }
 
-; CHECK: @f2
+; CHECK-LABEL: @f2(
 define i8* @f2() nounwind uwtable ssp {
 entry:
 ; CHECK: call void @llvm.trap()
@@ -46,7 +47,7 @@ lpad:
   unreachable
 }
 
-; CHECK: @f3
+; CHECK-LABEL: @f3(
 define i32 @f3() nounwind uwtable ssp {
 ; CHECK-NEXT: entry
 entry:
@@ -65,7 +66,7 @@ lpad:
   unreachable
 }
 
-; CHECK: @f4
+; CHECK-LABEL: @f4(
 define i32 @f4() nounwind uwtable ssp {
 ; CHECK-NEXT: entry
 entry:
@@ -85,7 +86,7 @@ lpad:
   unreachable
 }
 
-; CHECK: @f5
+; CHECK-LABEL: @f5(
 define i32 @f5(i1 %cond, i8* %a, i8* %b) {
 entry:
   br i1 %cond, label %x, label %y
@@ -115,3 +116,24 @@ lpad:
   tail call void @__cxa_call_unexpected(i8* %phi2) noreturn nounwind
   unreachable
 }
+
+; CHECK-LABEL: @f6(
+define void @f6() {
+entry:
+  invoke void @purefn()
+          to label %invoke.cont1 unwind label %lpad
+
+invoke.cont1:
+  %foo = invoke i32 @fn()
+          to label %invoke.cont2 unwind label %lpad
+
+invoke.cont2:
+  ret void
+
+lpad:
+; CHECK-NOT: phi
+  %tmp = phi i8* [ null, %invoke.cont1 ], [ null, %entry ]
+  landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+          cleanup
+  ret void
+}