llvm/llvm/test/Transforms/PhaseOrdering/func-attrs.ll

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes
; RUN: opt -O2 -S < %s | FileCheck %s

declare void @g()

define internal i32 @h1(i32 %a, i32 %b) {
  %c = add i32 %a, %b
  %c2 = add i32 2, %c
  ret i32 %c2
}

define internal i32 @h2(i32 %a, i32 %b) {
  %c = add i32 %a, %b
  %c2 = add i32 2, %c
  ret i32 %c2
}

define void @f(i32 %a, i32 %b) noinline {
; CHECK: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(none)
; CHECK-LABEL: @f(
; CHECK-NEXT:  end:
; CHECK-NEXT:    ret void
;
  %c = call i32 @h1(i32 %a, i32 %b)
  %d = call i32 @h2(i32 %a, i32 %b)
  %i = icmp eq i32 %c, %d
  br i1 %i, label %end, label %dead
dead:
  call void @g()
  br label %end
end:
  ret void
}