Added array test where we get TOP

Reviewed By: mbouaziz

Differential Revision: D7843528

fbshipit-source-id: 46e23c3
master
Dino Distefano 7 years ago committed by Facebook Github Bot
parent 9c14e9d384
commit dbc8f29835

@ -90,7 +90,7 @@ BUILD_SYSTEMS_TESTS += \
DIRECT_TESTS += \
java_checkers java_eradicate java_infer java_lab java_tracing java_quandary \
java_racerd java_stability java_crashcontext java_starvation
java_racerd java_stability java_crashcontext java_starvation java_performance
ifneq ($(ANT),no)
BUILD_SYSTEMS_TESTS += ant
endif

@ -0,0 +1,22 @@
/*
* Copyright (c) 2018 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
public class ArrayCost {
private void ArrayCost_FP(int signum, int[] mag) {
if (mag.length > 0) {
int i = 0;
while (i < mag.length && mag[i] == 0) {
i++;
}
}
}
}

@ -0,0 +1,15 @@
# Copyright (c) 2018 - present Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
TESTS_DIR = ../../..
ANALYZER = checkers
INFER_OPTIONS = --cost-only --debug-exceptions
INFERPRINT_OPTIONS = --issues-tests
SOURCES = $(wildcard *.java)
include $(TESTS_DIR)/javac.make

@ -0,0 +1 @@
codetoanalyze/java/performance/ArrayCost.java, void ArrayCost.ArrayCost_FP(int,int[]), 0, INFINITE_EXECUTION_TIME_CALL, ERROR, []
Loading…
Cancel
Save