Skip to content

Commit 3ea86a1

Browse files
committed
[Sink] Add a single successor test
1 parent ba1669c commit 3ea86a1

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2+
; RUN: opt -S < %s -passes=sink | FileCheck %s
3+
4+
define i32 @single_succ(i1 %b, ptr %a) {
5+
; CHECK-LABEL: @single_succ(
6+
; CHECK-NEXT: entry:
7+
; CHECK-NEXT: [[L:%.*]] = load i32, ptr [[A:%.*]], align 4
8+
; CHECK-NEXT: br label [[IF:%.*]]
9+
; CHECK: if:
10+
; CHECK-NEXT: br i1 [[B:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
11+
; CHECK: then:
12+
; CHECK-NEXT: ret i32 42
13+
; CHECK: else:
14+
; CHECK-NEXT: ret i32 [[L]]
15+
;
16+
entry:
17+
%l = load i32, ptr %a, align 4
18+
br label %if
19+
if:
20+
br i1 %b, label %then, label %else
21+
then:
22+
ret i32 42
23+
else:
24+
ret i32 %l
25+
}

0 commit comments

Comments
 (0)