summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-06-24 23:29:50 +0000
committerJohn McCall <rjmccall@apple.com>2011-06-24 23:29:50 +0000
commit1c382d71ee09b75ad71b82f091a75b96c16189a1 (patch)
treec4ef0dc40685b330be8600a1834b4920b91397c3 /clang/test/CodeGenObjC
parent1bd2556cccdb1336bf05e2e34d2d972ea484046e (diff)
downloadbcm5719-llvm-1c382d71ee09b75ad71b82f091a75b96c16189a1.tar.gz
bcm5719-llvm-1c382d71ee09b75ad71b82f091a75b96c16189a1.zip
Test case for r133840, neglectfully uncommitted.
llvm-svn: 133841
Diffstat (limited to 'clang/test/CodeGenObjC')
-rw-r--r--clang/test/CodeGenObjC/gc.m14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/gc.m b/clang/test/CodeGenObjC/gc.m
new file mode 100644
index 00000000000..93554e65b88
--- /dev/null
+++ b/clang/test/CodeGenObjC/gc.m
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -fobjc-nonfragile-abi -emit-llvm -o - %s | FileCheck %s
+
+void test0(void) {
+ extern id test0_helper(void);
+ __attribute__((objc_precise_lifetime)) id x = test0_helper();
+ test0_helper();
+ // CHECK: define void @test0()
+ // CHECK: [[T0:%.*]] = call i8* @test0_helper()
+ // CHECK-NEXT: store i8* [[T0]], i8** [[X:%.*]], align 8
+ // CHECK-NEXT: call i8* @test0_helper()
+ // CHECK-NEXT: [[T0:%.*]] = load i8** [[X]], align 8
+ // CHECK-NEXT: call void asm sideeffect "", "r"(i8* [[T0]]) nounwind
+ // CHECK-NEXT: ret void
+}
OpenPOWER on IntegriCloud