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 3 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 6; the invoke. 7 8define i32 @test() mustprogress personality ptr poison { 9; CHECK-LABEL: define i32 @test 10; CHECK-SAME: () #[[ATTR0:[0-9]+]] personality ptr poison { 11; CHECK-NEXT: entry: 12; CHECK-NEXT: br label [[LOOP:%.*]] 13; CHECK: loop: 14; CHECK-NEXT: invoke void @llvm.donothing() 15; CHECK-NEXT: to label [[LOOP_LATCH:%.*]] unwind label [[LPAD:%.*]] 16; CHECK: lpad: 17; CHECK-NEXT: [[LP:%.*]] = landingpad { ptr, i32 } 18; CHECK-NEXT: cleanup 19; CHECK-NEXT: resume { ptr, i32 } [[LP]] 20; CHECK: loop.latch: 21; CHECK-NEXT: br label [[LOOP]] 22; 23entry: 24 br label %loop 25 26loop: 27 invoke void @llvm.donothing() 28 to label %loop.latch unwind label %lpad 29 30lpad: 31 %lp = landingpad { ptr, i32 } 32 cleanup 33 resume { ptr, i32 } %lp 34 35loop.latch: 36 br label %loop 37} 38 39declare void @llvm.donothing() 40