diff options
-rw-r--r-- | bench/ScalarBench.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bench/ScalarBench.cpp b/bench/ScalarBench.cpp index fe14251b65..c03f9ca9d7 100644 --- a/bench/ScalarBench.cpp +++ b/bench/ScalarBench.cpp @@ -112,7 +112,9 @@ protected: virtual void performTest() SK_OVERRIDE { int sum = 0; for (size_t i = 0; i < ARRAY_N; ++i) { - sum += SkScalarIsFinite(fArray[i]); + // We pass -fArray[i], so the compiler can't cheat and treat the + // value as an int (even though we tell it that it is a float) + sum += SkScalarIsFinite(-fArray[i]); } // we do this so the compiler won't optimize our loop away... this->doSomething(fArray, sum); |