r178094 - [analyzer] Better test for r178063.

Anna Zaks ganna at apple.com
Tue Mar 26 16:58:52 PDT 2013


Author: zaks
Date: Tue Mar 26 18:58:52 2013
New Revision: 178094

URL: http://llvm.org/viewvc/llvm-project?rev=178094&view=rev
Log:
[analyzer] Better test for r178063.

Jordan pointed out that my previously committed test was bogus.

Modified:
    cfe/trunk/test/Analysis/retain-release-inline.m

Modified: cfe/trunk/test/Analysis/retain-release-inline.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/retain-release-inline.m?rev=178094&r1=178093&r2=178094&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/retain-release-inline.m (original)
+++ cfe/trunk/test/Analysis/retain-release-inline.m Tue Mar 26 18:58:52 2013
@@ -364,27 +364,32 @@ CFStringRef testCovariantReturnType() {
 
 // Test that we reanalyze ObjC methods which have been inlined. When reanalyzing
 // them, make sure we inline very small functions.
+id returnInputParam(id x) {
+  return x;
+}
 
 @interface MyClass : NSObject
-- (id)test_return_retained_NS;
-- (void)test_return_retained;
+- (id)test_reanalyze_as_top_level;
+- (void)test_inline_tiny_when_reanalyzing;
+- (void)inline_test_reanalyze_as_top_level;
 @end
 
-id returnInputParam(id x) {
-  return x;
-}
 @implementation MyClass
-- (id)test_return_retained_NS {
+- (void)test_inline_tiny_when_reanalyzing {
+  id x = [[NSString alloc] init]; // no-warning
+  x = returnInputParam(x);
+  [x release];
+}
+
+- (id)test_reanalyze_as_top_level {
   // This method does not follow naming conventions, so a warning will be
   // reported when it is reanalyzed at top level.
-  return returnInputParam([[NSString alloc] init]); // expected-warning {{leak}}
+  return [[NSString alloc] init]; // expected-warning {{leak}}
 }
 
-- (void)test_return_retained {
-  id x = test_return_retained_NS(); // expected-warning {{leak}}
-  [x retain];
+- (void)inline_test_reanalyze_as_top_level {
+  id x = [self test_reanalyze_as_top_level];
   [x release];
+  [self test_inline_tiny_when_reanalyzing];
 }
-
 @end
-





More information about the cfe-commits mailing list