diff --git a/tests/checked/functionimmediate_check.js b/tests/checked/functionimmediate_check.js index 02b7cc4013e05f35427e7a57e4a7251badaf6b41..8dbe970bab34cebdd19f939e8daec05564f8e095 100644 --- a/tests/checked/functionimmediate_check.js +++ b/tests/checked/functionimmediate_check.js @@ -14,7 +14,7 @@ */ //! CHECKER Checking LICM for FunctionImmediate. -//! RUN options: "--compiler-enable-jit=true --compiler-hotness-threshold=0 --compiler-profiling-threshold=0 --gc-type=g1-gc --compiler-regex _GLOBAL::test", entry: "_GLOBAL::func_main_0" +//! RUN options: "--compiler-enable-jit=true --compiler-hotness-threshold=10 --compiler-profiling-threshold=0 --gc-type=g1-gc --compiler-regex _GLOBAL::test", entry: "_GLOBAL::func_main_0" //! EVENT /Compilation,_GLOBAL::test,.*,COMPILED/ //! EVENT /Inline,_GLOBAL::test,_GLOBAL::bar,.*,SUCCESS/ //! EVENT_NOT /Deoptimization,_GLOBAL::test/ @@ -37,13 +37,24 @@ function test () { for (var i = 0; i < 20; i++) { sum += __noinline__add2(); sum += bar(); + let old_addr = getObjectAddress(bar); let gc = startGC("full"); waitForFinishGC(gc); + if (old_addr === getObjectAddress(bar)) { + throw "Object must be moved" + } sum += __noinline__add3(); } + return sum } RuntimeTesting.PrepareFunctionForOptimization(test); -test(); +let sum = test(); +if (sum != 120) { + throw "Wrong result: " + sum; +} RuntimeTesting.OptimizeFunctionOnNextCall(test); -test(); +sum = test(); +if (sum != 120) { + throw "Wrong result: " + sum; +} \ No newline at end of file