while-do.wast 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. (module
  2. (type $t0 (func))
  3. (type $t1 (func (param i32)))
  4. (type $t2 (func (param i32 i32)))
  5. (type $t3 (func (param i32 i32 i32)))
  6. (type $t4 (func (result i32)))
  7. (type $t5 (func (result i64)))
  8. (type $t6 (func (param i32) (result i32)))
  9. (type $t7 (func (param i32 i32) (result i32)))
  10. (type $t8 (func (param i32) (result i64)))
  11. (type $t9 (func (param f32) (result i32)))
  12. (type $t10 (func (param f64) (result i32)))
  13. (type $t11 (func (param i32 i64)))
  14. (type $t12 (func (param i64 i32)))
  15. (type $t13 (func (param i64 i32) (result i32)))
  16. (type $t14 (func (param i64 i32) (result i64)))
  17. (type $t15 (func (param f32 i32)))
  18. (type $t16 (func (param i32 i32 i32) (result i32)))
  19. (type $t17 (func (param i64 i32 i32)))
  20. (type $t18 (func (param i32 i64 i32)))
  21. (type $t19 (func (param i32 i64 i32) (result i32)))
  22. (type $t20 (func (param i32 i64 i64 i32) (result i32)))
  23. (import "e" "instr_F4" (func $e.instr_F4 (type $t0)))
  24. (import "e" "trigger_fault_end_jit" (func $e.trigger_fault_end_jit (type $t0)))
  25. (import "e" "m" (memory {normalised output}))
  26. (func $f (export "f") (type $t1) (param $p0 i32)
  27. (local $l0 i32) (local $l1 i32) (local $l2 i32) (local $l3 i32) (local $l4 i32) (local $l5 i32) (local $l6 i32) (local $l7 i32) (local $l8 i32)
  28. (set_local $l0
  29. (i32.load
  30. (i32.const 64)))
  31. (set_local $l1
  32. (i32.load
  33. (i32.const 68)))
  34. (set_local $l2
  35. (i32.load
  36. (i32.const 72)))
  37. (set_local $l3
  38. (i32.load
  39. (i32.const 76)))
  40. (set_local $l4
  41. (i32.load
  42. (i32.const 80)))
  43. (set_local $l5
  44. (i32.load
  45. (i32.const 84)))
  46. (set_local $l6
  47. (i32.load
  48. (i32.const 88)))
  49. (set_local $l7
  50. (i32.load
  51. (i32.const 92)))
  52. (set_local $l8
  53. (i32.const 0))
  54. (block $B0
  55. (block $B1
  56. (loop $L2
  57. (br_if $B0
  58. (i32.ge_u
  59. (get_local $l8)
  60. (i32.const 100003)))
  61. (block $B3
  62. (block $B4
  63. )
  64. (block $B5
  65. (loop $L6
  66. (i32.store
  67. (i32.const 556)
  68. (i32.or
  69. (i32.and
  70. (i32.load
  71. (i32.const 556))
  72. (i32.const -4096))
  73. (i32.const 0)))
  74. (br_if $B0
  75. (i32.ge_u
  76. (get_local $l8)
  77. (i32.const 100003)))
  78. (set_local $l8
  79. (i32.add
  80. (get_local $l8)
  81. (i32.const 2)))
  82. (i32.store
  83. (i32.const 112)
  84. (i32.sub
  85. (get_local $l0)
  86. (i32.const 10)))
  87. (i32.store
  88. (i32.const 104)
  89. (get_local $l0))
  90. (i64.store
  91. (i32.const 96)
  92. (i64.const -9223362325933719521))
  93. (br_if $B5
  94. (i32.eq
  95. (get_local $l0)
  96. (i32.const 10)))
  97. (set_local $l8
  98. (i32.add
  99. (get_local $l8)
  100. (i32.const 2)))
  101. (i32.store
  102. (i32.const 104)
  103. (get_local $l3))
  104. (set_local $l3
  105. (i32.add
  106. (get_local $l3)
  107. (i32.const 1)))
  108. (i32.store
  109. (i32.const 112)
  110. (get_local $l3))
  111. (i64.store
  112. (i32.const 96)
  113. (i64.const 9710921056287))
  114. (br $L6)))
  115. (set_local $l8
  116. (i32.add
  117. (get_local $l8)
  118. (i32.const 1)))
  119. (i32.store
  120. (i32.const 560)
  121. (i32.or
  122. (i32.and
  123. (i32.load
  124. (i32.const 556))
  125. (i32.const -4096))
  126. (i32.const 10)))
  127. (i32.store
  128. (i32.const 556)
  129. (i32.or
  130. (i32.and
  131. (i32.load
  132. (i32.const 556))
  133. (i32.const -4096))
  134. (i32.const 11)))
  135. (i32.store
  136. (i32.const 64)
  137. (get_local $l0))
  138. (i32.store
  139. (i32.const 68)
  140. (get_local $l1))
  141. (i32.store
  142. (i32.const 72)
  143. (get_local $l2))
  144. (i32.store
  145. (i32.const 76)
  146. (get_local $l3))
  147. (i32.store
  148. (i32.const 80)
  149. (get_local $l4))
  150. (i32.store
  151. (i32.const 84)
  152. (get_local $l5))
  153. (i32.store
  154. (i32.const 88)
  155. (get_local $l6))
  156. (i32.store
  157. (i32.const 92)
  158. (get_local $l7))
  159. (call $e.instr_F4)
  160. (set_local $l0
  161. (i32.load
  162. (i32.const 64)))
  163. (set_local $l1
  164. (i32.load
  165. (i32.const 68)))
  166. (set_local $l2
  167. (i32.load
  168. (i32.const 72)))
  169. (set_local $l3
  170. (i32.load
  171. (i32.const 76)))
  172. (set_local $l4
  173. (i32.load
  174. (i32.const 80)))
  175. (set_local $l5
  176. (i32.load
  177. (i32.const 84)))
  178. (set_local $l6
  179. (i32.load
  180. (i32.const 88)))
  181. (set_local $l7
  182. (i32.load
  183. (i32.const 92)))
  184. (br $B0))
  185. (unreachable)))
  186. (i32.store
  187. (i32.const 64)
  188. (get_local $l0))
  189. (i32.store
  190. (i32.const 68)
  191. (get_local $l1))
  192. (i32.store
  193. (i32.const 72)
  194. (get_local $l2))
  195. (i32.store
  196. (i32.const 76)
  197. (get_local $l3))
  198. (i32.store
  199. (i32.const 80)
  200. (get_local $l4))
  201. (i32.store
  202. (i32.const 84)
  203. (get_local $l5))
  204. (i32.store
  205. (i32.const 88)
  206. (get_local $l6))
  207. (i32.store
  208. (i32.const 92)
  209. (get_local $l7))
  210. (call $e.trigger_fault_end_jit)
  211. (i32.store
  212. (i32.const 664)
  213. (i32.add
  214. (i32.load
  215. (i32.const 664))
  216. (get_local $l8)))
  217. (return))
  218. (i32.store
  219. (i32.const 64)
  220. (get_local $l0))
  221. (i32.store
  222. (i32.const 68)
  223. (get_local $l1))
  224. (i32.store
  225. (i32.const 72)
  226. (get_local $l2))
  227. (i32.store
  228. (i32.const 76)
  229. (get_local $l3))
  230. (i32.store
  231. (i32.const 80)
  232. (get_local $l4))
  233. (i32.store
  234. (i32.const 84)
  235. (get_local $l5))
  236. (i32.store
  237. (i32.const 88)
  238. (get_local $l6))
  239. (i32.store
  240. (i32.const 92)
  241. (get_local $l7))
  242. (i32.store
  243. (i32.const 664)
  244. (i32.add
  245. (i32.load
  246. (i32.const 664))
  247. (get_local $l8)))))