[cost] Add a FN test using block (autoreleasepool)

Summary: This diff adds a FN test using block.

Reviewed By: ezgicicek

Differential Revision: D23708266

fbshipit-source-id: 35ade9507
master
Sungkeun Cho 4 years ago committed by Facebook GitHub Bot
parent a40ad1c733
commit 9f43c88565

@ -6,7 +6,8 @@
TESTS_DIR = ../../..
CLANG_OPTIONS = -c $(OBJC_CLANG_OPTIONS)
INFER_OPTIONS = --cost-only --debug-exceptions --project-root $(TESTS_DIR)
INFER_OPTIONS = --cost-only --debug-exceptions --project-root $(TESTS_DIR) \
--report-force-relative-path --xcode-isysroot-suffix $(XCODE_ISYSROOT_SUFFIX)
INFERPRINT_OPTIONS = --issues-tests
INFERPRINT_COST_OPTIONS = --cost-tests-only-autoreleasepool --cost-issues-tests

@ -0,0 +1,23 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <Foundation/Foundation.h>
#import "no_arc_callee.h"
@interface ArcBlock : NSObject
@end
@implementation ArcBlock
+ (void)callIndexOfObjectPassingTest_linear_FN:(NSArray*)x {
int i = [x indexOfObjectPassingTest:^BOOL(
NSObject* obj, NSUInteger idx, BOOL* stop) {
NoArcCallee* o = [NoArcCallee giveMeObject];
return false;
}];
}
@end

@ -1,3 +1,7 @@
${XCODE_ISYSROOT}/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h, NSArray.indexOfObjectPassingTest:[objc_blockArcBlock.callIndexOfObjectPassingTest_linear_FN:_1], 0, OnUIThread:false, []
codetoanalyze/objc/autoreleasepool/arc_block.m, ArcBlock.callIndexOfObjectPassingTest_linear_FN:, 0, OnUIThread:false, []
codetoanalyze/objc/autoreleasepool/arc_block.m, ArcBlock.dealloc, 0, OnUIThread:false, []
codetoanalyze/objc/autoreleasepool/arc_block.m, objc_blockArcBlock.callIndexOfObjectPassingTest_linear_FN:_1, 1, OnUIThread:false, [autorelease,Call to NoArcCallee.giveMeObject,Modeled call to autorelease]
codetoanalyze/objc/autoreleasepool/arc_caller.m, ArcCaller.callAllocObject_zero:, 0, OnUIThread:false, []
codetoanalyze/objc/autoreleasepool/arc_caller.m, ArcCaller.callCopyObject_zero:x:, 0, OnUIThread:false, []
codetoanalyze/objc/autoreleasepool/arc_caller.m, ArcCaller.callGiveMeObject_autoreleasepool_zero:, 0, OnUIThread:false, []

Loading…
Cancel
Save