memory64_ignore_cases.patch 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008
  1. diff --git a/test/core/address.wast b/test/core/address.wast
  2. index 8e52030e..de0d0cb9 100644
  3. --- a/test/core/address.wast
  4. +++ b/test/core/address.wast
  5. @@ -210,7 +210,7 @@
  6. (assert_trap (invoke "16s_bad" (i32.const 1)) "out of bounds memory access")
  7. (assert_trap (invoke "32_bad" (i32.const 1)) "out of bounds memory access")
  8. -(assert_invalid
  9. +(assert_malformed
  10. (module quote
  11. "(memory 1)"
  12. "(func (drop (i32.load offset=4294967296 (i32.const 0))))"
  13. diff --git a/test/core/binary.wast b/test/core/binary.wast
  14. index 4090b2cd..18f66b42 100644
  15. --- a/test/core/binary.wast
  16. +++ b/test/core/binary.wast
  17. @@ -206,7 +206,7 @@
  18. )
  19. ;; Type section with signed LEB128 encoded type
  20. -(assert_malformed
  21. +(;assert_malformed
  22. (module binary
  23. "\00asm" "\01\00\00\00"
  24. "\01" ;; Type section id
  25. @@ -216,7 +216,7 @@
  26. "\00\00"
  27. )
  28. "integer representation too long"
  29. -)
  30. +;)
  31. ;; Unsigned LEB128 must not be overlong
  32. (assert_malformed
  33. @@ -1683,7 +1683,7 @@
  34. )
  35. ;; 2 elem segment declared, 1 given
  36. -(assert_malformed
  37. +(;assert_malformed
  38. (module binary
  39. "\00asm" "\01\00\00\00"
  40. "\01\04\01" ;; type section
  41. @@ -1696,7 +1696,7 @@
  42. ;; "\00\41\00\0b\01\00" ;; elem 1 (missed)
  43. )
  44. "unexpected end"
  45. -)
  46. +;)
  47. ;; 2 elem segment declared, 1.5 given
  48. (assert_malformed
  49. @@ -1813,7 +1813,7 @@
  50. )
  51. ;; 1 br_table target declared, 2 given
  52. -(assert_malformed
  53. +(;assert_malformed
  54. (module binary
  55. "\00asm" "\01\00\00\00"
  56. "\01\04\01" ;; type section
  57. @@ -1832,7 +1832,7 @@
  58. "\0b\0b\0b" ;; end
  59. )
  60. "unexpected end"
  61. -)
  62. +;)
  63. ;; Start section
  64. (module binary
  65. diff --git a/test/core/data.wast b/test/core/data.wast
  66. index 4f339bed..0b5b3e6b 100644
  67. --- a/test/core/data.wast
  68. +++ b/test/core/data.wast
  69. @@ -306,9 +306,10 @@
  70. "\02\01\41\00\0b" ;; active data segment 0 for memory 1
  71. "\00" ;; empty vec(byte)
  72. )
  73. - "unknown memory 1"
  74. + "unknown memory"
  75. )
  76. +(; not supported by wat2wasm
  77. ;; Data segment with memory index 0 (no memory section)
  78. (assert_invalid
  79. (module binary
  80. @@ -317,7 +318,7 @@
  81. "\00\41\00\0b" ;; active data segment 0 for memory 0
  82. "\00" ;; empty vec(byte)
  83. )
  84. - "unknown memory 0"
  85. + "unknown memory"
  86. )
  87. ;; Data segment with memory index 1 (no memory section)
  88. @@ -328,7 +329,7 @@
  89. "\02\01\41\00\0b" ;; active data segment 0 for memory 1
  90. "\00" ;; empty vec(byte)
  91. )
  92. - "unknown memory 1"
  93. + "unknown memory"
  94. )
  95. ;; Data segment with memory index 1 and vec(byte) as above,
  96. @@ -348,7 +349,7 @@
  97. "\20\21\22\23\24\25\26\27\28\29\2a\2b\2c\2d\2e\2f"
  98. "\30\31\32\33\34\35\36\37\38\39\3a\3b\3c\3d"
  99. )
  100. - "unknown memory 1"
  101. + "unknown memory"
  102. )
  103. ;; Data segment with memory index 1 and specially crafted vec(byte) after.
  104. @@ -368,8 +369,9 @@
  105. "\20\21\22\23\24\25\26\27\28\29\2a\2b\2c\2d\2e\2f"
  106. "\30\31\32\33\34\35\36\37\38\39\3a\3b\3c\3d"
  107. )
  108. - "unknown memory 1"
  109. + "unknown memory"
  110. )
  111. +;)
  112. ;; Invalid offsets
  113. diff --git a/test/core/elem.wast b/test/core/elem.wast
  114. index 575ecef8..dd1106c7 100644
  115. --- a/test/core/elem.wast
  116. +++ b/test/core/elem.wast
  117. @@ -562,6 +562,7 @@
  118. (assert_return (invoke $module1 "call-8") (i32.const 65))
  119. (assert_return (invoke $module1 "call-9") (i32.const 66))
  120. +(;
  121. (module $module2
  122. (type $out-i32 (func (result i32)))
  123. (import "module1" "shared-table" (table 10 funcref))
  124. @@ -574,7 +575,9 @@
  125. (assert_return (invoke $module1 "call-7") (i32.const 67))
  126. (assert_return (invoke $module1 "call-8") (i32.const 68))
  127. (assert_return (invoke $module1 "call-9") (i32.const 66))
  128. +;)
  129. +(;
  130. (module $module3
  131. (type $out-i32 (func (result i32)))
  132. (import "module1" "shared-table" (table 10 funcref))
  133. @@ -587,3 +590,4 @@
  134. (assert_return (invoke $module1 "call-7") (i32.const 67))
  135. (assert_return (invoke $module1 "call-8") (i32.const 69))
  136. (assert_return (invoke $module1 "call-9") (i32.const 70))
  137. +;)
  138. diff --git a/test/core/global.wast b/test/core/global.wast
  139. index e40a305f..8f8f25bb 100644
  140. --- a/test/core/global.wast
  141. +++ b/test/core/global.wast
  142. @@ -328,10 +328,12 @@
  143. "type mismatch"
  144. )
  145. +(;
  146. (assert_invalid
  147. (module (global (import "" "") externref) (global funcref (global.get 0)))
  148. "type mismatch"
  149. )
  150. +;)
  151. (assert_invalid
  152. (module (global (import "test" "global-i32") i32) (global i32 (global.get 0) (global.get 0)))
  153. diff --git a/test/core/if.wast b/test/core/if.wast
  154. index 2ea45f6f..b6dd5044 100644
  155. --- a/test/core/if.wast
  156. +++ b/test/core/if.wast
  157. @@ -527,11 +527,12 @@
  158. ;; Atypical folded condition syntax
  159. - (func (export "atypical-condition")
  160. - i32.const 0
  161. - (if (then) (else))
  162. - (if (i32.const 1) (i32.eqz) (then) (else))
  163. - )
  164. + ;; FIXME: uncomment me if the next wabt can compile it w/o error
  165. + ;; (func (export "atypical-condition")
  166. + ;; i32.const 0
  167. + ;; (if (then) (else))
  168. + ;; (if (i32.const 1) (i32.eqz) (then) (else))
  169. + ;; )
  170. )
  171. (assert_return (invoke "empty" (i32.const 0)))
  172. @@ -730,7 +731,7 @@
  173. (assert_return (invoke "type-use"))
  174. -(assert_return (invoke "atypical-condition"))
  175. +;; (assert_return (invoke "atypical-condition"))
  176. (assert_malformed
  177. (module quote
  178. diff --git a/test/core/imports.wast b/test/core/imports.wast
  179. index 69f76a0b..a3844c65 100644
  180. --- a/test/core/imports.wast
  181. +++ b/test/core/imports.wast
  182. @@ -572,6 +572,7 @@
  183. (assert_return (invoke "grow" (i32.const 1)) (i32.const -1))
  184. (assert_return (invoke "grow" (i32.const 0)) (i32.const 2))
  185. +(; unsupported by multi-module currently
  186. (module $Mgm
  187. (memory (export "memory") 1) ;; initial size is 1
  188. (func (export "grow") (result i32) (memory.grow (i32.const 1)))
  189. @@ -591,6 +592,7 @@
  190. (func (export "size") (result i32) (memory.size))
  191. )
  192. (assert_return (invoke $Mgim2 "size") (i32.const 3))
  193. +;)
  194. ;; Syntax errors
  195. diff --git a/test/core/linking.wast b/test/core/linking.wast
  196. index 994e0f49..d0bfb5f6 100644
  197. --- a/test/core/linking.wast
  198. +++ b/test/core/linking.wast
  199. @@ -64,6 +64,7 @@
  200. (export "Mg.set_mut" (func $set_mut))
  201. )
  202. +(;
  203. (assert_return (get $Mg "glob") (i32.const 42))
  204. (assert_return (get $Ng "Mg.glob") (i32.const 42))
  205. (assert_return (get $Ng "glob") (i32.const 43))
  206. @@ -81,6 +82,7 @@
  207. (assert_return (get $Ng "Mg.mut_glob") (i32.const 241))
  208. (assert_return (invoke $Mg "get_mut") (i32.const 241))
  209. (assert_return (invoke $Ng "Mg.get_mut") (i32.const 241))
  210. +;)
  211. (assert_unlinkable
  212. @@ -165,6 +167,7 @@
  213. )
  214. )
  215. +(;
  216. (assert_return (invoke $Mt "call" (i32.const 2)) (i32.const 4))
  217. (assert_return (invoke $Nt "Mt.call" (i32.const 2)) (i32.const 4))
  218. (assert_return (invoke $Nt "call" (i32.const 2)) (i32.const 5))
  219. @@ -187,6 +190,7 @@
  220. (assert_return (invoke $Nt "call" (i32.const 3)) (i32.const -4))
  221. (assert_trap (invoke $Nt "call" (i32.const 4)) "indirect call type mismatch")
  222. +;)
  223. (module $Ot
  224. (type (func (result i32)))
  225. @@ -201,6 +205,7 @@
  226. )
  227. )
  228. +(;
  229. (assert_return (invoke $Mt "call" (i32.const 3)) (i32.const 4))
  230. (assert_return (invoke $Nt "Mt.call" (i32.const 3)) (i32.const 4))
  231. (assert_return (invoke $Nt "call Mt.call" (i32.const 3)) (i32.const 4))
  232. @@ -225,6 +230,7 @@
  233. (assert_trap (invoke $Ot "call" (i32.const 0)) "uninitialized element")
  234. (assert_trap (invoke $Ot "call" (i32.const 20)) "undefined element")
  235. +;)
  236. (module
  237. (table (import "Mt" "tab") 0 funcref)
  238. @@ -263,6 +269,7 @@
  239. ;; Unlike in the v1 spec, active element segments stored before an
  240. ;; out-of-bounds access persist after the instantiation failure.
  241. +(;
  242. (assert_trap
  243. (module
  244. (table (import "Mt" "tab") 10 funcref)
  245. @@ -274,7 +281,9 @@
  246. )
  247. (assert_return (invoke $Mt "call" (i32.const 7)) (i32.const 0))
  248. (assert_trap (invoke $Mt "call" (i32.const 8)) "uninitialized element")
  249. +;)
  250. +(;
  251. (assert_trap
  252. (module
  253. (table (import "Mt" "tab") 10 funcref)
  254. @@ -286,6 +295,7 @@
  255. "out of bounds memory access"
  256. )
  257. (assert_return (invoke $Mt "call" (i32.const 7)) (i32.const 0))
  258. +;)
  259. (module $Mtable_ex
  260. @@ -299,6 +309,7 @@
  261. (table (import "Mtable_ex" "t-extern") 1 externref)
  262. )
  263. +(;
  264. (assert_unlinkable
  265. (module (table (import "Mtable_ex" "t-func") 1 externref))
  266. "incompatible import type"
  267. @@ -307,6 +318,7 @@
  268. (module (table (import "Mtable_ex" "t-extern") 1 funcref))
  269. "incompatible import type"
  270. )
  271. +;)
  272. ;; Memories
  273. @@ -346,10 +358,12 @@
  274. )
  275. )
  276. +(;
  277. (assert_return (invoke $Mm "load" (i32.const 12)) (i32.const 0xa7))
  278. (assert_return (invoke $Nm "Mm.load" (i32.const 12)) (i32.const 0xa7))
  279. (assert_return (invoke $Nm "load" (i32.const 12)) (i32.const 0xf2))
  280. (assert_return (invoke $Om "load" (i32.const 12)) (i32.const 0xa7))
  281. +;)
  282. (module
  283. (memory (import "Mm" "mem") 0)
  284. @@ -372,6 +386,7 @@
  285. )
  286. )
  287. +(;
  288. (assert_return (invoke $Pm "grow" (i32.const 0)) (i32.const 1))
  289. (assert_return (invoke $Pm "grow" (i32.const 2)) (i32.const 1))
  290. (assert_return (invoke $Pm "grow" (i32.const 0)) (i32.const 3))
  291. @@ -380,6 +395,7 @@
  292. (assert_return (invoke $Pm "grow" (i32.const 0)) (i32.const 5))
  293. (assert_return (invoke $Pm "grow" (i32.const 1)) (i32.const -1))
  294. (assert_return (invoke $Pm "grow" (i32.const 0)) (i32.const 5))
  295. +;)
  296. (assert_unlinkable
  297. (module
  298. @@ -403,8 +419,10 @@
  299. )
  300. "out of bounds memory access"
  301. )
  302. +(;
  303. (assert_return (invoke $Mm "load" (i32.const 0)) (i32.const 97))
  304. (assert_return (invoke $Mm "load" (i32.const 327670)) (i32.const 0))
  305. +;)
  306. (assert_trap
  307. (module
  308. @@ -416,7 +434,9 @@
  309. )
  310. "out of bounds table access"
  311. )
  312. +(;
  313. (assert_return (invoke $Mm "load" (i32.const 0)) (i32.const 97))
  314. +;)
  315. ;; Store is modified if the start function traps.
  316. (module $Ms
  317. @@ -432,6 +452,7 @@
  318. )
  319. (register "Ms" $Ms)
  320. +(;
  321. (assert_trap
  322. (module
  323. (import "Ms" "memory" (memory 1))
  324. @@ -451,3 +472,4 @@
  325. (assert_return (invoke $Ms "get memory[0]") (i32.const 104)) ;; 'h'
  326. (assert_return (invoke $Ms "get table[0]") (i32.const 0xdead))
  327. +;)
  328. diff --git a/test/core/memory.wast b/test/core/memory.wast
  329. index 1dd5b845..497b69fc 100644
  330. --- a/test/core/memory.wast
  331. +++ b/test/core/memory.wast
  332. @@ -76,17 +76,17 @@
  333. "memory size must be at most 65536 pages (4GiB)"
  334. )
  335. -(assert_invalid
  336. +(assert_malformed
  337. (module quote "(memory 0x1_0000_0000)")
  338. - "memory size must be at most 65536 pages (4GiB)"
  339. + "i32 constant out of range"
  340. )
  341. -(assert_invalid
  342. +(assert_malformed
  343. (module quote "(memory 0x1_0000_0000 0x1_0000_0000)")
  344. - "memory size must be at most 65536 pages (4GiB)"
  345. + "i32 constant out of range"
  346. )
  347. -(assert_invalid
  348. +(assert_malformed
  349. (module quote "(memory 0 0x1_0000_0000)")
  350. - "memory size must be at most 65536 pages (4GiB)"
  351. + "i32 constant out of range"
  352. )
  353. (module
  354. diff --git a/test/core/ref_func.wast b/test/core/ref_func.wast
  355. index adb5cb78..590f6262 100644
  356. --- a/test/core/ref_func.wast
  357. +++ b/test/core/ref_func.wast
  358. @@ -4,7 +4,8 @@
  359. (register "M")
  360. (module
  361. - (func $f (import "M" "f") (param i32) (result i32))
  362. + (; aot mode does not support module linking ;)
  363. + (func $f (param $x i32) (result i32) (local.get $x))
  364. (func $g (param $x i32) (result i32)
  365. (i32.add (local.get $x) (i32.const 1))
  366. )
  367. diff --git a/test/core/table.wast b/test/core/table.wast
  368. index 1b6afe9b..45dd1145 100644
  369. --- a/test/core/table.wast
  370. +++ b/test/core/table.wast
  371. @@ -8,16 +8,20 @@
  372. (module (table 0 65536 funcref))
  373. (module (table 0 0xffff_ffff funcref))
  374. +(; TODO: wabt not unsupported gc yet
  375. (module (table 1 (ref null func)))
  376. (module (table 1 (ref null extern)))
  377. (module (table 1 (ref null $t)) (type $t (func)))
  378. +;)
  379. (module (table 0 funcref) (table 0 funcref))
  380. (module (table (import "spectest" "table") 0 funcref) (table 0 funcref))
  381. +(; TODO: wabt not unsupported gc yet
  382. (module (table 0 funcref (ref.null func)))
  383. (module (table 1 funcref (ref.null func)))
  384. (module (table 1 (ref null func) (ref.null func)))
  385. +;)
  386. (assert_invalid (module (elem (i32.const 0))) "unknown table")
  387. (assert_invalid (module (elem (i32.const 0) $f) (func $f)) "unknown table")
  388. @@ -31,6 +35,7 @@
  389. "size minimum must not be greater than maximum"
  390. )
  391. +(; TODO: wabt not unsupported gc yet
  392. (assert_invalid
  393. (module quote "(table 0x1_0000_0000 funcref)")
  394. "table size must be at most 2^32-1"
  395. @@ -43,6 +48,7 @@
  396. (module quote "(table 0 0x1_0000_0000 funcref)")
  397. "table size must be at most 2^32-1"
  398. )
  399. +;)
  400. ;; Same as above but with i64 index types
  401. @@ -71,6 +77,7 @@
  402. (assert_invalid (module (elem (i32.const 0))) "unknown table")
  403. (assert_invalid (module (elem (i32.const 0) $f) (func $f)) "unknown table")
  404. +(; TODO: wabt not unsupported gc yet
  405. (assert_invalid
  406. (module (table 1 (ref null func) (i32.const 0)))
  407. "type mismatch"
  408. @@ -159,6 +166,7 @@
  409. )
  410. "type mismatch"
  411. )
  412. +;)
  413. ;; Duplicate table identifiers
  414. diff --git a/test/core/table_copy.wast b/test/core/table_copy.wast
  415. index 613fc529..abeca22c 100644
  416. --- a/test/core/table_copy.wast
  417. +++ b/test/core/table_copy.wast
  418. @@ -14,11 +14,12 @@
  419. (module
  420. (type (func (result i32))) ;; type #0
  421. - (import "a" "ef0" (func (result i32))) ;; index 0
  422. - (import "a" "ef1" (func (result i32)))
  423. - (import "a" "ef2" (func (result i32)))
  424. - (import "a" "ef3" (func (result i32)))
  425. - (import "a" "ef4" (func (result i32))) ;; index 4
  426. + ;; aot mode does not support module linking
  427. + (func (result i32) (i32.const 0)) ;; index 0
  428. + (func (result i32) (i32.const 1))
  429. + (func (result i32) (i32.const 2))
  430. + (func (result i32) (i32.const 3))
  431. + (func (result i32) (i32.const 4)) ;; index 4
  432. (table $t0 30 30 funcref)
  433. (table $t1 30 30 funcref)
  434. (elem (table $t0) (i32.const 2) func 3 1 4 1)
  435. @@ -106,11 +107,11 @@
  436. (module
  437. (type (func (result i32))) ;; type #0
  438. - (import "a" "ef0" (func (result i32))) ;; index 0
  439. - (import "a" "ef1" (func (result i32)))
  440. - (import "a" "ef2" (func (result i32)))
  441. - (import "a" "ef3" (func (result i32)))
  442. - (import "a" "ef4" (func (result i32))) ;; index 4
  443. + (func (export "ef0") (result i32) (i32.const 0)) ;; index 0
  444. + (func (export "ef1") (result i32) (i32.const 1))
  445. + (func (export "ef2") (result i32) (i32.const 2))
  446. + (func (export "ef3") (result i32) (i32.const 3))
  447. + (func (export "ef4") (result i32) (i32.const 4)) ;; index 4
  448. (table $t0 30 30 funcref)
  449. (table $t1 30 30 funcref)
  450. (elem (table $t0) (i32.const 2) func 3 1 4 1)
  451. @@ -198,11 +199,11 @@
  452. (module
  453. (type (func (result i32))) ;; type #0
  454. - (import "a" "ef0" (func (result i32))) ;; index 0
  455. - (import "a" "ef1" (func (result i32)))
  456. - (import "a" "ef2" (func (result i32)))
  457. - (import "a" "ef3" (func (result i32)))
  458. - (import "a" "ef4" (func (result i32))) ;; index 4
  459. + (func (result i32) (i32.const 0)) ;; index 0
  460. + (func (result i32) (i32.const 1))
  461. + (func (result i32) (i32.const 2))
  462. + (func (result i32) (i32.const 3))
  463. + (func (result i32) (i32.const 4)) ;; index 4
  464. (table $t0 30 30 funcref)
  465. (table $t1 30 30 funcref)
  466. (elem (table $t0) (i32.const 2) func 3 1 4 1)
  467. @@ -290,11 +291,11 @@
  468. (module
  469. (type (func (result i32))) ;; type #0
  470. - (import "a" "ef0" (func (result i32))) ;; index 0
  471. - (import "a" "ef1" (func (result i32)))
  472. - (import "a" "ef2" (func (result i32)))
  473. - (import "a" "ef3" (func (result i32)))
  474. - (import "a" "ef4" (func (result i32))) ;; index 4
  475. + (func (result i32) (i32.const 0)) ;; index 0
  476. + (func (result i32) (i32.const 1))
  477. + (func (result i32) (i32.const 2))
  478. + (func (result i32) (i32.const 3))
  479. + (func (result i32) (i32.const 4)) ;; index 4
  480. (table $t0 30 30 funcref)
  481. (table $t1 30 30 funcref)
  482. (elem (table $t0) (i32.const 2) func 3 1 4 1)
  483. @@ -382,11 +383,11 @@
  484. (module
  485. (type (func (result i32))) ;; type #0
  486. - (import "a" "ef0" (func (result i32))) ;; index 0
  487. - (import "a" "ef1" (func (result i32)))
  488. - (import "a" "ef2" (func (result i32)))
  489. - (import "a" "ef3" (func (result i32)))
  490. - (import "a" "ef4" (func (result i32))) ;; index 4
  491. + (func (result i32) (i32.const 0)) ;; index 0
  492. + (func (result i32) (i32.const 1))
  493. + (func (result i32) (i32.const 2))
  494. + (func (result i32) (i32.const 3))
  495. + (func (result i32) (i32.const 4)) ;; index 4
  496. (table $t0 30 30 funcref)
  497. (table $t1 30 30 funcref)
  498. (elem (table $t0) (i32.const 2) func 3 1 4 1)
  499. @@ -474,11 +475,11 @@
  500. (module
  501. (type (func (result i32))) ;; type #0
  502. - (import "a" "ef0" (func (result i32))) ;; index 0
  503. - (import "a" "ef1" (func (result i32)))
  504. - (import "a" "ef2" (func (result i32)))
  505. - (import "a" "ef3" (func (result i32)))
  506. - (import "a" "ef4" (func (result i32))) ;; index 4
  507. + (func (result i32) (i32.const 0)) ;; index 0
  508. + (func (result i32) (i32.const 1))
  509. + (func (result i32) (i32.const 2))
  510. + (func (result i32) (i32.const 3))
  511. + (func (result i32) (i32.const 4)) ;; index 4
  512. (table $t0 30 30 funcref)
  513. (table $t1 30 30 funcref)
  514. (elem (table $t0) (i32.const 2) func 3 1 4 1)
  515. @@ -566,11 +567,11 @@
  516. (module
  517. (type (func (result i32))) ;; type #0
  518. - (import "a" "ef0" (func (result i32))) ;; index 0
  519. - (import "a" "ef1" (func (result i32)))
  520. - (import "a" "ef2" (func (result i32)))
  521. - (import "a" "ef3" (func (result i32)))
  522. - (import "a" "ef4" (func (result i32))) ;; index 4
  523. + (func (result i32) (i32.const 0)) ;; index 0
  524. + (func (result i32) (i32.const 1))
  525. + (func (result i32) (i32.const 2))
  526. + (func (result i32) (i32.const 3))
  527. + (func (result i32) (i32.const 4)) ;; index 4
  528. (table $t0 30 30 funcref)
  529. (table $t1 30 30 funcref)
  530. (elem (table $t0) (i32.const 2) func 3 1 4 1)
  531. @@ -658,11 +659,11 @@
  532. (module
  533. (type (func (result i32))) ;; type #0
  534. - (import "a" "ef0" (func (result i32))) ;; index 0
  535. - (import "a" "ef1" (func (result i32)))
  536. - (import "a" "ef2" (func (result i32)))
  537. - (import "a" "ef3" (func (result i32)))
  538. - (import "a" "ef4" (func (result i32))) ;; index 4
  539. + (func (result i32) (i32.const 0)) ;; index 0
  540. + (func (result i32) (i32.const 1))
  541. + (func (result i32) (i32.const 2))
  542. + (func (result i32) (i32.const 3))
  543. + (func (result i32) (i32.const 4)) ;; index 4
  544. (table $t0 30 30 funcref)
  545. (table $t1 30 30 funcref)
  546. (elem (table $t0) (i32.const 2) func 3 1 4 1)
  547. @@ -750,11 +751,11 @@
  548. (module
  549. (type (func (result i32))) ;; type #0
  550. - (import "a" "ef0" (func (result i32))) ;; index 0
  551. - (import "a" "ef1" (func (result i32)))
  552. - (import "a" "ef2" (func (result i32)))
  553. - (import "a" "ef3" (func (result i32)))
  554. - (import "a" "ef4" (func (result i32))) ;; index 4
  555. + (func (result i32) (i32.const 0)) ;; index 0
  556. + (func (result i32) (i32.const 1))
  557. + (func (result i32) (i32.const 2))
  558. + (func (result i32) (i32.const 3))
  559. + (func (result i32) (i32.const 4)) ;; index 4
  560. (table $t0 30 30 funcref)
  561. (table $t1 30 30 funcref)
  562. (elem (table $t0) (i32.const 2) func 3 1 4 1)
  563. @@ -842,11 +843,11 @@
  564. (module
  565. (type (func (result i32))) ;; type #0
  566. - (import "a" "ef0" (func (result i32))) ;; index 0
  567. - (import "a" "ef1" (func (result i32)))
  568. - (import "a" "ef2" (func (result i32)))
  569. - (import "a" "ef3" (func (result i32)))
  570. - (import "a" "ef4" (func (result i32))) ;; index 4
  571. + (func (result i32) (i32.const 0)) ;; index 0
  572. + (func (result i32) (i32.const 1))
  573. + (func (result i32) (i32.const 2))
  574. + (func (result i32) (i32.const 3))
  575. + (func (result i32) (i32.const 4)) ;; index 4
  576. (table $t0 30 30 funcref)
  577. (table $t1 30 30 funcref)
  578. (elem (table $t1) (i32.const 2) func 3 1 4 1)
  579. @@ -934,11 +935,11 @@
  580. (module
  581. (type (func (result i32))) ;; type #0
  582. - (import "a" "ef0" (func (result i32))) ;; index 0
  583. - (import "a" "ef1" (func (result i32)))
  584. - (import "a" "ef2" (func (result i32)))
  585. - (import "a" "ef3" (func (result i32)))
  586. - (import "a" "ef4" (func (result i32))) ;; index 4
  587. + (func (result i32) (i32.const 0)) ;; index 0
  588. + (func (result i32) (i32.const 1))
  589. + (func (result i32) (i32.const 2))
  590. + (func (result i32) (i32.const 3))
  591. + (func (result i32) (i32.const 4)) ;; index 4
  592. (table $t0 30 30 funcref)
  593. (table $t1 30 30 funcref)
  594. (elem (table $t1) (i32.const 2) func 3 1 4 1)
  595. @@ -1026,11 +1027,11 @@
  596. (module
  597. (type (func (result i32))) ;; type #0
  598. - (import "a" "ef0" (func (result i32))) ;; index 0
  599. - (import "a" "ef1" (func (result i32)))
  600. - (import "a" "ef2" (func (result i32)))
  601. - (import "a" "ef3" (func (result i32)))
  602. - (import "a" "ef4" (func (result i32))) ;; index 4
  603. + (func (result i32) (i32.const 0)) ;; index 0
  604. + (func (result i32) (i32.const 1))
  605. + (func (result i32) (i32.const 2))
  606. + (func (result i32) (i32.const 3))
  607. + (func (result i32) (i32.const 4)) ;; index 4
  608. (table $t0 30 30 funcref)
  609. (table $t1 30 30 funcref)
  610. (elem (table $t1) (i32.const 2) func 3 1 4 1)
  611. @@ -1118,11 +1119,11 @@
  612. (module
  613. (type (func (result i32))) ;; type #0
  614. - (import "a" "ef0" (func (result i32))) ;; index 0
  615. - (import "a" "ef1" (func (result i32)))
  616. - (import "a" "ef2" (func (result i32)))
  617. - (import "a" "ef3" (func (result i32)))
  618. - (import "a" "ef4" (func (result i32))) ;; index 4
  619. + (func (result i32) (i32.const 0)) ;; index 0
  620. + (func (result i32) (i32.const 1))
  621. + (func (result i32) (i32.const 2))
  622. + (func (result i32) (i32.const 3))
  623. + (func (result i32) (i32.const 4)) ;; index 4
  624. (table $t0 30 30 funcref)
  625. (table $t1 30 30 funcref)
  626. (elem (table $t1) (i32.const 2) func 3 1 4 1)
  627. @@ -1210,11 +1211,11 @@
  628. (module
  629. (type (func (result i32))) ;; type #0
  630. - (import "a" "ef0" (func (result i32))) ;; index 0
  631. - (import "a" "ef1" (func (result i32)))
  632. - (import "a" "ef2" (func (result i32)))
  633. - (import "a" "ef3" (func (result i32)))
  634. - (import "a" "ef4" (func (result i32))) ;; index 4
  635. + (func (result i32) (i32.const 0)) ;; index 0
  636. + (func (result i32) (i32.const 1))
  637. + (func (result i32) (i32.const 2))
  638. + (func (result i32) (i32.const 3))
  639. + (func (result i32) (i32.const 4)) ;; index 4
  640. (table $t0 30 30 funcref)
  641. (table $t1 30 30 funcref)
  642. (elem (table $t1) (i32.const 2) func 3 1 4 1)
  643. @@ -1302,11 +1303,11 @@
  644. (module
  645. (type (func (result i32))) ;; type #0
  646. - (import "a" "ef0" (func (result i32))) ;; index 0
  647. - (import "a" "ef1" (func (result i32)))
  648. - (import "a" "ef2" (func (result i32)))
  649. - (import "a" "ef3" (func (result i32)))
  650. - (import "a" "ef4" (func (result i32))) ;; index 4
  651. + (func (result i32) (i32.const 0)) ;; index 0
  652. + (func (result i32) (i32.const 1))
  653. + (func (result i32) (i32.const 2))
  654. + (func (result i32) (i32.const 3))
  655. + (func (result i32) (i32.const 4)) ;; index 4
  656. (table $t0 30 30 funcref)
  657. (table $t1 30 30 funcref)
  658. (elem (table $t1) (i32.const 2) func 3 1 4 1)
  659. @@ -1394,11 +1395,11 @@
  660. (module
  661. (type (func (result i32))) ;; type #0
  662. - (import "a" "ef0" (func (result i32))) ;; index 0
  663. - (import "a" "ef1" (func (result i32)))
  664. - (import "a" "ef2" (func (result i32)))
  665. - (import "a" "ef3" (func (result i32)))
  666. - (import "a" "ef4" (func (result i32))) ;; index 4
  667. + (func (result i32) (i32.const 0)) ;; index 0
  668. + (func (result i32) (i32.const 1))
  669. + (func (result i32) (i32.const 2))
  670. + (func (result i32) (i32.const 3))
  671. + (func (result i32) (i32.const 4)) ;; index 4
  672. (table $t0 30 30 funcref)
  673. (table $t1 30 30 funcref)
  674. (elem (table $t1) (i32.const 2) func 3 1 4 1)
  675. @@ -1486,11 +1487,11 @@
  676. (module
  677. (type (func (result i32))) ;; type #0
  678. - (import "a" "ef0" (func (result i32))) ;; index 0
  679. - (import "a" "ef1" (func (result i32)))
  680. - (import "a" "ef2" (func (result i32)))
  681. - (import "a" "ef3" (func (result i32)))
  682. - (import "a" "ef4" (func (result i32))) ;; index 4
  683. + (func (result i32) (i32.const 0)) ;; index 0
  684. + (func (result i32) (i32.const 1))
  685. + (func (result i32) (i32.const 2))
  686. + (func (result i32) (i32.const 3))
  687. + (func (result i32) (i32.const 4)) ;; index 4
  688. (table $t0 30 30 funcref)
  689. (table $t1 30 30 funcref)
  690. (elem (table $t1) (i32.const 2) func 3 1 4 1)
  691. @@ -1578,11 +1579,11 @@
  692. (module
  693. (type (func (result i32))) ;; type #0
  694. - (import "a" "ef0" (func (result i32))) ;; index 0
  695. - (import "a" "ef1" (func (result i32)))
  696. - (import "a" "ef2" (func (result i32)))
  697. - (import "a" "ef3" (func (result i32)))
  698. - (import "a" "ef4" (func (result i32))) ;; index 4
  699. + (func (result i32) (i32.const 0)) ;; index 0
  700. + (func (result i32) (i32.const 1))
  701. + (func (result i32) (i32.const 2))
  702. + (func (result i32) (i32.const 3))
  703. + (func (result i32) (i32.const 4)) ;; index 4
  704. (table $t0 30 30 funcref)
  705. (table $t1 30 30 funcref)
  706. (elem (table $t1) (i32.const 2) func 3 1 4 1)
  707. diff --git a/test/core/table_grow.wast b/test/core/table_grow.wast
  708. index e0872d78..6a84f239 100644
  709. --- a/test/core/table_grow.wast
  710. +++ b/test/core/table_grow.wast
  711. @@ -147,19 +147,20 @@
  712. )
  713. (register "grown-table" $Tgt)
  714. (assert_return (invoke $Tgt "grow") (i32.const 1)) ;; now size is 2
  715. -(module $Tgit1
  716. - ;; imported table limits should match, because external table size is 2 now
  717. - (table (export "table") (import "grown-table" "table") 2 funcref)
  718. - (func (export "grow") (result i32) (table.grow (ref.null func) (i32.const 1)))
  719. -)
  720. -(register "grown-imported-table" $Tgit1)
  721. -(assert_return (invoke $Tgit1 "grow") (i32.const 2)) ;; now size is 3
  722. -(module $Tgit2
  723. - ;; imported table limits should match, because external table size is 3 now
  724. - (import "grown-imported-table" "table" (table 3 funcref))
  725. - (func (export "size") (result i32) (table.size))
  726. -)
  727. -(assert_return (invoke $Tgit2 "size") (i32.const 3))
  728. +;; TODO: No dynnamic linking yet
  729. +;; (module $Tgit1
  730. +;; ;; imported table limits should match, because external table size is 2 now
  731. +;; (table (export "table") (import "grown-table" "table") 2 funcref)
  732. +;; (func (export "grow") (result i32) (table.grow (ref.null func) (i32.const 1)))
  733. +;; )
  734. +;; (register "grown-imported-table" $Tgit1)
  735. +;; (assert_return (invoke $Tgit1 "grow") (i32.const 2)) ;; now size is 3
  736. +;; (module $Tgit2
  737. +;; ;; imported table limits should match, because external table size is 3 now
  738. +;; (import "grown-imported-table" "table" (table 3 funcref))
  739. +;; (func (export "size") (result i32) (table.size))
  740. +;; )
  741. +;; (assert_return (invoke $Tgit2 "size") (i32.const 3))
  742. ;; Type errors
  743. diff --git a/test/core/table_init.wast b/test/core/table_init.wast
  744. index 5c3679ab..76782794 100644
  745. --- a/test/core/table_init.wast
  746. +++ b/test/core/table_init.wast
  747. @@ -14,11 +14,12 @@
  748. (module
  749. (type (func (result i32))) ;; type #0
  750. - (import "a" "ef0" (func (result i32))) ;; index 0
  751. - (import "a" "ef1" (func (result i32)))
  752. - (import "a" "ef2" (func (result i32)))
  753. - (import "a" "ef3" (func (result i32)))
  754. - (import "a" "ef4" (func (result i32))) ;; index 4
  755. + ;; aot mode does not support module linking
  756. + (func (result i32) (i32.const 0)) ;; index 0
  757. + (func (result i32) (i32.const 1))
  758. + (func (result i32) (i32.const 2))
  759. + (func (result i32) (i32.const 3))
  760. + (func (result i32) (i32.const 4)) ;; index 4
  761. (table $t0 30 30 funcref)
  762. (table $t1 30 30 funcref)
  763. (table $t2 i64 30 30 funcref)
  764. @@ -73,11 +74,12 @@
  765. (module
  766. (type (func (result i32))) ;; type #0
  767. - (import "a" "ef0" (func (result i32))) ;; index 0
  768. - (import "a" "ef1" (func (result i32)))
  769. - (import "a" "ef2" (func (result i32)))
  770. - (import "a" "ef3" (func (result i32)))
  771. - (import "a" "ef4" (func (result i32))) ;; index 4
  772. + ;; aot mode does not support module linking
  773. + (func (result i32) (i32.const 0)) ;; index 0
  774. + (func (result i32) (i32.const 1))
  775. + (func (result i32) (i32.const 2))
  776. + (func (result i32) (i32.const 3))
  777. + (func (result i32) (i32.const 4)) ;; index 4
  778. (table $t0 30 30 funcref)
  779. (table $t1 30 30 funcref)
  780. (table $t2 i64 30 30 funcref)
  781. @@ -132,11 +134,12 @@
  782. (module
  783. (type (func (result i32))) ;; type #0
  784. - (import "a" "ef0" (func (result i32))) ;; index 0
  785. - (import "a" "ef1" (func (result i32)))
  786. - (import "a" "ef2" (func (result i32)))
  787. - (import "a" "ef3" (func (result i32)))
  788. - (import "a" "ef4" (func (result i32))) ;; index 4
  789. + ;; aot mode does not support module linking
  790. + (func (result i32) (i32.const 0)) ;; index 0
  791. + (func (result i32) (i32.const 1))
  792. + (func (result i32) (i32.const 2))
  793. + (func (result i32) (i32.const 3))
  794. + (func (result i32) (i32.const 4)) ;; index 4
  795. (table $t0 30 30 funcref)
  796. (table $t1 30 30 funcref)
  797. (table $t2 i64 30 30 funcref)
  798. @@ -199,11 +202,12 @@
  799. (module
  800. (type (func (result i32))) ;; type #0
  801. - (import "a" "ef0" (func (result i32))) ;; index 0
  802. - (import "a" "ef1" (func (result i32)))
  803. - (import "a" "ef2" (func (result i32)))
  804. - (import "a" "ef3" (func (result i32)))
  805. - (import "a" "ef4" (func (result i32))) ;; index 4
  806. + ;; aot mode does not support module linking
  807. + (func (result i32) (i32.const 0)) ;; index 0
  808. + (func (result i32) (i32.const 1))
  809. + (func (result i32) (i32.const 2))
  810. + (func (result i32) (i32.const 3))
  811. + (func (result i32) (i32.const 4)) ;; index 4
  812. (table $t0 30 30 funcref)
  813. (table $t1 30 30 funcref)
  814. (table $t2 i64 30 30 funcref)
  815. @@ -258,11 +262,12 @@
  816. (module
  817. (type (func (result i32))) ;; type #0
  818. - (import "a" "ef0" (func (result i32))) ;; index 0
  819. - (import "a" "ef1" (func (result i32)))
  820. - (import "a" "ef2" (func (result i32)))
  821. - (import "a" "ef3" (func (result i32)))
  822. - (import "a" "ef4" (func (result i32))) ;; index 4
  823. + ;; aot mode does not support module linking
  824. + (func (result i32) (i32.const 0)) ;; index 0
  825. + (func (result i32) (i32.const 1))
  826. + (func (result i32) (i32.const 2))
  827. + (func (result i32) (i32.const 3))
  828. + (func (result i32) (i32.const 4)) ;; index 4
  829. (table $t0 30 30 funcref)
  830. (table $t1 30 30 funcref)
  831. (table $t2 i64 30 30 funcref)
  832. @@ -317,11 +322,12 @@
  833. (module
  834. (type (func (result i32))) ;; type #0
  835. - (import "a" "ef0" (func (result i32))) ;; index 0
  836. - (import "a" "ef1" (func (result i32)))
  837. - (import "a" "ef2" (func (result i32)))
  838. - (import "a" "ef3" (func (result i32)))
  839. - (import "a" "ef4" (func (result i32))) ;; index 4
  840. + ;; aot mode does not support module linking
  841. + (func (result i32) (i32.const 0)) ;; index 0
  842. + (func (result i32) (i32.const 1))
  843. + (func (result i32) (i32.const 2))
  844. + (func (result i32) (i32.const 3))
  845. + (func (result i32) (i32.const 4)) ;; index 4
  846. (table $t0 30 30 funcref)
  847. (table $t1 30 30 funcref)
  848. (table $t2 i64 30 30 funcref)
  849. @@ -384,11 +390,12 @@
  850. (module
  851. (type (func (result i32))) ;; type #0
  852. - (import "a" "ef0" (func (result i32))) ;; index 0
  853. - (import "a" "ef1" (func (result i32)))
  854. - (import "a" "ef2" (func (result i32)))
  855. - (import "a" "ef3" (func (result i32)))
  856. - (import "a" "ef4" (func (result i32))) ;; index 4
  857. + ;; aot mode does not support module linking
  858. + (func (result i32) (i32.const 0)) ;; index 0
  859. + (func (result i32) (i32.const 1))
  860. + (func (result i32) (i32.const 2))
  861. + (func (result i32) (i32.const 3))
  862. + (func (result i32) (i32.const 4)) ;; index 4
  863. (table $t0 30 30 funcref)
  864. (table $t1 30 30 funcref)
  865. (table $t2 i64 30 30 funcref)
  866. @@ -443,11 +450,12 @@
  867. (module
  868. (type (func (result i32))) ;; type #0
  869. - (import "a" "ef0" (func (result i32))) ;; index 0
  870. - (import "a" "ef1" (func (result i32)))
  871. - (import "a" "ef2" (func (result i32)))
  872. - (import "a" "ef3" (func (result i32)))
  873. - (import "a" "ef4" (func (result i32))) ;; index 4
  874. + ;; aot mode does not support module linking
  875. + (func (result i32) (i32.const 0)) ;; index 0
  876. + (func (result i32) (i32.const 1))
  877. + (func (result i32) (i32.const 2))
  878. + (func (result i32) (i32.const 3))
  879. + (func (result i32) (i32.const 4)) ;; index 4
  880. (table $t0 30 30 funcref)
  881. (table $t1 30 30 funcref)
  882. (table $t2 i64 30 30 funcref)
  883. @@ -502,11 +510,12 @@
  884. (module
  885. (type (func (result i32))) ;; type #0
  886. - (import "a" "ef0" (func (result i32))) ;; index 0
  887. - (import "a" "ef1" (func (result i32)))
  888. - (import "a" "ef2" (func (result i32)))
  889. - (import "a" "ef3" (func (result i32)))
  890. - (import "a" "ef4" (func (result i32))) ;; index 4
  891. + ;; aot mode does not support module linking
  892. + (func (result i32) (i32.const 0)) ;; index 0
  893. + (func (result i32) (i32.const 1))
  894. + (func (result i32) (i32.const 2))
  895. + (func (result i32) (i32.const 3))
  896. + (func (result i32) (i32.const 4)) ;; index 4
  897. (table $t0 30 30 funcref)
  898. (table $t1 30 30 funcref)
  899. (table $t2 i64 30 30 funcref)
  900. diff --git a/test/core/unreached-valid.wast b/test/core/unreached-valid.wast
  901. index b7ebabfd..4f2abfbf 100644
  902. --- a/test/core/unreached-valid.wast
  903. +++ b/test/core/unreached-valid.wast
  904. @@ -46,6 +46,7 @@
  905. ;; Validation after unreachable
  906. +(;
  907. (module
  908. (func (export "meet-bottom")
  909. (block (result f64)
  910. @@ -61,3 +62,4 @@
  911. )
  912. (assert_trap (invoke "meet-bottom") "unreachable")
  913. +;)