1 ; RUN: echo 'foo bb9' > %t
2 ; RUN: echo 'foo bb20' >> %t
3 ; RUN: opt -S -passes=extract-blocks -extract-blocks-file=%t %s | FileCheck %s --check-prefix=CHECK-NO-ERASE
4 ; RUN: opt -S -passes=extract-blocks -extract-blocks-file=%t -extract-blocks-erase-funcs %s | FileCheck %s --check-prefix=CHECK-ERASE
6 ; CHECK-NO-ERASE: @foo(
7 ; CHECK-NO-ERASE: @foo.bb9(
8 ; CHECK-NO-ERASE: @foo.bb20(
9 ; CHECK-ERASE: declare i32 @foo(
10 ; CHECK-ERASE: @foo.bb9(
11 ; CHECK-ERASE: @foo.bb20(
12 define i32 @foo(i32 %arg, i32 %arg1) {
14 %tmp5 = icmp sgt i32 %arg, 0
15 %tmp8 = icmp sgt i32 %arg1, 0
16 %or.cond = and i1 %tmp5, %tmp8
17 br i1 %or.cond, label %bb9, label %bb14
20 %tmp12 = shl i32 %arg1, 2
21 %tmp13 = add nsw i32 %tmp12, %arg
25 %0 = and i32 %arg1, %arg
26 %1 = icmp slt i32 %0, 0
27 br i1 %1, label %bb20, label %bb26
30 %tmp22 = mul nsw i32 %arg, 3
31 %tmp24 = sdiv i32 %arg1, 6
32 %tmp25 = add nsw i32 %tmp24, %tmp22
36 %tmp29 = sub nsw i32 %arg, %arg1
39 bb30: ; preds = %bb26, %bb20, %bb9
40 %tmp.0 = phi i32 [ %tmp13, %bb9 ], [ %tmp25, %bb20 ], [ %tmp29, %bb26 ]