MIR Serialization: Change MIR syntax - use custom syntax for MBBs.
[oota-llvm.git] / test / CodeGen / WinEH / seh-inlined-finally.ll
index d2080cff79d47c751874e7f8c0b14c887c5a60b3..157adf0c81830eb26a849a806ca1a22d47a475f7 100644 (file)
@@ -13,13 +13,13 @@ target triple = "x86_64-pc-windows-msvc"
 declare i32 @puts(i8*)
 declare void @may_crash()
 declare i32 @__C_specific_handler(...)
-declare i8* @llvm.framerecover(i8*, i8*, i32) #1
-declare i8* @llvm.frameaddress(i32)
-declare void @llvm.frameescape(...)
+declare i8* @llvm.localrecover(i8*, i8*, i32) #1
+declare i8* @llvm.localaddress()
+declare void @llvm.localescape(...)
 declare dllimport void @EnterCriticalSection(%struct._RTL_CRITICAL_SECTION*)
 declare dllimport void @LeaveCriticalSection(%struct._RTL_CRITICAL_SECTION*)
 
-define void @use_finally() {
+define void @use_finally() personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
 entry:
   invoke void @may_crash()
           to label %invoke.cont unwind label %lpad
@@ -29,7 +29,7 @@ invoke.cont:                                      ; preds = %entry
   ret void
 
 lpad:                                             ; preds = %entry
-  %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+  %0 = landingpad { i8*, i32 }
           cleanup
   %call.i2 = tail call i32 @puts(i8* null)
   resume { i8*, i32 } %0
@@ -44,26 +44,26 @@ lpad:                                             ; preds = %entry
 ; CHECK-NEXT: indirectbr i8* %recover, []
 
 ; Function Attrs: nounwind uwtable
-define i32 @call_may_crash_locked() {
+define i32 @call_may_crash_locked() personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
 entry:
   %p = alloca %struct._RTL_CRITICAL_SECTION, align 8
-  call void (...) @llvm.frameescape(%struct._RTL_CRITICAL_SECTION* %p)
+  call void (...) @llvm.localescape(%struct._RTL_CRITICAL_SECTION* %p)
   call void @EnterCriticalSection(%struct._RTL_CRITICAL_SECTION* %p)
   invoke void @may_crash()
           to label %invoke.cont unwind label %lpad
 
 invoke.cont:                                      ; preds = %entry
-  %tmp2 = call i8* @llvm.frameaddress(i32 0)
-  %tmp3 = call i8* @llvm.framerecover(i8* bitcast (i32 ()* @call_may_crash_locked to i8*), i8* %tmp2, i32 0) #2
+  %tmp2 = call i8* @llvm.localaddress()
+  %tmp3 = call i8* @llvm.localrecover(i8* bitcast (i32 ()* @call_may_crash_locked to i8*), i8* %tmp2, i32 0) #2
   %tmp6 = bitcast i8* %tmp3 to %struct._RTL_CRITICAL_SECTION*
   call void @LeaveCriticalSection(%struct._RTL_CRITICAL_SECTION* %tmp6)
   ret i32 42
 
 lpad:                                             ; preds = %entry
-  %tmp7 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+  %tmp7 = landingpad { i8*, i32 }
             cleanup
-  %tmp8 = call i8* @llvm.frameaddress(i32 0)
-  %tmp9 = call i8* @llvm.framerecover(i8* bitcast (i32 ()* @call_may_crash_locked to i8*), i8* %tmp8, i32 0)
+  %tmp8 = call i8* @llvm.localaddress()
+  %tmp9 = call i8* @llvm.localrecover(i8* bitcast (i32 ()* @call_may_crash_locked to i8*), i8* %tmp8, i32 0)
   %tmp12 = bitcast i8* %tmp9 to %struct._RTL_CRITICAL_SECTION*
   call void @LeaveCriticalSection(%struct._RTL_CRITICAL_SECTION* %tmp12)
   resume { i8*, i32 } %tmp7
@@ -78,6 +78,6 @@ lpad:                                             ; preds = %entry
 ; CHECK-NEXT: indirectbr i8* %recover, []
 
 ; CHECK-LABEL: define internal void @call_may_crash_locked.cleanup(i8*, i8*)
-; CHECK: %tmp9 = call i8* @llvm.framerecover(i8* bitcast (i32 ()* @call_may_crash_locked to i8*), i8* %1, i32 0)
+; CHECK: %tmp9 = call i8* @llvm.localrecover(i8* bitcast (i32 ()* @call_may_crash_locked to i8*), i8* %1, i32 0)
 ; CHECK: %tmp12 = bitcast i8* %tmp9 to %struct._RTL_CRITICAL_SECTION*
 ; CHECK: call void @LeaveCriticalSection(%struct._RTL_CRITICAL_SECTION* %tmp12)