diff options
Diffstat (limited to 'test/emcc_hello_world.wast')
-rw-r--r-- | test/emcc_hello_world.wast | 296 |
1 files changed, 183 insertions, 113 deletions
diff --git a/test/emcc_hello_world.wast b/test/emcc_hello_world.wast index ace99ae01..400dddad2 100644 --- a/test/emcc_hello_world.wast +++ b/test/emcc_hello_world.wast @@ -3,6 +3,24 @@ (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$vi (func (param i32))) + (import $abort "env" "abort" ) + (import $nullFunc_ii "env" "nullFunc_ii" (param i32)) + (import $nullFunc_iiii "env" "nullFunc_iiii" (param i32)) + (import $nullFunc_vi "env" "nullFunc_vi" (param i32)) + (import $_pthread_cleanup_pop "env" "_pthread_cleanup_pop" (param i32)) + (import $___lock "env" "___lock" (param i32)) + (import $_pthread_self "env" "_pthread_self" (result i32)) + (import $_abort "env" "_abort" ) + (import $___syscall6 "env" "___syscall6" (param i32 i32) (result i32)) + (import $_sbrk "env" "_sbrk" (param i32) (result i32)) + (import $_time "env" "_time" (param i32) (result i32)) + (import $_emscripten_memcpy_big "env" "_emscripten_memcpy_big" (param i32 i32 i32) (result i32)) + (import $___syscall54 "env" "___syscall54" (param i32 i32) (result i32)) + (import $___unlock "env" "___unlock" (param i32)) + (import $___syscall140 "env" "___syscall140" (param i32 i32) (result i32)) + (import $_pthread_cleanup_push "env" "_pthread_cleanup_push" (param i32 i32)) + (import $_sysconf "env" "_sysconf" (param i32) (result i32)) + (import $___syscall146 "env" "___syscall146" (param i32 i32) (result i32)) (import $f64-to-int "asm2wasm" "f64-to-int" (param f64) (result i32)) (export "_i64Subtract" $_i64Subtract) (export "_free" $_free) @@ -65,7 +83,7 @@ (i32.const 16) ) ) - (nop) + (call_import $abort) ) (get_local $ret) ) @@ -317,7 +335,7 @@ (i32.const 16) ) ) - (nop) + (call_import $abort) ) (set_local $$vararg_buffer (get_local $sp) @@ -811,7 +829,7 @@ ) (block (set_local $$call$i - (i32.const 0) + (call_import $_pthread_self) ) (set_local $$errno_ptr (i32.add @@ -864,7 +882,7 @@ (i32.const 16) ) ) - (nop) + (call_import $abort) ) (set_local $$vararg_buffer (get_local $sp) @@ -885,7 +903,10 @@ (get_local $$0) ) (set_local $$call - (i32.const 0) + (call_import $___syscall6 + (i32.const 6) + (get_local $$vararg_buffer) + ) ) (set_local $$call1 (call $___syscall_ret @@ -940,7 +961,7 @@ (i32.const 16) ) ) - (nop) + (call_import $abort) ) (set_local $$vararg_buffer (get_local $sp) @@ -1017,7 +1038,10 @@ (get_local $$tio) ) (set_local $$call - (i32.const 0) + (call_import $___syscall54 + (i32.const 54) + (get_local $$vararg_buffer) + ) ) (set_local $$tobool2 (i32.eq @@ -1099,7 +1123,7 @@ (i32.const 16) ) ) - (nop) + (call_import $abort) ) (set_local $$vararg_buffer (get_local $sp) @@ -1166,7 +1190,10 @@ (get_local $$whence) ) (set_local $$call - (i32.const 0) + (call_import $___syscall140 + (i32.const 140) + (get_local $$vararg_buffer) + ) ) (set_local $$call1 (call $___syscall_ret @@ -1295,7 +1322,9 @@ ) ) ) - (nop) + (call_import $___lock + (i32.const 44) + ) (set_local $$f$addr$0$19 (i32.load align=4 (i32.const 40) @@ -1464,7 +1493,9 @@ ) ) ) - (nop) + (call_import $___unlock + (i32.const 44) + ) (set_local $$retval$0 (get_local $$r$0$lcssa) ) @@ -1571,7 +1602,7 @@ (i32.const 16) ) ) - (nop) + (call_import $abort) ) (set_local $$ap (get_local $sp) @@ -1720,7 +1751,7 @@ (i32.const 16) ) ) - (nop) + (call_import $abort) ) (set_local $$vararg_buffer3 (i32.add @@ -1872,7 +1903,10 @@ (get_local $$iovcnt$0) ) (set_local $$call9 - (i32.const 0) + (call_import $___syscall146 + (i32.const 146) + (get_local $$vararg_buffer3) + ) ) (set_local $$call10 (call $___syscall_ret @@ -1884,7 +1918,10 @@ ) ) (block - (nop) + (call_import $_pthread_cleanup_push + (i32.const 5) + (get_local $$f) + ) (set_local $$3 (i32.load align=4 (get_local $$fd8) @@ -1915,14 +1952,19 @@ (get_local $$iovcnt$0) ) (set_local $$call - (i32.const 0) + (call_import $___syscall146 + (i32.const 146) + (get_local $$vararg_buffer) + ) ) (set_local $$call7 (call $___syscall_ret (get_local $$call) ) ) - (nop) + (call_import $_pthread_cleanup_pop + (i32.const 0) + ) (set_local $$cnt$0 (get_local $$call7) ) @@ -2358,7 +2400,7 @@ (i32.const 16) ) ) - (nop) + (call_import $abort) ) (set_local $$ap2 (i32.add @@ -5875,7 +5917,7 @@ (i32.const 16) ) ) - (nop) + (call_import $abort) ) (set_local $$big$i (i32.add @@ -16648,7 +16690,7 @@ (i32.const 16) ) ) - (nop) + (call_import $abort) ) (set_local $$pad (get_local $sp) @@ -18240,7 +18282,7 @@ ) (if (get_local $$cmp15) - (nop) + (call_import $_abort) ) (set_local $$bk (i32.add @@ -18273,7 +18315,7 @@ (br $do-once$1 ) ) - (nop) + (call_import $_abort) ) ) ) @@ -18628,7 +18670,7 @@ ) (if (get_local $$cmp76) - (nop) + (call_import $_abort) ) (set_local $$bk78 (i32.add @@ -18669,7 +18711,7 @@ (br $do-once$2 ) ) - (nop) + (call_import $_abort) ) ) ) @@ -18852,7 +18894,7 @@ ) (if_else (get_local $$cmp113) - (nop) + (call_import $_abort) (block (set_local $$$pre$phiZ2D (get_local $$16) @@ -19256,7 +19298,7 @@ ) (if (get_local $$cmp33$i) - (nop) + (call_import $_abort) ) (set_local $$add$ptr$i (i32.add @@ -19281,7 +19323,7 @@ (get_local $$cmp35$i) (i32.const 0) ) - (nop) + (call_import $_abort) ) (set_local $$parent$i (i32.add @@ -19469,7 +19511,7 @@ ) (if_else (get_local $$cmp81$i) - (nop) + (call_import $_abort) (block (i32.store align=4 (get_local $$RP$1$i$lcssa) @@ -19509,7 +19551,7 @@ ) (if (get_local $$cmp45$i) - (nop) + (call_import $_abort) ) (set_local $$bk47$i (i32.add @@ -19533,7 +19575,7 @@ (get_local $$cmp48$i) (i32.const 0) ) - (nop) + (call_import $_abort) ) (set_local $$fd50$i (i32.add @@ -19569,7 +19611,7 @@ (br $do-once$5 ) ) - (nop) + (call_import $_abort) ) ) ) @@ -19686,7 +19728,7 @@ ) (if (get_local $$cmp107$i) - (nop) + (call_import $_abort) ) (set_local $$arrayidx113$i (i32.add @@ -19756,7 +19798,7 @@ ) (if (get_local $$cmp130$i) - (nop) + (call_import $_abort) ) (set_local $$parent135$i (i32.add @@ -19806,7 +19848,7 @@ ) (if_else (get_local $$cmp142$i) - (nop) + (call_import $_abort) (block (set_local $$arrayidx148$i (i32.add @@ -19877,7 +19919,7 @@ ) (if_else (get_local $$cmp159$i) - (nop) + (call_import $_abort) (block (set_local $$arrayidx165$i (i32.add @@ -20136,7 +20178,7 @@ ) (if_else (get_local $$cmp208$i) - (nop) + (call_import $_abort) (block (set_local $$$pre$phi$iZ2D (get_local $$48) @@ -21190,7 +21232,7 @@ ) (if (get_local $$cmp121$i) - (nop) + (call_import $_abort) ) (set_local $$add$ptr$i$161 (i32.add @@ -21215,7 +21257,7 @@ (get_local $$cmp123$i) (i32.const 0) ) - (nop) + (call_import $_abort) ) (set_local $$parent$i$162 (i32.add @@ -21403,7 +21445,7 @@ ) (if_else (get_local $$cmp171$i) - (nop) + (call_import $_abort) (block (i32.store align=4 (get_local $$RP$1$i$167$lcssa) @@ -21443,7 +21485,7 @@ ) (if (get_local $$cmp133$i) - (nop) + (call_import $_abort) ) (set_local $$bk136$i (i32.add @@ -21467,7 +21509,7 @@ (get_local $$cmp137$i) (i32.const 0) ) - (nop) + (call_import $_abort) ) (set_local $$fd139$i (i32.add @@ -21503,7 +21545,7 @@ (br $do-once$14 ) ) - (nop) + (call_import $_abort) ) ) ) @@ -21620,7 +21662,7 @@ ) (if (get_local $$cmp198$i) - (nop) + (call_import $_abort) ) (set_local $$arrayidx204$i (i32.add @@ -21690,7 +21732,7 @@ ) (if (get_local $$cmp221$i) - (nop) + (call_import $_abort) ) (set_local $$parent226$i (i32.add @@ -21740,7 +21782,7 @@ ) (if_else (get_local $$cmp233$i) - (nop) + (call_import $_abort) (block (set_local $$arrayidx239$i (i32.add @@ -21811,7 +21853,7 @@ ) (if_else (get_local $$cmp250$i) - (nop) + (call_import $_abort) (block (set_local $$arrayidx256$i (i32.add @@ -22061,7 +22103,7 @@ ) (if_else (get_local $$cmp301$i) - (nop) + (call_import $_abort) (block (set_local $$$pre$phi$i$178Z2D (get_local $$83) @@ -22562,7 +22604,7 @@ ) (if_else (get_local $$cmp401$i) - (nop) + (call_import $_abort) (block (i32.store align=4 (get_local $$arrayidx394$i$lcssa) @@ -22705,7 +22747,7 @@ (br $do-once$19 ) ) - (nop) + (call_import $_abort) ) ) ) @@ -23017,7 +23059,9 @@ (get_local $$cmp$i$179) (block (set_local $$call$i$i - (i32.const 0) + (call_import $_sysconf + (i32.const 30) + ) ) (set_local $$sub$i$i (i32.add @@ -23065,7 +23109,9 @@ (i32.const 0) ) (set_local $$call6$i$i - (i32.const 0) + (call_import $_time + (i32.const 0) + ) ) (set_local $$xor$i$i (i32.and @@ -23086,7 +23132,7 @@ (br $do-once$22 ) ) - (nop) + (call_import $_abort) ) ) ) @@ -23396,7 +23442,9 @@ (get_local $$cmp81$i$191) (block (set_local $$call83$i - (i32.const 0) + (call_import $_sbrk + (get_local $$and80$i) + ) ) (set_local $$113 (i32.load align=4 @@ -23474,7 +23522,9 @@ ) (block (set_local $$call37$i - (i32.const 0) + (call_import $_sbrk + (i32.const 0) + ) ) (set_local $$cmp38$i (i32.eq @@ -23651,7 +23701,9 @@ ) ) (set_local $$call68$i - (i32.const 0) + (call_import $_sbrk + (get_local $$ssize$0$i) + ) ) (set_local $$cmp69$i (i32.eq @@ -23791,7 +23843,9 @@ (get_local $$cmp105$i) (block (set_local $$call107$i - (i32.const 0) + (call_import $_sbrk + (get_local $$and104$i) + ) ) (set_local $$cmp108$i (i32.eq @@ -23802,7 +23856,9 @@ (if_else (get_local $$cmp108$i) (block - (i32.const 0) + (call_import $_sbrk + (get_local $$sub112$i) + ) (br $label$break$L279 ) ) @@ -23902,10 +23958,14 @@ (get_local $$cmp127$i) (block (set_local $$call131$i - (i32.const 0) + (call_import $_sbrk + (get_local $$and11$i) + ) ) (set_local $$call132$i - (i32.const 0) + (call_import $_sbrk + (i32.const 0) + ) ) (set_local $$cmp133$i$196 (i32.ne @@ -25081,7 +25141,7 @@ ) (if (get_local $$cmp42$i$i) - (nop) + (call_import $_abort) ) (set_local $$bk43$i$i (i32.add @@ -25105,7 +25165,7 @@ (br $do-once$35 ) ) - (nop) + (call_import $_abort) ) ) ) @@ -25184,7 +25244,7 @@ ) (if (get_local $$cmp57$i$i) - (nop) + (call_import $_abort) ) (set_local $$fd59$i$i (i32.add @@ -25213,7 +25273,7 @@ ) ) ) - (nop) + (call_import $_abort) ) ) ) @@ -25419,7 +25479,7 @@ ) (if_else (get_local $$cmp112$i$i) - (nop) + (call_import $_abort) (block (i32.store align=4 (get_local $$RP$1$i$i$lcssa) @@ -25459,7 +25519,7 @@ ) (if (get_local $$cmp81$i$i) - (nop) + (call_import $_abort) ) (set_local $$bk82$i$i (i32.add @@ -25483,7 +25543,7 @@ (get_local $$cmp83$i$i) (i32.const 0) ) - (nop) + (call_import $_abort) ) (set_local $$fd85$i$i (i32.add @@ -25519,7 +25579,7 @@ (br $do-once$37 ) ) - (nop) + (call_import $_abort) ) ) ) @@ -25638,7 +25698,7 @@ ) (if (get_local $$cmp137$i$i) - (nop) + (call_import $_abort) ) (set_local $$arrayidx143$i$i (i32.add @@ -25709,7 +25769,7 @@ ) (if (get_local $$cmp160$i$i) - (nop) + (call_import $_abort) ) (set_local $$parent165$i$i (i32.add @@ -25759,7 +25819,7 @@ ) (if_else (get_local $$cmp172$i$i) - (nop) + (call_import $_abort) (block (set_local $$arrayidx178$i$i (i32.add @@ -25829,7 +25889,7 @@ ) (if_else (get_local $$cmp189$i$i) - (nop) + (call_import $_abort) (block (set_local $$arrayidx195$i$i (i32.add @@ -26061,7 +26121,7 @@ ) ) ) - (nop) + (call_import $_abort) ) ) ) @@ -26558,7 +26618,7 @@ ) (if_else (get_local $$cmp332$i$i) - (nop) + (call_import $_abort) (block (i32.store align=4 (get_local $$arrayidx325$i$i$lcssa) @@ -26701,7 +26761,7 @@ (br $do-once$34 ) ) - (nop) + (call_import $_abort) ) ) ) @@ -27289,7 +27349,7 @@ ) (if_else (get_local $$cmp46$i$i) - (nop) + (call_import $_abort) (block (set_local $$$pre$phi$i$iZ2D (get_local $$196) @@ -27784,7 +27844,7 @@ ) (if_else (get_local $$cmp133$i$i) - (nop) + (call_import $_abort) (block (i32.store align=4 (get_local $$arrayidx126$i$i$lcssa) @@ -27927,7 +27987,7 @@ (br $do-once$27 ) ) - (nop) + (call_import $_abort) ) ) ) @@ -28439,7 +28499,7 @@ ) (if (get_local $$cmp1) - (nop) + (call_import $_abort) ) (set_local $$head (i32.add @@ -28466,7 +28526,7 @@ ) (if (get_local $$cmp2) - (nop) + (call_import $_abort) ) (set_local $$and5 (i32.and @@ -28544,7 +28604,7 @@ ) (if (get_local $$cmp18) - (nop) + (call_import $_abort) ) (set_local $$3 (i32.load align=4 @@ -28724,7 +28784,7 @@ ) (if (get_local $$cmp31) - (nop) + (call_import $_abort) ) (set_local $$bk34 (i32.add @@ -28748,7 +28808,7 @@ (get_local $$cmp35) (i32.const 0) ) - (nop) + (call_import $_abort) ) ) ) @@ -28832,7 +28892,7 @@ ) (if (get_local $$cmp53) - (nop) + (call_import $_abort) ) (set_local $$fd56 (i32.add @@ -28856,7 +28916,7 @@ (set_local $$fd67$pre$phiZ2D (get_local $$fd56) ) - (nop) + (call_import $_abort) ) ) ) @@ -29070,7 +29130,7 @@ ) (if_else (get_local $$cmp118) - (nop) + (call_import $_abort) (block (i32.store align=4 (get_local $$RP$1$lcssa) @@ -29110,7 +29170,7 @@ ) (if (get_local $$cmp80) - (nop) + (call_import $_abort) ) (set_local $$bk82 (i32.add @@ -29134,7 +29194,7 @@ (get_local $$cmp83) (i32.const 0) ) - (nop) + (call_import $_abort) ) (set_local $$fd86 (i32.add @@ -29170,7 +29230,7 @@ (br $do-once$1 ) ) - (nop) + (call_import $_abort) ) ) ) @@ -29297,7 +29357,7 @@ ) (if (get_local $$cmp143) - (nop) + (call_import $_abort) ) (set_local $$arrayidx149 (i32.add @@ -29375,7 +29435,7 @@ ) (if (get_local $$cmp165) - (nop) + (call_import $_abort) ) (set_local $$parent170 (i32.add @@ -29425,7 +29485,7 @@ ) (if_else (get_local $$cmp176) - (nop) + (call_import $_abort) (block (set_local $$arrayidx182 (i32.add @@ -29501,7 +29561,7 @@ ) (if_else (get_local $$cmp192) - (nop) + (call_import $_abort) (block (set_local $$arrayidx198 (i32.add @@ -29565,7 +29625,7 @@ (get_local $$cmp228) (i32.const 0) ) - (nop) + (call_import $_abort) ) (set_local $$head231 (i32.add @@ -29592,7 +29652,7 @@ ) (if (get_local $$tobool233) - (nop) + (call_import $_abort) ) (set_local $$and240 (i32.and @@ -29851,7 +29911,7 @@ ) (if (get_local $$cmp283) - (nop) + (call_import $_abort) ) (set_local $$bk286 (i32.add @@ -29875,7 +29935,7 @@ (get_local $$cmp287) (i32.const 0) ) - (nop) + (call_import $_abort) ) ) ) @@ -29958,7 +30018,7 @@ ) (if (get_local $$cmp308) - (nop) + (call_import $_abort) ) (set_local $$fd311 (i32.add @@ -29982,7 +30042,7 @@ (set_local $$fd322$pre$phiZ2D (get_local $$fd311) ) - (nop) + (call_import $_abort) ) ) ) @@ -30193,7 +30253,7 @@ ) (if_else (get_local $$cmp386) - (nop) + (call_import $_abort) (block (i32.store align=4 (get_local $$RP360$1$lcssa) @@ -30238,7 +30298,7 @@ ) (if (get_local $$cmp340) - (nop) + (call_import $_abort) ) (set_local $$bk343 (i32.add @@ -30262,7 +30322,7 @@ (get_local $$cmp344) (i32.const 0) ) - (nop) + (call_import $_abort) ) (set_local $$fd347 (i32.add @@ -30298,7 +30358,7 @@ (br $do-once$6 ) ) - (nop) + (call_import $_abort) ) ) ) @@ -30414,7 +30474,7 @@ ) (if (get_local $$cmp413) - (nop) + (call_import $_abort) ) (set_local $$arrayidx419 (i32.add @@ -30484,7 +30544,7 @@ ) (if (get_local $$cmp435) - (nop) + (call_import $_abort) ) (set_local $$parent442 (i32.add @@ -30534,7 +30594,7 @@ ) (if_else (get_local $$cmp448) - (nop) + (call_import $_abort) (block (set_local $$arrayidx454 (i32.add @@ -30605,7 +30665,7 @@ ) (if_else (get_local $$cmp464) - (nop) + (call_import $_abort) (block (set_local $$arrayidx470 (i32.add @@ -30845,7 +30905,7 @@ ) (if_else (get_local $$cmp519) - (nop) + (call_import $_abort) (block (set_local $$$pre$phiZ2D (get_local $$63) @@ -31345,7 +31405,7 @@ ) (if_else (get_local $$cmp605) - (nop) + (call_import $_abort) (block (i32.store align=4 (get_local $$arrayidx599$lcssa) @@ -31488,7 +31548,7 @@ (br $do-once$10 ) ) - (nop) + (call_import $_abort) ) ) ) @@ -31948,7 +32008,11 @@ (i32.const 4096) ) (br $topmost - (i32.const 0) + (call_import $_emscripten_memcpy_big + (get_local $dest) + (get_local $src) + (get_local $num) + ) ) ) (set_local $ret @@ -34243,17 +34307,23 @@ ) (func $b0 (param $p0 i32) (result i32) (block $topmost - (nop) + (call_import $nullFunc_ii + (i32.const 0) + ) (i32.const 0) ) ) (func $b1 (param $p0 i32) (param $p1 i32) (param $p2 i32) (result i32) (block $topmost - (nop) + (call_import $nullFunc_iiii + (i32.const 1) + ) (i32.const 0) ) ) (func $b2 (param $p0 i32) - (nop) + (call_import $nullFunc_vi + (i32.const 2) + ) ) ) |