diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2014-08-07 20:57:35 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-08-07 20:57:35 +0000 |
| commit | d45e7cec42aeef87eef76996186597b9a5663de8 (patch) | |
| tree | cf877eae5427e02dde0d918da21552ceefdbc47f /clang/test/CodeGenObjC | |
| parent | 88d99e4f427350dc788a6a0a71c2f93be59a7cde (diff) | |
| download | bcm5719-llvm-d45e7cec42aeef87eef76996186597b9a5663de8.tar.gz bcm5719-llvm-d45e7cec42aeef87eef76996186597b9a5663de8.zip | |
Objective-C arc. Switch the Objective-C dictionary literal in ARC mode
to use non-retain/autorelease API variants of ObjC objects. wip.
rdar://17554063
llvm-svn: 215146
Diffstat (limited to 'clang/test/CodeGenObjC')
| -rw-r--r-- | clang/test/CodeGenObjC/Inputs/literal-support.h | 1 | ||||
| -rw-r--r-- | clang/test/CodeGenObjC/arc-literals.m | 12 |
2 files changed, 8 insertions, 5 deletions
diff --git a/clang/test/CodeGenObjC/Inputs/literal-support.h b/clang/test/CodeGenObjC/Inputs/literal-support.h index fc80d88b13d..475c86af241 100644 --- a/clang/test/CodeGenObjC/Inputs/literal-support.h +++ b/clang/test/CodeGenObjC/Inputs/literal-support.h @@ -34,6 +34,7 @@ typedef unsigned char BOOL; @interface NSDictionary : NSObject + (id)dictionaryWithObjects:(const id [])objects forKeys:(const id [])keys count:(unsigned long)cnt; +- (instancetype)initWithObjects:(const id [])objects forKeys:(const id [])keys count:(unsigned long)cnt; @end #endif // OBJC_LITERAL_SUPPORT_H diff --git a/clang/test/CodeGenObjC/arc-literals.m b/clang/test/CodeGenObjC/arc-literals.m index 19a5516dc7c..427c65aa054 100644 --- a/clang/test/CodeGenObjC/arc-literals.m +++ b/clang/test/CodeGenObjC/arc-literals.m @@ -9,7 +9,7 @@ // CHECK: c"numberWithUnsignedLongLong:\00" // CHECK: c"numberWithChar:\00" // CHECK: c"arrayWithObjects:count:\00" -// CHECK: c"dictionaryWithObjects:forKeys:count:\00" +// CHECK: c"initWithObjects:forKeys:count:\00" // CHECK: c"prop\00" // CHECK-LABEL: define void @test_numeric() @@ -96,10 +96,12 @@ void test_dictionary(id k1, id o1, id k2, id o2) { // 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:%.*]] = bitcast [2 x i8*]* [[KEYS]] to i8** - // CHECK-NEXT: [[T4:%.*]] = call i8* bitcast ({{.*@objc_msgSend.*}})(i8* [[T1]], i8* [[SEL]], i8** [[T2]], i8** [[T3]], i64 2) - // CHECK-NEXT: [[T5:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T4]]) + + // CHECK-NEXT: [[ALLOC:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* [[T1]], i8* [[SEL]]) + // CHECK-NEXT: [[T15:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES + // CHECK-NEXT: [[T16:%.*]] = bitcast [2 x i8*]* [[OBJECTS]] to i8** + // CHECK-NEXT: [[T17:%.*]] = bitcast [2 x i8*]* [[KEYS]] to i8** + // CHECK-NEXT: [[INIT:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*, i8**, i8**, i64)*)(i8* [[ALLOC]], i8* [[T15]], i8** [[T16]], i8** [[T17]], i64 2) // CHECK-NEXT: call void (...)* @clang.arc.use(i8* [[V0]], i8* [[V1]], i8* [[V2]], i8* [[V3]]) id dict = @{ k1 : o1, k2 : o2 }; |

