1; RUN: opt -S -objc-arc-contract < %s | FileCheck %s
2
3; CHECK: define void @foo() {
4; CHECK:      %call = tail call i32* @qux()
5; CHECK-NEXT: %tcall = bitcast i32* %call to i8*
6; CHECK-NEXT: call void asm sideeffect "mov\09r7, r7\09\09@ marker for objc_retainAutoreleaseReturnValue", ""()
7; CHECK-NEXT: %0 = tail call i8* @objc_retainAutoreleasedReturnValue(i8* %tcall) [[NUW:#[0-9]+]]
8; CHECK: }
9
10define void @foo() {
11entry:
12  %call = tail call i32* @qux()
13  %tcall = bitcast i32* %call to i8*
14  %0 = tail call i8* @objc_retainAutoreleasedReturnValue(i8* %tcall) nounwind
15  tail call void @bar(i8* %0)
16  ret void
17}
18
19declare i32* @qux()
20declare i8* @objc_retainAutoreleasedReturnValue(i8*)
21declare void @bar(i8*)
22
23!clang.arc.retainAutoreleasedReturnValueMarker = !{!0}
24
25!0 = !{!"mov\09r7, r7\09\09@ marker for objc_retainAutoreleaseReturnValue"}
26
27; CHECK: attributes [[NUW]] = { nounwind }
28