2011-06-16 07:37:01 +08:00
|
|
|
; RUN: opt -S -objc-arc-contract < %s | FileCheck %s
|
|
|
|
|
2013-04-27 13:25:54 +08:00
|
|
|
; CHECK: define void @foo() {
|
2011-06-16 07:37:01 +08:00
|
|
|
; CHECK: %call = tail call i32* @qux()
|
|
|
|
; CHECK-NEXT: %tcall = bitcast i32* %call to i8*
|
|
|
|
; CHECK-NEXT: call void asm sideeffect "mov\09r7, r7\09\09@ marker for objc_retainAutoreleaseReturnValue", ""()
|
2013-02-22 17:09:42 +08:00
|
|
|
; CHECK-NEXT: %0 = tail call i8* @objc_retainAutoreleasedReturnValue(i8* %tcall) [[NUW:#[0-9]+]]
|
2013-04-27 13:25:54 +08:00
|
|
|
; CHECK: }
|
2011-06-16 07:37:01 +08:00
|
|
|
|
|
|
|
define void @foo() {
|
|
|
|
entry:
|
|
|
|
%call = tail call i32* @qux()
|
|
|
|
%tcall = bitcast i32* %call to i8*
|
|
|
|
%0 = tail call i8* @objc_retainAutoreleasedReturnValue(i8* %tcall) nounwind
|
|
|
|
tail call void @bar(i8* %0)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i32* @qux()
|
|
|
|
declare i8* @objc_retainAutoreleasedReturnValue(i8*)
|
|
|
|
declare void @bar(i8*)
|
|
|
|
|
|
|
|
!clang.arc.retainAutoreleasedReturnValueMarker = !{!0}
|
|
|
|
|
|
|
|
!0 = metadata !{metadata !"mov\09r7, r7\09\09@ marker for objc_retainAutoreleaseReturnValue"}
|
2013-02-22 17:09:42 +08:00
|
|
|
|
|
|
|
; CHECK: attributes [[NUW]] = { nounwind }
|