mirror of
https://github.com/tc39/test262.git
synced 2025-05-02 22:10:34 +02:00
* [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time)
31 lines
977 B
JavaScript
31 lines
977 B
JavaScript
var hasBasicBlockExecuted = $vm.hasBasicBlockExecuted;
|
|
|
|
load("./driver/driver.js");
|
|
|
|
var a, b, c;
|
|
function testSwitch(s) {
|
|
switch (s) {
|
|
case "foo":
|
|
return a;
|
|
case "bar":
|
|
return b;
|
|
default:
|
|
return c;
|
|
}
|
|
}
|
|
|
|
assert(!hasBasicBlockExecuted(testSwitch, "switch"), "should not have executed yet.");
|
|
|
|
testSwitch("foo");
|
|
assert(hasBasicBlockExecuted(testSwitch, "switch"), "should have executed.");
|
|
assert(hasBasicBlockExecuted(testSwitch, "return a"), "should have executed.");
|
|
assert(!hasBasicBlockExecuted(testSwitch, "return b"), "should not have executed yet.");
|
|
assert(!hasBasicBlockExecuted(testSwitch, "return c"), "should not have executed yet.");
|
|
|
|
testSwitch("bar");
|
|
assert(hasBasicBlockExecuted(testSwitch, "return b"), "should have executed.");
|
|
assert(!hasBasicBlockExecuted(testSwitch, "return c"), "should not have executed yet.");
|
|
|
|
testSwitch("");
|
|
assert(hasBasicBlockExecuted(testSwitch, "return c"), "should have executed.");
|