Reviewed By: ezgicicek Differential Revision: D22357433 fbshipit-source-id: f3a8bf1b4master
parent
a89d3db364
commit
d2f3f81826
@ -0,0 +1,22 @@
|
||||
# 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.
|
||||
|
||||
TESTS_DIR = ../../..
|
||||
|
||||
# see explanations in cpp/biabduction/Makefile for the custom isystem
|
||||
CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(CLANG_INCLUDES)/c++/v1/ -c
|
||||
INFER_OPTIONS = --cost-only --ml-buckets cpp --no-filtering --debug-exceptions \
|
||||
--project-root $(TESTS_DIR) --report-force-relative-path --debug
|
||||
INFERPRINT_OPTIONS = --issues-tests
|
||||
INFERPRINT_COST_OPTIONS = --cost-issues-tests
|
||||
|
||||
SOURCES = $(wildcard *.cpp)
|
||||
|
||||
HEADERS =
|
||||
|
||||
include $(TESTS_DIR)/clang.make
|
||||
include $(TESTS_DIR)/cost.make
|
||||
|
||||
infer-out/report.json: $(MAKEFILE_LIST)
|
@ -0,0 +1,2 @@
|
||||
codetoanalyze/cpp/performance/string_test.cpp, call_google_strlen_linear, 3 + str->strlen.ub(u), OnUIThread:false, [{str->strlen.ub(u)},Modeled call to google::StrLen]
|
||||
codetoanalyze/cpp/performance/string_test.cpp, call_google_strlen_with_loop_linear, 5 + 3 ⋅ str->strlen.ub(u) + str->strlen.ub(u) + 2 ⋅ (str->strlen.ub(u) + 1), OnUIThread:false, [{str->strlen.ub(u) + 1},Loop at line 16, column 3,{str->strlen.ub(u)},Modeled call to google::StrLen,{str->strlen.ub(u)},Loop at line 16, column 3]
|
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
namespace google {
|
||||
int StrLen(char*);
|
||||
}
|
||||
|
||||
void call_google_strlen_linear(char* str) { int len = google::StrLen(str); }
|
||||
|
||||
void call_google_strlen_with_loop_linear(char* str) {
|
||||
int len = google::StrLen(str);
|
||||
for (int i = 0; i < len; i++) {
|
||||
}
|
||||
}
|
Loading…
Reference in new issue