1 ; PruneEH is less powerful than simplify-cfg in terms of cfg simplification,
2 ; so it leaves some of the unreachable stuff hanging around.
3 ; Checking it with CHECK-OLD.
5 ; RUN: opt -prune-eh -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-OLD
6 ; RUN: opt -passes='function-attrs,function(simplify-cfg)' -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NEW
8 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
9 target triple = "i386-pc-windows-msvc"
11 declare void @neverthrows() nounwind
13 define void @test1() personality i32 (...)* @__CxxFrameHandler3 {
14 invoke void @neverthrows()
15 to label %try.cont unwind label %cleanuppad
21 %cp = cleanuppad within none []
25 cleanupret from %cp unwind to caller
28 ; CHECK-LABEL: define void @test1(
29 ; CHECK: call void @neverthrows()
30 ; CHECK-NEW-NEXT: ret void
34 ; CHECK-OLD: %[[cp:.*]] = cleanuppad within none []
35 ; CHECK-OLD-NEXT: unreachable
37 ; CHECK-OLD: cleanupret from %[[cp]] unwind to caller
39 define void @test2() personality i32 (...)* @__CxxFrameHandler3 {
40 invoke void @neverthrows()
41 to label %try.cont unwind label %catchswitch
47 %cs = catchswitch within none [label %catchpad] unwind to caller
50 %cp = catchpad within %cs []
57 ; CHECK-LABEL: define void @test2(
58 ; CHECK: call void @neverthrows()
59 ; CHECK-NEW-NEXT: ret void
63 ; CHECK-OLD: %[[cs:.*]] = catchswitch within none [label
65 ; CHECK-OLD: catchpad within %[[cs]] []
66 ; CHECK-OLD-NEXT: unreachable
70 declare i32 @__CxxFrameHandler3(...)