summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-02-21 00:40:10 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-02-21 00:40:10 +0000
commit134cec62ab8ddea5b70d55873e4ab0a95d9bf894 (patch)
treee3e0ab6164d001c1bfa7f48737fa6e7978f06c3a /clang/test/CodeGenObjC
parentf5b474c6c6c05689fb1a0dae7c24dec161d87917 (diff)
downloadbcm5719-llvm-134cec62ab8ddea5b70d55873e4ab0a95d9bf894.tar.gz
bcm5719-llvm-134cec62ab8ddea5b70d55873e4ab0a95d9bf894.zip
objective-C arc IR-gen. Retaining of strong
arguments in function prologue is done with objc_StoreStrong to pair it with similar objc_StoreStrong for release in function epilogue. This is done with -O0 only. // rdar://13145317 llvm-svn: 175698
Diffstat (limited to 'clang/test/CodeGenObjC')
-rw-r--r--clang/test/CodeGenObjC/arc-blocks.m4
-rw-r--r--clang/test/CodeGenObjC/arc-foreach.m8
-rw-r--r--clang/test/CodeGenObjC/arc-property.m4
-rw-r--r--clang/test/CodeGenObjC/arc-related-result-type.m4
-rw-r--r--clang/test/CodeGenObjC/arc.m4
-rw-r--r--clang/test/CodeGenObjC/debug-info-block-line.m4
6 files changed, 15 insertions, 13 deletions
diff --git a/clang/test/CodeGenObjC/arc-blocks.m b/clang/test/CodeGenObjC/arc-blocks.m
index 48c4f08c715..49628ef62b8 100644
--- a/clang/test/CodeGenObjC/arc-blocks.m
+++ b/clang/test/CodeGenObjC/arc-blocks.m
@@ -614,8 +614,8 @@ void test18(id x) {
// CHECK-UNOPT: define void @test18(
// CHECK-UNOPT: [[X:%.*]] = alloca i8*,
// CHECK-UNOPT-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
-// CHECK-UNOPT-NEXT: [[PARM:%.*]] = call i8* @objc_retain(i8* {{%.*}})
-// CHECK-UNOPT-NEXT: store i8* [[PARM]], i8** [[X]]
+// CHECK-UNOPT-NEXT: store i8* null, i8** [[X]]
+// CHECK-UNOPT-NEXT: call void @objc_storeStrong(i8** [[X]],
// CHECK-UNOPT-NEXT: [[SLOTREL:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5
// CHECK-UNOPT: [[SLOT:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5
// CHECK-UNOPT-NEXT: [[T0:%.*]] = load i8** [[X]],
diff --git a/clang/test/CodeGenObjC/arc-foreach.m b/clang/test/CodeGenObjC/arc-foreach.m
index bb2485580c9..74944511054 100644
--- a/clang/test/CodeGenObjC/arc-foreach.m
+++ b/clang/test/CodeGenObjC/arc-foreach.m
@@ -30,10 +30,10 @@ void test0(NSArray *array) {
// CHECK-LP64-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
// Initialize 'array'.
-// CHECK-LP64-NEXT: [[T0:%.*]] = bitcast [[ARRAY_T:%.*]]* {{%.*}} to i8*
-// CHECK-LP64-NEXT: [[T1:%.*]] = call i8* @objc_retain(i8* [[T0]])
-// CHECK-LP64-NEXT: [[T2:%.*]] = bitcast i8* [[T1]] to [[ARRAY_T]]*
-// CHECK-LP64-NEXT: store [[ARRAY_T]]* [[T2]], [[ARRAY_T]]** [[ARRAY]], align 8
+// CHECK-LP64-NEXT: store [[ARRAY_T]]* null, [[ARRAY_T]]** [[ARRAY]]
+// CHECK-LP64-NEXT: [[ZERO:%.*]] = bitcast [[ARRAY_T]]** [[ARRAY]] to i8**
+// CHECK-LP64-NEXT: [[ONE:%.*]] = bitcast [[ARRAY_T]]* {{%.*}} to i8*
+// CHECK-LP64-NEXT: call void @objc_storeStrong(i8** [[ZERO]], i8* [[ONE]]) nounwind
// Initialize the fast enumaration state.
// CHECK-LP64-NEXT: [[T0:%.*]] = bitcast [[STATE_T]]* [[STATE]] to i8*
diff --git a/clang/test/CodeGenObjC/arc-property.m b/clang/test/CodeGenObjC/arc-property.m
index db00e369cfd..0e0dabe6de2 100644
--- a/clang/test/CodeGenObjC/arc-property.m
+++ b/clang/test/CodeGenObjC/arc-property.m
@@ -8,8 +8,8 @@ void test0(Test0 *t0, id value) {
t0.value = value;
}
// CHECK: define void @test0(
-// CHECK: call i8* @objc_retain(
-// CHECK: call i8* @objc_retain(
+// CHECK: call void @objc_storeStrong
+// CHECK: call void @objc_storeStrong
// CHECK: @objc_msgSend
// CHECK: call void @objc_storeStrong(
// CHECK: call void @objc_storeStrong(
diff --git a/clang/test/CodeGenObjC/arc-related-result-type.m b/clang/test/CodeGenObjC/arc-related-result-type.m
index ee0a41dd00b..e8b97012cdc 100644
--- a/clang/test/CodeGenObjC/arc-related-result-type.m
+++ b/clang/test/CodeGenObjC/arc-related-result-type.m
@@ -9,10 +9,10 @@ void test0(Test0 *val) {
// CHECK: define void @test0(
// CHECK: [[VAL:%.*]] = alloca [[TEST0:%.*]]*
// CHECK-NEXT: [[X:%.*]] = alloca [[TEST0]]*
+// CHECK-NEXT: store [[TEST0]]* null
// CHECK-NEXT: bitcast
-// CHECK-NEXT: call i8* @objc_retain(
// CHECK-NEXT: bitcast
-// CHECK-NEXT: store
+// CHECK-NEXT: call void @objc_storeStrong(
// CHECK-NEXT: load [[TEST0]]** [[VAL]],
// CHECK-NEXT: load
// CHECK-NEXT: bitcast
diff --git a/clang/test/CodeGenObjC/arc.m b/clang/test/CodeGenObjC/arc.m
index 599753ee9cb..726ba32f643 100644
--- a/clang/test/CodeGenObjC/arc.m
+++ b/clang/test/CodeGenObjC/arc.m
@@ -6,8 +6,8 @@
// RUN: %clang_cc1 -fobjc-runtime=macosx-10.6.0 -triple x86_64-apple-darwin10 -emit-llvm -fblocks -fobjc-arc -fobjc-runtime-has-weak -o - %s | FileCheck -check-prefix=ARC-ALIEN %s
// RUN: %clang_cc1 -fobjc-runtime=macosx-10.7.0 -triple x86_64-apple-darwin11 -emit-llvm -fblocks -fobjc-arc -fobjc-runtime-has-weak -o - %s | FileCheck -check-prefix=ARC-NATIVE %s
-// ARC-ALIEN: declare extern_weak i8* @objc_retain(i8*)
// ARC-ALIEN: declare extern_weak void @objc_storeStrong(i8**, i8*)
+// ARC-ALIEN: declare extern_weak i8* @objc_retain(i8*)
// ARC-ALIEN: declare extern_weak i8* @objc_autoreleaseReturnValue(i8*)
// ARC-ALIEN: declare i8* @objc_msgSend(i8*, i8*, ...) #1
// ARC-ALIEN: declare extern_weak void @objc_release(i8*)
@@ -19,8 +19,8 @@
// ARC-ALIEN: declare extern_weak i8* @objc_autorelease(i8*)
// ARC-ALIEN: declare extern_weak i8* @objc_retainAutorelease(i8*)
-// ARC-NATIVE: declare i8* @objc_retain(i8*) #1
// ARC-NATIVE: declare void @objc_storeStrong(i8**, i8*)
+// ARC-NATIVE: declare i8* @objc_retain(i8*) #1
// ARC-NATIVE: declare i8* @objc_autoreleaseReturnValue(i8*)
// ARC-NATIVE: declare i8* @objc_msgSend(i8*, i8*, ...) #1
// ARC-NATIVE: declare void @objc_release(i8*) #1
diff --git a/clang/test/CodeGenObjC/debug-info-block-line.m b/clang/test/CodeGenObjC/debug-info-block-line.m
index 1e02e5876fd..cca11a03972 100644
--- a/clang/test/CodeGenObjC/debug-info-block-line.m
+++ b/clang/test/CodeGenObjC/debug-info-block-line.m
@@ -62,12 +62,14 @@ typedef enum : NSUInteger {
TMap *map = [TMap mapForID:mapID];
// Make sure we do not map code generated for the block to the above line.
// CHECK: define internal void @"__39-[TServer serverConnection:getCommand:]_block_invoke"
+// CHECK: call void @objc_storeStrong(i8** [[ZERO:%.*]], i8* [[ONE:%.*]]) nounwind
+// CHECK: call void @objc_storeStrong(i8** [[TWO:%.*]], i8* [[THREE:%.*]]) nounwind
// CHECK: bitcast %5** [[TMP:%.*]] to i8**
// CHECK: call void @objc_storeStrong(i8** [[VAL1:%.*]], i8* null) nounwind, !dbg ![[MD1:.*]]
// CHECK: bitcast %4** [[TMP:%.*]] to i8**
// CHECK: call void @objc_storeStrong(i8** [[VAL2:%.*]], i8* null) nounwind, !dbg ![[MD1]]
// CHECK-NEXT: ret
-// CHECK: ![[MD1]] = metadata !{i32 84
+// CHECK: ![[MD1]] = metadata !{i32 86
[map dataWithCompletionBlock:^(NSData *data, NSError *error) {
if (data) {
NSString *encoded = [[data compressedData] encodedString:18];
OpenPOWER on IntegriCloud