diff options
Diffstat (limited to 'test/Transforms/ObjCARC/weak-contract.ll')
-rw-r--r-- | test/Transforms/ObjCARC/weak-contract.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Transforms/ObjCARC/weak-contract.ll b/test/Transforms/ObjCARC/weak-contract.ll new file mode 100644 index 000000000000..ca69c7087ddd --- /dev/null +++ b/test/Transforms/ObjCARC/weak-contract.ll @@ -0,0 +1,14 @@ +; RUN: opt -objc-arc-contract -S < %s | FileCheck %s + +declare i8* @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* @objc_initWeak(i8** %p, i8* null) + ret i8* %t +} |