diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-11-04 15:58:08 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-11-04 15:58:08 +0000 |
commit | d208ef95aa63230f3afbb65c3d73783313e96ba9 (patch) | |
tree | c08a618eb1942805d7659e15879b2a007f0b3366 /clang/test | |
parent | 62144477ebf8e15edb70e5a978d472a104601dcb (diff) | |
download | bcm5719-llvm-d208ef95aa63230f3afbb65c3d73783313e96ba9.tar.gz bcm5719-llvm-d208ef95aa63230f3afbb65c3d73783313e96ba9.zip |
[arcmt] In GC, transform NSMakeCollectable to CFBridgingRelease.
llvm-svn: 143698
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/ARCMT/Common.h | 5 | ||||
-rw-r--r-- | clang/test/ARCMT/GC.m | 9 | ||||
-rw-r--r-- | clang/test/ARCMT/GC.m.result | 9 |
3 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/ARCMT/Common.h b/clang/test/ARCMT/Common.h index 2603730cad9..16856ed1b44 100644 --- a/clang/test/ARCMT/Common.h +++ b/clang/test/ARCMT/Common.h @@ -4,8 +4,10 @@ #define NS_AUTOMATED_REFCOUNT_UNAVAILABLE #endif +#define NS_RETURNS_RETAINED __attribute__((ns_returns_retained)) #define CF_CONSUMED __attribute__((cf_consumed)) +#define NS_INLINE static __inline__ __attribute__((always_inline)) #define nil ((void*) 0) typedef int BOOL; @@ -19,6 +21,9 @@ typedef struct _NSZone NSZone; typedef const void * CFTypeRef; CFTypeRef CFRetain(CFTypeRef cf); +id CFBridgingRelease(CFTypeRef CF_CONSUMED X); + +NS_INLINE NS_RETURNS_RETAINED id NSMakeCollectable(CFTypeRef CF_CONSUMED cf) NS_AUTOMATED_REFCOUNT_UNAVAILABLE; @protocol NSObject - (BOOL)isEqual:(id)object; diff --git a/clang/test/ARCMT/GC.m b/clang/test/ARCMT/GC.m new file mode 100644 index 00000000000..90e0b458b25 --- /dev/null +++ b/clang/test/ARCMT/GC.m @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result +// RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-gc-only -x objective-c %s > %t +// RUN: diff %t %s.result + +#include "Common.h" + +void test1(CFTypeRef *cft) { + id x = NSMakeCollectable(cft); +} diff --git a/clang/test/ARCMT/GC.m.result b/clang/test/ARCMT/GC.m.result new file mode 100644 index 00000000000..1055aa33386 --- /dev/null +++ b/clang/test/ARCMT/GC.m.result @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result +// RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-gc-only -x objective-c %s > %t +// RUN: diff %t %s.result + +#include "Common.h" + +void test1(CFTypeRef *cft) { + id x = CFBridgingRelease(cft); +} |