aboutsummaryrefslogtreecommitdiff
path: root/tools/test-js-optimizer.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/test-js-optimizer.js')
-rw-r--r--tools/test-js-optimizer.js75
1 files changed, 73 insertions, 2 deletions
diff --git a/tools/test-js-optimizer.js b/tools/test-js-optimizer.js
index 0665462b..8c2ad183 100644
--- a/tools/test-js-optimizer.js
+++ b/tools/test-js-optimizer.js
@@ -88,5 +88,76 @@ function maths() {
check(90+3+2);
__ZN6b2Vec2C1Ev(((((((($this1 + 20 | 0 | 0) + 8 | 0) + 8 | 0) + 8 | 0) + 8 | 0) + 8 | 0) + 8 | 0) + 8 | 0);
}
-// EMSCRIPTEN_GENERATED_FUNCTIONS: ["abc", "xyz", "xyz2", "expr", "loopy", "bits", "maths"]
-
+function hoisting() {
+ if ($i < $N) {
+ __label__ = 2;
+ }
+ if (__label__ == 2) {
+ callOther();
+ }
+// ok /*
+ pause(1);
+ if ($i < $N) {
+ __label__ = 2;
+ } else {
+ __label__ = 3;
+ }
+ $for_body3$$for_end$5 : do {
+ if (__label__ == 2) {
+ while(true) { break $for_body3$$for_end$5 }
+ callOther();
+ }
+ } while (0);
+ pause(2);
+ if ($i < $N) {
+ __label__ = 2;
+ } else {
+ __label__ = 3;
+ }
+ cheez: do {
+ if (__label__ == 2) {
+ if (callOther()) break cheez;
+ }
+ } while (0);
+ pause(3);
+ if ($i < $N) {
+ __label__ = 2;
+ } else {
+ __label__ = 3;
+ }
+ if (__label__ == 2) {
+ callOther();
+ }
+ pause(4);
+ if ($i < $N) {
+ __label__ = 2;
+ } else {
+ __label__ = 3;
+ }
+ if (__label__ == 2) {
+ callOther();
+ } else if (__label__ == 3) {
+ somethingElse();
+ }
+ pause(5);
+ if ($i < $N) {
+ __label__ = 2;
+ } else {
+ __label__ = 3;
+ }
+ if (__label__ == 55) {
+ callOther();
+ } else if (__label__ == 3) {
+ somethingElse();
+ }
+ pause(6);
+ if ($i < $N) {
+ __label__ = 2;
+ } else {
+ __label__ = 3;
+ }
+ if (__label__ == 3) {
+ somethingElse();
+ }
+}
+// EMSCRIPTEN_GENERATED_FUNCTIONS: ["abc", "xyz", "xyz2", "expr", "loopy", "bits", "maths", "hoisting"]