SimplifyCFG: don't remove unreachable default switch destinations
[oota-llvm.git] / test / Transforms / ObjCARC / contract-marker.ll
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
10 define void @foo() {
11 entry:
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
19 declare i32* @qux()
20 declare i8* @objc_retainAutoreleasedReturnValue(i8*)
21 declare 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 }