Compiler projects using llvm
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=ipsccp -S | FileCheck %s
; Return value can't be zapped if there is a call that has operand bundle
; "clang.arc.attachedcall".

@g0 = global i8 zeroinitializer, align 1

define internal i8* @foo() {
; CHECK-LABEL: @foo(
; CHECK-NEXT:    ret i8* @g0
;
  ret i8* @g0
}

define void @test() {
; CHECK-LABEL: @test(
; CHECK-NEXT:    [[R:%.*]] = call i8* @foo() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.unsafeClaimAutoreleasedReturnValue) ]
; CHECK-NEXT:    call void (...) @llvm.objc.clang.arc.noop.use(i8* [[R]])
; CHECK-NEXT:    ret void
;
  %r = call i8* @foo() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.unsafeClaimAutoreleasedReturnValue) ]
  call void (...) @llvm.objc.clang.arc.noop.use(i8* %r)
  ret void
}

declare i8* @llvm.objc.unsafeClaimAutoreleasedReturnValue(i8*)
declare void @llvm.objc.clang.arc.noop.use(...)