37 lines · plain
1; Test that llvm-reduce can remove uninteresting Basic Blocks, and remove them from instructions (i.e. SwitchInst, BranchInst and IndirectBrInst)2; Note: if an uninteresting BB is the default case for a switch, the instruction is removed altogether (since the default case cannot be replaced)3;4; RUN: llvm-reduce -abort-on-invalid-reduction --delta-passes=basic-blocks --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t5; RUN: FileCheck -implicit-check-not=uninteresting %s < %t6 7; CHECK-INTERESTINGNESS: store i32 08; CHECK-INTERESTINGNESS: store i32 19; CHECK-INTERESTINGNESS: store i32 210 11define void @main() {12interesting:13 store i32 0, ptr null14 ; CHECK-NOT: switch i32 0, label %uninteresting15 switch i32 0, label %uninteresting [16 i32 1, label %interesting217 ]18 19uninteresting:20 ret void21 22interesting2:23 store i32 1, ptr null24 ; CHECK: switch i32 1, label %interesting325 switch i32 1, label %interesting3 [26 ; CHECK-NOT: i32 0, label %uninteresting27 i32 0, label %uninteresting28 ; CHECK: i32 1, label %interesting329 i32 1, label %interesting330 ]31 32interesting3:33 store i32 2, ptr null34 ; CHECK: br label %interesting235 br i1 true, label %interesting2, label %uninteresting36}37