[WinEH] Add llvm.eh.exceptionpointer intrinsic
[oota-llvm.git] / test / CodeGen / WinEH / cppeh-state-calc-1.ll
index 87df6182aa87bf5955feecc426d19ecada6f1455..abc5d5292cf7966ca562910930cb3305c234fd51 100644 (file)
@@ -68,7 +68,7 @@ $_TI1D = comdat any
 @_TI1D = linkonce_odr unnamed_addr constant %eh.ThrowInfo { i32 0, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%eh.CatchableTypeArray.1* @_CTA1D to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, section ".xdata", comdat
 
 ; Function Attrs: nounwind uwtable
-define void @"\01?test@@YAXXZ"() #0 {
+define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
 entry:
   %tmp = alloca i32, align 4
   %x = alloca i32, align 4
@@ -79,12 +79,12 @@ entry:
   call void @"\01?two@@YAXXZ"() #3
   store i32 2, i32* %tmp
   %0 = bitcast i32* %tmp to i8*
-  call void (...) @llvm.frameescape(i32* %x, i8* %c, i32* %x21)
+  call void (...) @llvm.localescape(i32* %x, i8* %c, i32* %x21)
   invoke void @_CxxThrowException(i8* %0, %eh.ThrowInfo* @_TI1H) #5
           to label %unreachable unwind label %lpad
 
 lpad:                                             ; preds = %entry
-  %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+  %1 = landingpad { i8*, i32 }
           catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*)
           catch %eh.CatchHandlerType* @llvm.eh.handlertype.D.0
           catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
@@ -99,7 +99,7 @@ try.cont:                                         ; preds = %lpad
           to label %unreachable unwind label %lpad3
 
 lpad3:                                            ; preds = %try.cont
-  %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+  %2 = landingpad { i8*, i32 }
           catch %eh.CatchHandlerType* @llvm.eh.handlertype.D.0
           catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
           catch i8* null
@@ -114,7 +114,7 @@ try.cont10:                                       ; preds = %lpad3, %lpad
           to label %unreachable unwind label %lpad12
 
 lpad12:                                           ; preds = %try.cont10
-  %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+  %4 = landingpad { i8*, i32 }
           catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
           catch i8* null
   %recover2 = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*), i32 2, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch2", i32 1, i8* null, i32 -1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch3")
@@ -164,9 +164,9 @@ declare void @"\01?catch_one@@YAXXZ"() #1
 ; Function Attrs: nounwind
 declare i8* @llvm.eh.actions(...) #3
 
-define internal i8* @"\01?test@@YAXXZ.catch"(i8*, i8*) #4 {
+define internal i8* @"\01?test@@YAXXZ.catch"(i8*, i8*) #4 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
 entry:
-  %x.i8 = call i8* @llvm.framerecover(i8* bitcast (void ()* @"\01?test@@YAXXZ" to i8*), i8* %1, i32 0)
+  %x.i8 = call i8* @llvm.localrecover(i8* bitcast (void ()* @"\01?test@@YAXXZ" to i8*), i8* %1, i32 0)
   %x = bitcast i8* %x.i8 to i32*
   %2 = bitcast i32* %x to i8*
   call void @"\01?catch_two@@YAXXZ"() #3
@@ -177,7 +177,7 @@ entry.split:                                      ; preds = %entry
   ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont)
 
 stub:                                             ; preds = %entry
-  %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+  %3 = landingpad { i8*, i32 }
           cleanup
   %recover = call i8* (...) @llvm.eh.actions()
   unreachable
@@ -186,7 +186,7 @@ stub:                                             ; preds = %entry
 ; Function Attrs: nounwind readnone
 declare void @llvm.donothing() #2
 
-define internal i8* @"\01?test@@YAXXZ.catch1"(i8*, i8*) #4 {
+define internal i8* @"\01?test@@YAXXZ.catch1"(i8*, i8*) #4 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
 entry:
   call void @"\01?catch_a@@YAXXZ"() #3
   invoke void @llvm.donothing()
