[CodeGen] Don't emit a random reference to the personality function
[oota-llvm.git] / test / CodeGen / WinEH / cppeh-prepared-cleanups.ll
index b95858921351eb8cbb13ce1daa541063b8ddf59f..14973023356a9eea64767e75eb7db6ef6e40944d 100644 (file)
@@ -36,7 +36,7 @@ $_TI1H = comdat any
 ; CHECK-NEXT:        .long   ("$stateUnwindMap$?test1@@YAXXZ")@IMGREL
 ; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   1
+; CHECK-NEXT:        .long   2
 ; CHECK-NEXT:        .long   ("$ip2state$?test1@@YAXXZ")@IMGREL
 ; CHECK-NEXT:        .long   32
 ; CHECK-NEXT:        .long   0
@@ -45,10 +45,12 @@ $_TI1H = comdat any
 ; CHECK-NEXT:        .long   -1
 ; CHECK-NEXT:        .long   "?test1@@YAXXZ.cleanup"@IMGREL
 ; CHECK-NEXT:"$ip2state$?test1@@YAXXZ":
+; CHECK-NEXT:        .long   .Lfunc_begin0@IMGREL
+; CHECK-NEXT:        .long   -1
 ; CHECK-NEXT:        .long   .Ltmp0@IMGREL
 ; CHECK-NEXT:        .long   0
 
-define void @"\01?test1@@YAXXZ"() #0 {
+define void @"\01?test1@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
 entry:
   %unwindhelp = alloca i64
   %tmp = alloca i32, align 4
@@ -64,7 +66,7 @@ entry:
           to label %unreachable unwind label %lpad1
 
 lpad1:                                            ; preds = %entry
-  %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+  %2 = landingpad { i8*, i32 }
           cleanup
   %recover = call i8* (...) @llvm.eh.actions(i32 0, void (i8*, i8*)* @"\01?test1@@YAXXZ.cleanup")
   indirectbr i8* %recover, []
@@ -116,7 +118,7 @@ entry:
 ; CHECK-NEXT:        .long   .Ltmp12@IMGREL
 ; CHECK-NEXT:        .long   0
 
-define void @"\01?test2@@YAX_N@Z"(i1 zeroext %b) #2 {
+define void @"\01?test2@@YAX_N@Z"(i1 zeroext %b) #2 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
   %b.addr = alloca i8, align 1
   %s = alloca %struct.S, align 1
   %exn.slot = alloca i8*
@@ -143,13 +145,13 @@ invoke.cont3:                                     ; preds = %if.then
   br label %if.end
 
 lpad1:                                            ; preds = %entry, %if.end
-  %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+  %2 = landingpad { i8*, i32 }
           cleanup
   %recover = call i8* (...) @llvm.eh.actions(i32 0, void (i8*, i8*)* @"\01?test2@@YAX_N@Z.cleanup")
   indirectbr i8* %recover, []
 
 lpad3:                                            ; preds = %if.then
-  %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+  %3 = landingpad { i8*, i32 }
           cleanup
   %recover4 = call i8* (...) @llvm.eh.actions(i32 0, void (i8*, i8*)* @"\01?test2@@YAX_N@Z.cleanup1", i32 0, void (i8*, i8*)* @"\01?test2@@YAX_N@Z.cleanup")
   indirectbr i8* %recover4, []
@@ -194,7 +196,7 @@ declare i8* @llvm.framerecover(i8*, i8*, i32) #6
 ; Function Attrs: nounwind
 declare void @llvm.eh.unwindhelp(i8*) #4
 
-define internal void @"\01?test2@@YAX_N@Z.cleanup"(i8*, i8*) #7 {
+define internal void @"\01?test2@@YAX_N@Z.cleanup"(i8*, i8*) #7 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
 entry:
   %s.i8 = call i8* @llvm.framerecover(i8* bitcast (void (i1)* @"\01?test2@@YAX_N@Z" to i8*), i8* %1, i32 0)
   %s = bitcast i8* %s.i8 to %struct.S*
@@ -206,12 +208,12 @@ entry.split:                                      ; preds = %entry
   ret void
 
 stub:                                             ; preds = %entry
-  %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+  %2 = landingpad { i8*, i32 }
           cleanup
   unreachable
 }
 
-define internal void @"\01?test2@@YAX_N@Z.cleanup1"(i8*, i8*) #7 {
+define internal void @"\01?test2@@YAX_N@Z.cleanup1"(i8*, i8*) #7 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
 entry:
   %s1.i8 = call i8* @llvm.framerecover(i8* bitcast (void (i1)* @"\01?test2@@YAX_N@Z" to i8*), i8* %1, i32 1)
   %s1 = bitcast i8* %s1.i8 to %struct.S*
@@ -223,7 +225,7 @@ entry.split:                                      ; preds = %entry
   ret void
 
 stub:                                             ; preds = %entry
-  %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+  %2 = landingpad { i8*, i32 }
           cleanup
   unreachable
 }