[CodeGen][NFC] Remove redundant map lookup (#125342)
[llvm-project.git] / llvm / test / tools / llvm-reduce / issue111817-catchswitch-assert.ll
blobcf20c8607ab2f3c6c45c41657061c66887acbc25
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
9 ; CHECK-FINAL: bb:
10 ; CHECK-FINAL-NEXT: invoke void @llvm.seh.try.begin()
11 ; CHECK-FINAL-NEXT:   to label %bb7 unwind label %bb1
12 ; CHECK-FINAL: bb1:
13 ; CHECK-FINAL-NEXT: %i = catchswitch within none [label %bb2] unwind to caller
15 ; CHECK-FINAL: bb2:
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
22 ; CHECK-FINAL: bb7:
23 ; CHECK-FINAL-NEXT: ret ptr null
24 define ptr @func() personality ptr @__C_specific_handler {
25 bb:
26   invoke void @llvm.seh.try.begin()
27           to label %bb7 unwind label %bb1
29 bb1:                                              ; preds = %bb
30   %i = catchswitch within none [label %bb2] unwind to caller
32 bb2:                                              ; preds = %bb1
33   %i3 = catchpad within %i [ptr null]
34   catchret from %i3 to label %bb4
36 bb4:                                              ; preds = %bb2
37   invoke void @llvm.seh.try.end()
38           to label %bb7 unwind label %bb5
40 bb5:                                              ; preds = %bb4
41   %i6 = cleanuppad within none []
42   cleanupret from %i6 unwind to caller
44 bb7:                                              ; preds = %bb4, %bb
45   ret ptr null
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) }