@@ -196,15 +196,15 @@ entry.split:                                      ; preds = %entry
   ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont10)
 
 stub:                                             ; preds = %entry
-  %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+  %2 = landingpad { i8*, i32 }
           cleanup
   %recover = call i8* (...) @llvm.eh.actions()
   unreachable
 }
 
-define internal i8* @"\01?test@@YAXXZ.catch2"(i8*, i8*) #4 {
+define internal i8* @"\01?test@@YAXXZ.catch2"(i8*, i8*) #4 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
 entry:
-  %x21.i8 = call i8* @llvm.framerecover(i8* bitcast (void ()* @"\01?test@@YAXXZ" to i8*), i8* %1, i32 2)
+  %x21.i8 = call i8* @llvm.localrecover(i8* bitcast (void ()* @"\01?test@@YAXXZ" to i8*), i8* %1, i32 2)
   %x21 = bitcast i8* %x21.i8 to i32*
   %2 = bitcast i32* %x21 to i8*
   call void @"\01?catch_one@@YAXXZ"() #3
@@ -215,13 +215,13 @@ entry.split:                                      ; preds = %entry
   ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont22)
 
 stub:                                             ; preds = %entry
-  %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+  %3 = landingpad { i8*, i32 }
           cleanup
   %recover = call i8* (...) @llvm.eh.actions()
   unreachable
 }
 
-define internal i8* @"\01?test@@YAXXZ.catch3"(i8*, i8*) #4 {
+define internal i8* @"\01?test@@YAXXZ.catch3"(i8*, i8*) #4 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
 entry:
   call void @"\01?catch_all@@YAXXZ"() #3
   invoke void @llvm.donothing()
@@ -231,17 +231,17 @@ entry.split:                                      ; preds = %entry
   ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont22)
 
 stub:                                             ; preds = %entry
-  %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+  %2 = landingpad { i8*, i32 }
           cleanup
   %recover = call i8* (...) @llvm.eh.actions()
   unreachable
 }
 
 ; Function Attrs: nounwind
-declare void @llvm.frameescape(...) #3
+declare void @llvm.localescape(...) #3
 
 ; Function Attrs: nounwind readnone
-declare i8* @llvm.framerecover(i8*, i8*, i32) #2
+declare i8* @llvm.localrecover(i8*, i8*, i32) #2
 
 attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" "wineh-parent"="\ 1?test@@YAXXZ" }
 attributes #1 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
@@ -274,16 +274,16 @@ attributes #5 = { noreturn }
 ; CHECK-NEXT:  .long   .Lfunc_begin0@IMGREL
 ; CHECK-NEXT:  .long   -1
 ; CHECK-NEXT:  .long   .Ltmp0@IMGREL
-; CHECK-NEXT:  .long   3
-; CHECK-NEXT:  .long   .Ltmp3@IMGREL
 ; CHECK-NEXT:  .long   2
-; CHECK-NEXT:  .long   .Ltmp6@IMGREL
+; CHECK-NEXT:  .long   .Ltmp3@IMGREL
 ; CHECK-NEXT:  .long   1
+; CHECK-NEXT:  .long   .Ltmp6@IMGREL
+; CHECK-NEXT:  .long   0
 ; CHECK-NEXT:  .long   .Lfunc_begin1@IMGREL
-; CHECK-NEXT:  .long   4
+; CHECK-NEXT:  .long   3
 ; CHECK-NEXT:  .long   .Lfunc_begin2@IMGREL
-; CHECK-NEXT:  .long   5
+; CHECK-NEXT:  .long   4
 ; CHECK-NEXT:  .long   .Lfunc_begin3@IMGREL
-; CHECK-NEXT:  .long   6
+; CHECK-NEXT:  .long   5
 ; CHECK-NEXT:  .long   .Lfunc_begin4@IMGREL
-; CHECK-NEXT:  .long   7
+; CHECK-NEXT:  .long   6