llvm/llvm/test/Transforms/Sink/single-succ.ll

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S < %s -passes=sink | FileCheck %s

define i32 @single_succ(i1 %b, ptr %a) {
; CHECK-LABEL: @single_succ(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    br label [[IF:%.*]]
; CHECK:       if:
; CHECK-NEXT:    br i1 [[B:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK:       then:
; CHECK-NEXT:    ret i32 42
; CHECK:       else:
; CHECK-NEXT:    [[L:%.*]] = load i32, ptr [[A:%.*]], align 4
; CHECK-NEXT:    ret i32 [[L]]
;
entry:
  %l = load i32, ptr %a, align 4
  br label %if
if:
  br i1 %b, label %then, label %else
then:
  ret i32 42
else:
  ret i32 %l
}