1 ; RUN: llvm-reduce -abort-on-invalid-reduction --delta-passes=basic-blocks --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
2 ; RUN: FileCheck --check-prefix=CHECK-FINAL %s < %t
4 ; Make sure there's no assertion for invoke destinations that don't
5 ; use landingpad (and use catchswitch instead)
7 ; CHECK-INTERESTINGNESS: invoke
10 ; CHECK-FINAL-NEXT: invoke void @llvm.seh.try.begin()
11 ; CHECK-FINAL-NEXT: to label %bb7 unwind label %bb1
13 ; CHECK-FINAL-NEXT: %i = catchswitch within none [label %bb2] unwind to caller
16 ; CHECK-FINAL-NEXT: %i3 = catchpad within %i [ptr null]
17 ; CHECK-FINAL-NEXT: ret ptr null
19 ; CHECK-FINAL-NOT: bb4
20 ; CHECK-FINAL-NOT: bb5
23 ; CHECK-FINAL-NEXT: ret ptr null
24 define ptr @func() personality ptr @__C_specific_handler {
26 invoke void @llvm.seh.try.begin()
27 to label %bb7 unwind label %bb1
30 %i = catchswitch within none [label %bb2] unwind to caller
33 %i3 = catchpad within %i [ptr null]
34 catchret from %i3 to label %bb4
37 invoke void @llvm.seh.try.end()
38 to label %bb7 unwind label %bb5
41 %i6 = cleanuppad within none []
42 cleanupret from %i6 unwind to caller
44 bb7: ; preds = %bb4, %bb
48 declare void @llvm.seh.try.begin() #0
49 declare void @llvm.seh.try.end() #0
50 declare i32 @__C_specific_handler(...)
52 attributes #0 = { nounwind willreturn memory(write) }