; This is just a minimal check to verify that main was handled by WinEHPrepare.
; CHECK: define i32 @main()
; CHECK: entry:
-; CHECK: call void (...) @llvm.frameescape(i8* [[C_PTR:\%.+]], i32* [[X_PTR:\%.+]], i8* [[C2_PTR:\%.+]], i32* [[X2_PTR:\%.+]], i8* [[C3_PTR:\%.+]])
+; CHECK: call void (...) @llvm.localescape(i32* [[X_PTR:\%.+]], i32* [[X2_PTR:\%.+]], i8* [[C2_PTR:\%.+]], i8* [[C3_PTR:\%.+]], i8* [[C_PTR:\%.+]])
; CHECK: invoke void @_CxxThrowException
; CHECK: }
; Function Attrs: uwtable
-define i32 @main() #0 {
+define i32 @main() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%retval = alloca i32, align 4
%tmp = alloca i8, align 1
to label %unreachable unwind label %lpad
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %0 = landingpad { i8*, i32 }
catch %eh.CatchHandlerType* @llvm.eh.handlertype.D.0
catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
catch i8* null
call void @llvm.eh.begincatch(i8* %exn, i8* %c) #2
%4 = load i8, i8* %c, align 1
%conv = sext i8 %4 to i32
- %call = invoke i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"\01??_C@_03PJCJOCBM@?$CFc?6?$AA@", i32 0, i32 0), i32 %conv)
+ %call = invoke i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"\01??_C@_03PJCJOCBM@?$CFc?6?$AA@", i32 0, i32 0), i32 %conv)
to label %invoke.cont unwind label %lpad2
invoke.cont: ; preds = %catch
to label %unreachable unwind label %lpad4
lpad2: ; preds = %catch
- %6 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %6 = landingpad { i8*, i32 }
catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
catch i8* null
%7 = extractvalue { i8*, i32 } %6, 0
br label %catch.dispatch5
lpad4: ; preds = %try.cont
- %9 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %9 = landingpad { i8*, i32 }
catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
catch i8* null
%10 = extractvalue { i8*, i32 } %9, 0
%13 = bitcast i32* %x to i8*
call void @llvm.eh.begincatch(i8* %exn14, i8* %13) #2
%14 = load i32, i32* %x, align 4
- %call18 = invoke i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"\01??_C@_03PMGGPEJJ@?$CFd?6?$AA@", i32 0, i32 0), i32 %14)
+ %call18 = invoke i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"\01??_C@_03PMGGPEJJ@?$CFd?6?$AA@", i32 0, i32 0), i32 %14)
to label %invoke.cont17 unwind label %lpad16
invoke.cont17: ; preds = %catch13
catch8: ; preds = %catch.dispatch5
%exn9 = load i8*, i8** %exn.slot
call void @llvm.eh.begincatch(i8* %exn9, i8* null) #2
- %call12 = invoke i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @"\01??_C@_04MPPNMCOK@?4?4?4?6?$AA@", i32 0, i32 0))
+ %call12 = invoke i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @"\01??_C@_04MPPNMCOK@?4?4?4?6?$AA@", i32 0, i32 0))
to label %invoke.cont11 unwind label %lpad10
invoke.cont11: ; preds = %catch8
br label %try.cont19
lpad10: ; preds = %catch8
- %15 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %15 = landingpad { i8*, i32 }
cleanup
%16 = extractvalue { i8*, i32 } %15, 0
store i8* %16, i8** %exn.slot
br label %eh.resume
lpad16: ; preds = %catch13
- %18 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %18 = landingpad { i8*, i32 }
cleanup
%19 = extractvalue { i8*, i32 } %18, 0
store i8* %19, i8** %exn.slot
br label %eh.resume
lpad21: ; preds = %try.cont19
- %21 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %21 = landingpad { i8*, i32 }
catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.D.0 to i8*)
catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*)
catch i8* null
call void @llvm.eh.begincatch(i8* %exn26, i8* %c28) #2
%25 = load i8, i8* %c28, align 1
%conv29 = sext i8 %25 to i32
- %call32 = invoke i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"\01??_C@_03PJCJOCBM@?$CFc?6?$AA@", i32 0, i32 0), i32 %conv29)
+ %call32 = invoke i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"\01??_C@_03PJCJOCBM@?$CFc?6?$AA@", i32 0, i32 0), i32 %conv29)
to label %invoke.cont31 unwind label %lpad30
invoke.cont31: ; preds = %catch25
to label %unreachable unwind label %lpad35
lpad30: ; preds = %catch25
- %27 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %27 = landingpad { i8*, i32 }
catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*)
catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.D.0 to i8*)
catch i8* null
br label %catch.dispatch36
lpad35: ; preds = %try.cont33
- %30 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %30 = landingpad { i8*, i32 }
catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*)
catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.D.0 to i8*)
catch i8* null
%34 = bitcast i32* %x56 to i8*
call void @llvm.eh.begincatch(i8* %exn54, i8* %34) #2
%35 = load i32, i32* %x56, align 4
- %call59 = invoke i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"\01??_C@_03PMGGPEJJ@?$CFd?6?$AA@", i32 0, i32 0), i32 %35)
+ %call59 = invoke i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"\01??_C@_03PMGGPEJJ@?$CFd?6?$AA@", i32 0, i32 0), i32 %35)
to label %invoke.cont58 unwind label %lpad57
invoke.cont58: ; preds = %catch53
call void @llvm.eh.begincatch(i8* %exn46, i8* %c48) #2
%37 = load i8, i8* %c48, align 1
%conv49 = sext i8 %37 to i32
- %call52 = invoke i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"\01??_C@_03PJCJOCBM@?$CFc?6?$AA@", i32 0, i32 0), i32 %conv49)
+ %call52 = invoke i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"\01??_C@_03PJCJOCBM@?$CFc?6?$AA@", i32 0, i32 0), i32 %conv49)
to label %invoke.cont51 unwind label %lpad50
invoke.cont51: ; preds = %catch45
catch40: ; preds = %catch.fallthrough
%exn41 = load i8*, i8** %exn.slot
call void @llvm.eh.begincatch(i8* %exn41, i8* null) #2
- %call44 = invoke i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @"\01??_C@_04MPPNMCOK@?4?4?4?6?$AA@", i32 0, i32 0))
+ %call44 = invoke i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @"\01??_C@_04MPPNMCOK@?4?4?4?6?$AA@", i32 0, i32 0))
to label %invoke.cont43 unwind label %lpad42
invoke.cont43: ; preds = %catch40
br label %try.cont60
lpad42: ; preds = %catch40
- %38 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %38 = landingpad { i8*, i32 }
cleanup
%39 = extractvalue { i8*, i32 } %38, 0
store i8* %39, i8** %exn.slot
br label %eh.resume
lpad50: ; preds = %catch45
- %41 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %41 = landingpad { i8*, i32 }
cleanup
%42 = extractvalue { i8*, i32 } %41, 0
store i8* %42, i8** %exn.slot
br label %eh.resume
lpad57: ; preds = %catch53
- %44 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %44 = landingpad { i8*, i32 }
cleanup
%45 = extractvalue { i8*, i32 } %44, 0
store i8* %45, i8** %exn.slot