summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-08-08 17:31:14 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-08-08 17:31:14 +0000
commit495bc3f5f6a1924dddfeb3c090520175e637af4d (patch)
tree691b5a3a8bccc2e4c587ee19079b7098067a08e0 /clang/test/CodeGenObjC
parent241fd486eb4134361de5f571ed6b929d1603241a (diff)
downloadbcm5719-llvm-495bc3f5f6a1924dddfeb3c090520175e637af4d.tar.gz
bcm5719-llvm-495bc3f5f6a1924dddfeb3c090520175e637af4d.zip
Objective-C ARC. Use of non-retain/autorelease API
for building Objective-C array literals in ARC mode. rdar://17554063 llvm-svn: 215232
Diffstat (limited to 'clang/test/CodeGenObjC')
-rw-r--r--clang/test/CodeGenObjC/Inputs/literal-support.h1
-rw-r--r--clang/test/CodeGenObjC/arc-literals.m22
2 files changed, 14 insertions, 9 deletions
diff --git a/clang/test/CodeGenObjC/Inputs/literal-support.h b/clang/test/CodeGenObjC/Inputs/literal-support.h
index 475c86af241..caa69c24caf 100644
--- a/clang/test/CodeGenObjC/Inputs/literal-support.h
+++ b/clang/test/CodeGenObjC/Inputs/literal-support.h
@@ -30,6 +30,7 @@ typedef unsigned char BOOL;
@interface NSArray (NSArrayCreation)
+ (id)arrayWithObjects:(const id [])objects count:(unsigned long)cnt;
+- (id)initWithObjects:(const id [])objects count:(unsigned long)cnt;
@end
@interface NSDictionary : NSObject
diff --git a/clang/test/CodeGenObjC/arc-literals.m b/clang/test/CodeGenObjC/arc-literals.m
index 427c65aa054..29f2b45a808 100644
--- a/clang/test/CodeGenObjC/arc-literals.m
+++ b/clang/test/CodeGenObjC/arc-literals.m
@@ -8,7 +8,7 @@
// CHECK: c"numberWithUnsignedInt:\00"
// CHECK: c"numberWithUnsignedLongLong:\00"
// CHECK: c"numberWithChar:\00"
-// CHECK: c"arrayWithObjects:count:\00"
+// CHECK: c"initWithObjects:count:\00"
// CHECK: c"initWithObjects:forKeys:count:\00"
// CHECK: c"prop\00"
@@ -53,10 +53,12 @@ void test_array(id a, id b) {
// CHECK-NEXT: [[T0:%.*]] = load [[CLASS_T:%.*]]** @"\01L_OBJC_CLASSLIST
// CHECK-NEXT: [[SEL:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES
// CHECK-NEXT: [[T1:%.*]] = bitcast [[CLASS_T]]* [[T0]] to i8*
- // CHECK-NEXT: [[T2:%.*]] = bitcast [2 x i8*]* [[OBJECTS]] to i8**
- // CHECK-NEXT: [[T3:%.*]] = call i8* bitcast ({{.*@objc_msgSend.*}})(i8* [[T1]], i8* [[SEL]], i8** [[T2]], i64 2)
- // CHECK-NEXT: [[T4:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T3]])
- // CHECK: call void (...)* @clang.arc.use(i8* [[V0]], i8* [[V1]])
+
+ // CHECK-NEXT: [[ALLOC:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* [[T1]], i8* [[SEL]])
+ // CHECK-NEXT: [[T9:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES
+ // CHECK-NEXT: [[T10:%.*]] = bitcast [2 x i8*]* [[OBJECTS]] to i8**
+ // CHECK-NEXT: [[ARRAYINIT:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*, i8**, i64)*)(i8* [[ALLOC]], i8* [[T9]], i8** [[T10]], i64 2)
+ // CHECK-NEXT: call void (...)* @clang.arc.use(i8* [[V0]], i8* [[V1]])
id arr = @[a, b];
// CHECK: call void @objc_release
@@ -140,13 +142,15 @@ void test_property(B *b) {
// Store to array.
// CHECK-NEXT: store i8* [[V1]], i8** [[T0]]
- // Invoke arrayWithObjects:count:
+ // Invoke initWithObjects:count:
// CHECK-NEXT: [[T0:%.*]] = load [[CLASS_T]]** @"\01L_OBJC_CLASSLIST
// CHECK-NEXT: [[SEL:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES
// CHECK-NEXT: [[T1:%.*]] = bitcast [[CLASS_T]]* [[T0]] to i8*
- // CHECK-NEXT: [[T2:%.*]] = bitcast [1 x i8*]* [[OBJECTS]] to i8**
- // CHECK-NEXT: [[T3:%.*]] = call i8* bitcast ({{.*}} @objc_msgSend to {{.*}}(i8* [[T1]], i8* [[SEL]], i8** [[T2]], i64 1)
- // CHECK-NEXT: call i8* @objc_retainAutoreleasedReturnValue(i8* [[T3]])
+
+ // CHECK-NEXT: [[ALLOC:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* [[T1]], i8* [[SEL]])
+ // CHECK-NEXT: [[T9:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES
+ // CHECK-NEXT: [[T10:%.*]] = bitcast [1 x i8*]* [[OBJECTS]] to i8**
+ // CHECK-NEXT: [[INIT:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*, i8**, i64)*)(i8* [[ALLOC]], i8* [[T9]], i8** [[T10]], i64 1)
// CHECK-NEXT: call void (...)* @clang.arc.use(i8* [[V1]])
// CHECK-NEXT: bitcast
// CHECK-NEXT: bitcast
OpenPOWER on IntegriCloud