aboutsummaryrefslogtreecommitdiff
path: root/test/ARCMT/objcmt-arc-cf-annotations.m.result
diff options
context:
space:
mode:
Diffstat (limited to 'test/ARCMT/objcmt-arc-cf-annotations.m.result')
-rw-r--r--test/ARCMT/objcmt-arc-cf-annotations.m.result48
1 files changed, 32 insertions, 16 deletions
diff --git a/test/ARCMT/objcmt-arc-cf-annotations.m.result b/test/ARCMT/objcmt-arc-cf-annotations.m.result
index 7e0a9042f5e6..84bc43dcb5ca 100644
--- a/test/ARCMT/objcmt-arc-cf-annotations.m.result
+++ b/test/ARCMT/objcmt-arc-cf-annotations.m.result
@@ -390,7 +390,7 @@ CFAbsoluteTime f2() {
NSDate* global_x;
-// Test to see if we supresss an error when we store the pointer
+// Test to see if we suppress an error when we store the pointer
// to a global.
CFAbsoluteTime f3() {
@@ -570,38 +570,54 @@ void f15() {
CFRelease(*B); // no-warning
}
-// Test when we pass NULL to CFRetain/CFRelease/CFMakeCollectable.
+// Test when we pass NULL to CFRetain/CFRelease/CFMakeCollectable/CFAutorelease.
void f16(int x, CFTypeRef p) {
if (p)
return;
- if (x > 0) {
- CFRelease(p); // expected-warning{{Null pointer argument in call to CFRelease}}
- }
- else if (x < 0) {
- CFRetain(p); // expected-warning{{Null pointer argument in call to CFRetain}}
- }
- else {
- CFMakeCollectable(p); // expected-warning{{Null pointer argument in call to CFMakeCollectable}}
+ switch (x) {
+ case 0:
+ CFRelease(p);
+ break;
+ case 1:
+ CFRetain(p);
+ break;
+ case 2:
+ CFMakeCollectable(p);
+ break;
+ case 3:
+ CFAutorelease(p);
+ break;
+ default:
+ break;
}
}
-// Test that an object is non-null after being CFRetained/CFReleased.
+// Test that an object is non-null after CFRetain/CFRelease/CFMakeCollectable/CFAutorelease.
void f17(int x, CFTypeRef p) {
- if (x > 0) {
+ switch (x) {
+ case 0:
CFRelease(p);
if (!p)
CFRelease(0); // no-warning
- }
- else if (x < 0) {
+ break;
+ case 1:
CFRetain(p);
if (!p)
CFRetain(0); // no-warning
- }
- else {
+ break;
+ case 2:
CFMakeCollectable(p);
if (!p)
CFMakeCollectable(0); // no-warning
+ break;
+ case 3:
+ CFAutorelease(p);
+ if (!p)
+ CFAutorelease(0); // no-warning
+ break;
+ default:
+ break;
}
}