summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-06-18 23:22:38 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-06-18 23:22:38 +0000
commit1ad83a35b1d5566bc633437dd17faba8af745627 (patch)
treec891e9ba604c963582ee84f9e90be96ec2beba30 /clang/test
parentda8038670011232eabb305cd46e72aa4c1eb9f2a (diff)
downloadbcm5719-llvm-1ad83a35b1d5566bc633437dd17faba8af745627.tar.gz
bcm5719-llvm-1ad83a35b1d5566bc633437dd17faba8af745627.zip
Objective-C. Revert my patch in r211234.
llvm-svn: 211237
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/ARCMT/checking.m4
-rw-r--r--clang/test/ARCMT/nonobjc-to-objc-cast.m.result2
-rw-r--r--clang/test/SemaObjC/arc-type-conversion.m4
-rw-r--r--clang/test/SemaObjC/arc.m18
4 files changed, 7 insertions, 21 deletions
diff --git a/clang/test/ARCMT/checking.m b/clang/test/ARCMT/checking.m
index 9dbd222cd26..7815103822a 100644
--- a/clang/test/ARCMT/checking.m
+++ b/clang/test/ARCMT/checking.m
@@ -158,8 +158,8 @@ void * cvt(id arg)
(void)(__autoreleasing id**)voidp_val;
(void)(void*)voidp_val;
(void)(void**)arg; // expected-error {{disallowed}}
- cvt((void*)arg); // expected-error 1 {{requires a bridged cast}} \
- // expected-note 1 {{use __bridge to}} expected-note {{use CFBridgingRetain call}}
+ cvt((void*)arg); // expected-error 2 {{requires a bridged cast}} \
+ // expected-note 2 {{use __bridge to}} expected-note {{use CFBridgingRelease call}} expected-note {{use CFBridgingRetain call}}
cvt(0);
(void)(__strong id**)(0);
return arg; // expected-error {{requires a bridged cast}} expected-note {{use __bridge}} expected-note {{use CFBridgingRetain call}}
diff --git a/clang/test/ARCMT/nonobjc-to-objc-cast.m.result b/clang/test/ARCMT/nonobjc-to-objc-cast.m.result
index 645bbb24d4b..ce827ba66aa 100644
--- a/clang/test/ARCMT/nonobjc-to-objc-cast.m.result
+++ b/clang/test/ARCMT/nonobjc-to-objc-cast.m.result
@@ -36,7 +36,7 @@ void f(BOOL b, id p) {
CFUUIDRef _uuid;
NSString *_uuidString = (NSString *)CFBridgingRelease(CFUUIDCreateString(kCFAllocatorDefault, _uuid));
_uuidString = (NSString *)CFBridgingRelease(CFUUIDCreateString(kCFAllocatorDefault, _uuid));
- _uuidString = CFRetain(_uuid);
+ _uuidString = CFBridgingRelease(CFRetain(_uuid));
}
@implementation NSString (StrExt)
diff --git a/clang/test/SemaObjC/arc-type-conversion.m b/clang/test/SemaObjC/arc-type-conversion.m
index ce21a7f18b6..5cf2cf4b745 100644
--- a/clang/test/SemaObjC/arc-type-conversion.m
+++ b/clang/test/SemaObjC/arc-type-conversion.m
@@ -16,8 +16,10 @@ void * cvt(id arg)
(void)(void*)voidp_val;
(void)(void**)arg; // expected-error {{cast of an Objective-C pointer to 'void **' is disallowed with ARC}}
cvt((void*)arg); // expected-error {{cast of Objective-C pointer type 'id' to C pointer type 'void *' requires a bridged cast}} \
- // expected-note 1 {{use __bridge to convert directly (no change in ownership)}} \
+ // expected-error {{implicit conversion of C pointer type 'void *' to Objective-C pointer type 'id' requires a bridged cast}} \
+ // expected-note 2 {{use __bridge to convert directly (no change in ownership)}} \
// expected-note {{use CFBridgingRetain call to make an ARC object available as a +1 'void *'}} \
+ // expected-note {{use CFBridgingRelease call to transfer ownership of a +1 'void *' into ARC}}
cvt(0);
(void)(__strong id**)(0);
return arg; // expected-error {{implicit conversion of Objective-C pointer type 'id' to C pointer type 'void *' requires a bridged cast}} \
diff --git a/clang/test/SemaObjC/arc.m b/clang/test/SemaObjC/arc.m
index 31b47105d52..060af24fa0d 100644
--- a/clang/test/SemaObjC/arc.m
+++ b/clang/test/SemaObjC/arc.m
@@ -285,7 +285,7 @@ void test11(id op, void *vp) {
b = (nil == vp);
b = (vp == op); // expected-error {{implicit conversion of Objective-C pointer type 'id' to C pointer type 'void *' requires a bridged cast}} expected-note {{use __bridge}} expected-note {{use CFBridgingRetain call}}
- b = (op == vp);
+ b = (op == vp); // expected-error {{implicit conversion of C pointer type 'void *' to Objective-C pointer type 'id' requires a bridged cast}} expected-note {{use __bridge}} expected-note {{use CFBridgingRelease call}}
}
void test12(id collection) {
@@ -782,19 +782,3 @@ void foo(NSArray *array) {
}
}
}
-
-// rdar://16627903
-extern void abort();
-#define TKAssertEqual(a, b) do{\
- __typeof(a) a_res = (a);\
- __typeof(b) b_res = (b);\
- if ((a_res) != (b_res)) {\
- abort();\
- }\
-}while(0)
-
-int main() {
- id object;
- TKAssertEqual(object, nil);
- TKAssertEqual(object, (id)nil);
-}
OpenPOWER on IntegriCloud