From 65088e7d96c20f5068a0c0c6bf9223a82011709f Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Thu, 1 Sep 2011 01:08:21 +0000 Subject: [PATCH] Update to new EH scheme. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138928 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/Inline/2003-09-14-InlineValue.ll | 4 ++++ .../Inline/2003-09-22-PHINodesInExceptionDest.ll | 9 ++++++++- .../Inline/2003-10-26-InlineInvokeExceptionDestPhi.ll | 3 +++ test/Transforms/Inline/2007-04-15-InlineEH.ll | 6 +++++- test/Transforms/Inline/callgraph-update.ll | 3 +++ test/Transforms/Inline/crash.ll | 10 +++++++++- test/Transforms/Inline/invoke_test-1.ll | 4 ++++ test/Transforms/Inline/invoke_test-2.ll | 6 ++++++ test/Transforms/Inline/invoke_test-3.ll | 8 +++++++- 9 files changed, 49 insertions(+), 4 deletions(-) diff --git a/test/Transforms/Inline/2003-09-14-InlineValue.ll b/test/Transforms/Inline/2003-09-14-InlineValue.ll index 49a27e195e2..98bc08b378e 100644 --- a/test/Transforms/Inline/2003-09-14-InlineValue.ll +++ b/test/Transforms/Inline/2003-09-14-InlineValue.ll @@ -16,6 +16,10 @@ Ok: ; preds = %0 ret i32 %V Bad: ; preds = %0 + %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup ret i32 0 } +declare i32 @__gxx_personality_v0(...) + diff --git a/test/Transforms/Inline/2003-09-22-PHINodesInExceptionDest.ll b/test/Transforms/Inline/2003-09-22-PHINodesInExceptionDest.ll index 4418f77c9d0..9af93325f14 100644 --- a/test/Transforms/Inline/2003-09-22-PHINodesInExceptionDest.ll +++ b/test/Transforms/Inline/2003-09-22-PHINodesInExceptionDest.ll @@ -6,10 +6,15 @@ entry: to label %Call2Invoke unwind label %LongJmpBlkPre Call2Invoke: ; preds = %entry - br label %LongJmpBlkPre + br label %exit LongJmpBlkPre: ; preds = %Call2Invoke, %entry %i.3 = phi i32 [ 0, %entry ], [ 0, %Call2Invoke ] ; [#uses=0] + %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup + br label %exit + +exit: ret i32 0 } @@ -19,6 +24,8 @@ define void @__main() { ret void } +declare i32 @__gxx_personality_v0(...) + declare void @__llvm_getGlobalCtors() declare void @__llvm_getGlobalDtors() diff --git a/test/Transforms/Inline/2003-10-26-InlineInvokeExceptionDestPhi.ll b/test/Transforms/Inline/2003-10-26-InlineInvokeExceptionDestPhi.ll index 9afd45040ca..bfe04559bca 100644 --- a/test/Transforms/Inline/2003-10-26-InlineInvokeExceptionDestPhi.ll +++ b/test/Transforms/Inline/2003-10-26-InlineInvokeExceptionDestPhi.ll @@ -15,6 +15,9 @@ BB1: Cont: ; preds = %BB1, %BB1 %A = phi i32 [ 0, %BB1 ], [ 0, %BB1 ] ; [#uses=1] + %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup ret i32 %A } +declare i32 @__gxx_personality_v0(...) diff --git a/test/Transforms/Inline/2007-04-15-InlineEH.ll b/test/Transforms/Inline/2007-04-15-InlineEH.ll index 635f93e8242..8fbcf929d02 100644 --- a/test/Transforms/Inline/2007-04-15-InlineEH.ll +++ b/test/Transforms/Inline/2007-04-15-InlineEH.ll @@ -33,9 +33,13 @@ invcont67: ; preds = %invcont65 ret void cleanup144: ; preds = %invcont65, %invcont64, %invcont, %entry - unwind + %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup + resume { i8*, i32 } %exn } +declare i32 @__gxx_personality_v0(...) + declare void @gnat__os_lib__getenv(%struct.gnat__strings__string_access*) declare void @ada__calendar__delays__delay_for() diff --git a/test/Transforms/Inline/callgraph-update.ll b/test/Transforms/Inline/callgraph-update.ll index ff0120b7330..b96fbc39c2f 100644 --- a/test/Transforms/Inline/callgraph-update.ll +++ b/test/Transforms/Inline/callgraph-update.ll @@ -29,5 +29,8 @@ invcont: unreachable lpad: + %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup unreachable } +declare i32 @__gxx_personality_v0(...) diff --git a/test/Transforms/Inline/crash.ll b/test/Transforms/Inline/crash.ll index 1df4d6063e8..e2cd49c2516 100644 --- a/test/Transforms/Inline/crash.ll +++ b/test/Transforms/Inline/crash.ll @@ -69,9 +69,13 @@ invcont98: unreachable lpad156: + %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup unreachable } +declare i32 @__gxx_personality_v0(...) + declare fastcc void @YYY() define internal fastcc void @XXX() { @@ -84,7 +88,9 @@ bb260: ret void lpad: - unwind + %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup + resume { i8*, i32 } %exn } @@ -105,6 +111,8 @@ invcont3: ; preds = %bb1 ret void lpad18: ; preds = %invcont3, %bb1 + %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup unreachable } diff --git a/test/Transforms/Inline/invoke_test-1.ll b/test/Transforms/Inline/invoke_test-1.ll index 0d27e2a7f5e..e0e6d600bbb 100644 --- a/test/Transforms/Inline/invoke_test-1.ll +++ b/test/Transforms/Inline/invoke_test-1.ll @@ -20,5 +20,9 @@ cont: ; preds = %0 ret i32 0 exc: ; preds = %0 + %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup ret i32 1 } + +declare i32 @__gxx_personality_v0(...) diff --git a/test/Transforms/Inline/invoke_test-2.ll b/test/Transforms/Inline/invoke_test-2.ll index bbb9ab05539..680a5ca2542 100644 --- a/test/Transforms/Inline/invoke_test-2.ll +++ b/test/Transforms/Inline/invoke_test-2.ll @@ -14,6 +14,8 @@ cont: ; preds = %0 ret i32 0 exc: ; preds = %0 + %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup ret i32 1 } @@ -26,5 +28,9 @@ cont: ; preds = %0 ret i32 %X UnreachableExceptionHandler: ; preds = %0 + %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup ret i32 -1 } + +declare i32 @__gxx_personality_v0(...) diff --git a/test/Transforms/Inline/invoke_test-3.ll b/test/Transforms/Inline/invoke_test-3.ll index b360526fb34..f5ce95aa516 100644 --- a/test/Transforms/Inline/invoke_test-3.ll +++ b/test/Transforms/Inline/invoke_test-3.ll @@ -14,7 +14,9 @@ cont: ; preds = %0 exc: ; preds = %0a ; This just rethrows the exception! - unwind + %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup + resume { i8*, i32 } %exn } ; caller returns true if might_throw throws an exception... which gets @@ -28,5 +30,9 @@ cont: ; preds = %0 Handler: ; preds = %0 ; This consumes an exception thrown by might_throw + %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup ret i32 1 } + +declare i32 @__gxx_personality_v0(...) -- 2.34.1