summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/ObjCARC/weak-contract.ll
blob: ca37711529153608b7d44ae2be8b16f6262d18b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
; RUN: opt -objc-arc-contract -S < %s | FileCheck %s

declare i8* @llvm.objc.initWeak(i8**, i8*)

; Convert objc_initWeak(p, null) to *p = null.

; CHECK:      define i8* @test0(i8** %p) {
; CHECK-NEXT:   store i8* null, i8** %p
; CHECK-NEXT:   ret i8* null
; CHECK-NEXT: }
define i8* @test0(i8** %p) {
  %t = call i8* @llvm.objc.initWeak(i8** %p, i8* null)
  ret i8* %t
}
OpenPOWER on IntegriCloud