1; RUN: opt < %s -basic-aa -licm -S | FileCheck %s 2 3; Test moved from sinking.ll, as it tests sinking of a store who alone touches 4; a memory location in a loop. 5; Store can be sunk out of exit block containing indirectbr instructions after 6; D50925. Updated to use an argument instead of undef, due to PR38989. 7define void @test12(i32* %ptr) { 8; CHECK-LABEL: @test12 9; CHECK: store 10; CHECK-NEXT: br label %lab4 11 br label %lab4 12 13lab4: 14 br label %lab20 15 16lab5: 17 br label %lab20 18 19lab6: 20 br label %lab4 21 22lab7: 23 br i1 undef, label %lab8, label %lab13 24 25lab8: 26 br i1 undef, label %lab13, label %lab10 27 28lab10: 29 br label %lab7 30 31lab13: 32 ret void 33 34lab20: 35 br label %lab21 36 37lab21: 38; CHECK: lab21: 39; CHECK-NOT: store 40; CHECK: br i1 false, label %lab21, label %lab22 41 store i32 36127957, i32* %ptr, align 4 42 br i1 undef, label %lab21, label %lab22 43 44lab22: 45; CHECK: lab22: 46; CHECK-NOT: store 47; CHECK-NEXT: indirectbr i8* undef 48 indirectbr i8* undef, [label %lab5, label %lab6, label %lab7] 49} 50 51