1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt -S -passes=loop-deletion < %s | FileCheck %s
4 ; Do not try to delete a loop that exits to an EH pad, as we can't directly
5 ; branch to it. We would need a different approach here that still retains
8 define i32 @test() mustprogress personality ptr poison {
9 ; CHECK-LABEL: define i32 @test
10 ; CHECK-SAME: () #[[ATTR0:[0-9]+]] personality ptr poison {
12 ; CHECK-NEXT: br label [[LOOP:%.*]]
14 ; CHECK-NEXT: invoke void @llvm.donothing()
15 ; CHECK-NEXT: to label [[LOOP_LATCH:%.*]] unwind label [[LPAD:%.*]]
17 ; CHECK-NEXT: [[LP:%.*]] = landingpad { ptr, i32 }
19 ; CHECK-NEXT: resume { ptr, i32 } [[LP]]
21 ; CHECK-NEXT: br label [[LOOP]]
27 invoke void @llvm.donothing()
28 to label %loop.latch unwind label %lpad
31 %lp = landingpad { ptr, i32 }
33 resume { ptr, i32 } %lp
39 declare void @llvm.donothing()