[cost] Fix misleading test names

Summary: Functions with empty body have unit cost, not zero. The unit cost comes from the start node.

Reviewed By: skcho

Differential Revision: D16855642

fbshipit-source-id: 6b5181faf
master
Ezgi Çiçek 6 years ago committed by Facebook Github Bot
parent 013a9bb97c
commit 5fa9f89285

@ -127,7 +127,8 @@ void call_while_upto20_10_good() { while_upto20_bad(10); }
void call_while_upto20_unsigned_good(unsigned x) { while_upto20_bad(x); }
void zero_cost_function() {}
// Cost: 1
void unit_cost_function() {}
int always(int i) { return i % 2 == (i + 2) % 2; }

@ -19,9 +19,9 @@ codetoanalyze/c/performance/compound_loop_guard.c, while_and_or, 0, INFINITE_EXE
codetoanalyze/c/performance/compound_loop_guard.c, while_and_or, 2, CONDITION_ALWAYS_TRUE, no_bucket, WARNING, [Here]
codetoanalyze/c/performance/compound_loop_guard.c, while_and_or, 3, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [<LHS trace>,Assignment,Binary operation: ([0, +oo] + 1):signed32]
codetoanalyze/c/performance/cost_test.c, alias_OK, 5, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [Binary operation: ([-oo, +oo] + 1):signed32]
codetoanalyze/c/performance/cost_test.c, call_infinite, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Call to infinite,Unbounded loop,Loop at line 143, column 3]
codetoanalyze/c/performance/cost_test.c, call_infinite, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Call to infinite,Unbounded loop,Loop at line 144, column 3]
codetoanalyze/c/performance/cost_test.c, call_while_upto20_minus100_bad, 0, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 606, O(1), degree = 0]
codetoanalyze/c/performance/cost_test.c, infinite, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Unbounded loop,Loop at line 143, column 3]
codetoanalyze/c/performance/cost_test.c, infinite, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Unbounded loop,Loop at line 144, column 3]
codetoanalyze/c/performance/cost_test.c, infinite, 3, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [<LHS trace>,Assignment,<RHS trace>,Assignment,Binary operation: ([-oo, +oo] + [0, +oo]):signed32]
codetoanalyze/c/performance/cost_test.c, infinite_FN, 3, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [<LHS trace>,Assignment,<RHS trace>,Assignment,Binary operation: ([-oo, +oo] + [0, +oo]):signed32]
codetoanalyze/c/performance/cost_test.c, loop0_bad, 2, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 1103, O(1), degree = 0]

@ -117,6 +117,6 @@ public class Cost_test {
return 0;
}
// Cost: 0
private static void zeroCostFunction() {}
// Cost: 1
private static void unitCostFunction() {}
}

Loading…
Cancel
Save