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)
59 lines
1.9 KiB
JavaScript
59 lines
1.9 KiB
JavaScript
var hasBasicBlockExecuted = $vm.hasBasicBlockExecuted;
|
|
|
|
load("./driver/driver.js");
|
|
|
|
var a, b, c, d;
|
|
|
|
function testIf(x) {
|
|
if (x > 10 && x < 20) {
|
|
return a;
|
|
} else if (x > 20 && x < 30) {
|
|
return b;
|
|
} else if (x > 30 && x < 40) {
|
|
return c;
|
|
} else {
|
|
return d;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
function noMatches(x) {
|
|
if (x > 10 && x < 20) {
|
|
return a;
|
|
} else if (x > 20 && x < 30) {
|
|
return b;
|
|
} else {
|
|
return c;
|
|
}
|
|
}
|
|
|
|
assert(!hasBasicBlockExecuted(testIf, "return a"), "should not have executed yet.");
|
|
assert(!hasBasicBlockExecuted(testIf, "return b"), "should not have executed yet.");
|
|
assert(!hasBasicBlockExecuted(testIf, "return c"), "should not have executed yet.");
|
|
assert(!hasBasicBlockExecuted(testIf, "return d"), "should not have executed yet.");
|
|
|
|
testIf(11);
|
|
assert(hasBasicBlockExecuted(testIf, "return a"), "should have executed.");
|
|
assert(hasBasicBlockExecuted(testIf, "x > 10"), "should have executed.");
|
|
assert(!hasBasicBlockExecuted(testIf, "return b"), "should not have executed yet.");
|
|
|
|
testIf(21);
|
|
assert(hasBasicBlockExecuted(testIf, "return b"), "should have executed.");
|
|
assert(!hasBasicBlockExecuted(testIf, "return c"), "should not have executed yet.");
|
|
|
|
testIf(31);
|
|
assert(hasBasicBlockExecuted(testIf, "return c"), "should have executed.");
|
|
assert(!hasBasicBlockExecuted(testIf, "return d"), "should not have executed yet.");
|
|
|
|
testIf(0);
|
|
assert(hasBasicBlockExecuted(testIf, "return d"), "should have executed.");
|
|
|
|
|
|
noMatches(0);
|
|
assert(!hasBasicBlockExecuted(noMatches, "return a"), "should not have executed yet.");
|
|
assert(hasBasicBlockExecuted(noMatches, "x > 10"), "should have executed.");
|
|
assert(!hasBasicBlockExecuted(noMatches, "return b"), "should not have executed yet.");
|
|
assert(hasBasicBlockExecuted(noMatches, "x > 20"), "should have executed.");
|
|
assert(hasBasicBlockExecuted(noMatches, "return c"), "should have executed.");
|