Volkan Keles | dc40be7 | 2018-01-23 21:51:34 +0000 | [diff] [blame] | 1 | ; RUN: llvm-extract -S -bb foo:bb4 %s | FileCheck %s |
| 2 | |
| 3 | ; CHECK: @foo_bb4 |
| 4 | ; CHECK: %tmp5 |
| 5 | define i32 @foo(i32 %arg) { |
| 6 | bb: |
| 7 | %tmp = alloca i32, align 4 |
| 8 | %tmp1 = alloca i32, align 4 |
| 9 | store i32 %arg, i32* %tmp1, align 4 |
| 10 | %tmp2 = load i32, i32* %tmp1, align 4 |
| 11 | %tmp3 = icmp sgt i32 %tmp2, 0 |
| 12 | br i1 %tmp3, label %bb4, label %bb7 |
| 13 | |
| 14 | bb4: ; preds = %bb |
| 15 | %tmp5 = load i32, i32* %tmp1, align 4 |
| 16 | %tmp6 = add nsw i32 %tmp5, 1 |
| 17 | store i32 %tmp6, i32* %tmp1, align 4 |
| 18 | store i32 %tmp6, i32* %tmp, align 4 |
| 19 | br label %bb8 |
| 20 | |
| 21 | bb7: ; preds = %bb |
| 22 | store i32 0, i32* %tmp, align 4 |
| 23 | br label %bb8 |
| 24 | |
| 25 | bb8: ; preds = %bb7, %bb4 |
| 26 | %tmp9 = load i32, i32* %tmp, align 4 |
| 27 | ret i32 %tmp9 |
| 28 | } |
| 29 | |