X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/2d39b0e377c0896910ee49ae70082ba665faf986..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/tests/controlFlowProfiler/driver/driver.js?ds=inline diff --git a/tests/controlFlowProfiler/driver/driver.js b/tests/controlFlowProfiler/driver/driver.js new file mode 100644 index 0000000..7a71779 --- /dev/null +++ b/tests/controlFlowProfiler/driver/driver.js @@ -0,0 +1,14 @@ +function assert(condition, reason) { + if (!condition) + throw new Error(reason); +} + +var ShouldHaveExecuted = true; +var ShouldNotHaveExecuted = false; + +function checkBasicBlock(func, expr, expectation) { + if (expectation === ShouldHaveExecuted) + assert(hasBasicBlockExecuted(func, expr, "should have executed")); + else + assert(!hasBasicBlockExecuted(func, expr, "should not have executed")); +}