]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tests/controlFlowProfiler/driver/driver.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / controlFlowProfiler / driver / driver.js
diff --git a/tests/controlFlowProfiler/driver/driver.js b/tests/controlFlowProfiler/driver/driver.js
new file mode 100644 (file)
index 0000000..7a71779
--- /dev/null
@@ -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"));
+}