summaryrefslogtreecommitdiff
path: root/test/Transforms/ObjCARC/expand.ll
blob: 5388673f2b9de6ad7251b7f5fa82e231b30ce857 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
; RUN: opt -objc-arc-expand -S < %s | FileCheck %s

target datalayout = "e-p:64:64:64"

declare i8* @objc_retain(i8*)
declare i8* @objc_autorelease(i8*)

declare void @use_pointer(i8*)

; CHECK: define void @test0
; CHECK: call void @use_pointer(i8* %x)
; CHECK: }
define void @test0(i8* %x) nounwind {
entry:
  %0 = call i8* @objc_retain(i8* %x) nounwind
  call void @use_pointer(i8* %0)
  ret void
}

; CHECK: define void @test1
; CHECK: call void @use_pointer(i8* %x)
; CHECK: }
define void @test1(i8* %x) nounwind {
entry:
  %0 = call i8* @objc_autorelease(i8* %x) nounwind
  call void @use_pointer(i8* %x)
  ret void
}