xref: /llvm-project/llvm/test/tools/llvm-extract/extract-multiple-blocks.ll (revision a273c40820f78d8b08e411897eee84dbda983488)
1; RUN: llvm-extract -S -bb foo:bb4 -bb foo:bb7 %s | FileCheck %s
2
3; CHECK: @foo.bb4
4; CHECK: @foo.bb7
5define i32 @foo(i32 %arg) {
6bb:
7  %tmp = alloca i32, align 4
8  %tmp1 = alloca i32, align 4
9  store i32 %arg, ptr %tmp1, align 4
10  %tmp2 = load i32, ptr %tmp1, align 4
11  %tmp3 = icmp sgt i32 %tmp2, 0
12  br i1 %tmp3, label %bb4, label %bb7
13
14bb4:                                              ; preds = %bb
15  %tmp5 = load i32, ptr %tmp1, align 4
16  %tmp6 = add nsw i32 %tmp5, 1
17  store i32 %tmp6, ptr %tmp1, align 4
18  store i32 %tmp6, ptr %tmp, align 4
19  br label %bb8
20
21bb7:                                              ; preds = %bb
22  store i32 0, ptr %tmp, align 4
23  br label %bb8
24
25bb8:                                              ; preds = %bb7, %bb4
26  %tmp9 = load i32, ptr %tmp, align 4
27  ret i32 %tmp9
28}
29
30