]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/controlFlowProfiler/if-statement.js
1 load("./driver/driver.js");
6 if (x
> 10 && x
< 20) {
8 } else if (x
> 20 && x
< 30) {
10 } else if (x
> 30 && x
< 40) {
19 function noMatches(x
) {
20 if (x
> 10 && x
< 20) {
22 } else if (x
> 20 && x
< 30) {
29 assert(!hasBasicBlockExecuted(testIf
, "return a"), "should not have executed yet.");
30 assert(!hasBasicBlockExecuted(testIf
, "return b"), "should not have executed yet.");
31 assert(!hasBasicBlockExecuted(testIf
, "return c"), "should not have executed yet.");
32 assert(!hasBasicBlockExecuted(testIf
, "return d"), "should not have executed yet.");
35 assert(hasBasicBlockExecuted(testIf
, "return a"), "should have executed.");
36 assert(hasBasicBlockExecuted(testIf
, "x > 10"), "should have executed.");
37 assert(!hasBasicBlockExecuted(testIf
, "return b"), "should not have executed yet.");
40 assert(hasBasicBlockExecuted(testIf
, "return b"), "should have executed.");
41 assert(!hasBasicBlockExecuted(testIf
, "return c"), "should not have executed yet.");
44 assert(hasBasicBlockExecuted(testIf
, "return c"), "should have executed.");
45 assert(!hasBasicBlockExecuted(testIf
, "return d"), "should not have executed yet.");
48 assert(hasBasicBlockExecuted(testIf
, "return d"), "should have executed.");
52 assert(!hasBasicBlockExecuted(noMatches
, "return a"), "should not have executed yet.");
53 assert(hasBasicBlockExecuted(noMatches
, "x > 10"), "should have executed.");
54 assert(!hasBasicBlockExecuted(noMatches
, "return b"), "should not have executed yet.");
55 assert(hasBasicBlockExecuted(noMatches
, "x > 20"), "should have executed.");
56 assert(hasBasicBlockExecuted(noMatches
, "return c"), "should have executed.");