Bug 1333011: wasm: add spec tests for checking segments against actual sizes; r=luke
authorBenjamin Bouvier <benj@benj.me>
Mon, 23 Jan 2017 14:47:08 +0100
changeset 330764 7de92df120488e13bd4315e1790796d2eb8f7af4
parent 330763 dc1db518e229391fc1852202c6ce31057d1e0643
child 330765 f91c4c151a403db894c086e1b1b0a4c9513182e6
push id86070
push userbbouvier@mozilla.com
push dateTue, 24 Jan 2017 10:11:07 +0000
treeherdermozilla-inbound@7de92df12048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1333011
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1333011: wasm: add spec tests for checking segments against actual sizes; r=luke This is just winning some time from https://github.com/WebAssembly/spec/pull/408/. MozReview-Commit-ID: 1mIO3pQa3SL
js/src/jit-test/tests/wasm/spec/linking.wast
--- a/js/src/jit-test/tests/wasm/spec/linking.wast
+++ b/js/src/jit-test/tests/wasm/spec/linking.wast
@@ -151,16 +151,22 @@
 (assert_trap (invoke $Mt "call" (i32.const 0)) "uninitialized")
 (assert_trap (invoke $Nt "Mt.call" (i32.const 0)) "uninitialized")
 (assert_return (invoke $Nt "call" (i32.const 0)) (i32.const 5))
 (assert_trap (invoke $Nt "call Mt.call" (i32.const 0)) "uninitialized")
 (assert_trap (invoke $Ot "call" (i32.const 0)) "uninitialized")
 
 (assert_trap (invoke $Ot "call" (i32.const 20)) "undefined")
 
+(module $Pt
+  (table (import "Mt" "tab") 0 anyfunc)
+  (elem (i32.const 9) $f)
+  (func $f)
+)
+
 (assert_unlinkable
   (module
     (table (import "Mt" "tab") 10 anyfunc)
     (memory (import "Mt" "mem") 1)  ;; does not exist
     (func $f (result i32) (i32.const 0))
     (elem (i32.const 7) $f)
     (elem (i32.const 9) $f)
   )
@@ -230,31 +236,36 @@
 )
 
 (assert_return (invoke $Mm "load" (i32.const 12)) (i32.const 0xa7))
 (assert_return (invoke $Nm "Mm.load" (i32.const 12)) (i32.const 0xa7))
 (assert_return (invoke $Nm "load" (i32.const 12)) (i32.const 0xf2))
 (assert_return (invoke $Om "load" (i32.const 12)) (i32.const 0xa7))
 
 (module $Pm
+  (memory (import "Mm" "mem") 0)
+  (data (i32.const 1000) "abc")
+)
+
+(module $Qm
   (memory (import "Mm" "mem") 1 8)
 
   (func (export "grow") (param $a i32) (result i32)
     (grow_memory (get_local 0))
   )
 )
 
-(assert_return (invoke $Pm "grow" (i32.const 0)) (i32.const 1))
-(assert_return (invoke $Pm "grow" (i32.const 2)) (i32.const 1))
-(assert_return (invoke $Pm "grow" (i32.const 0)) (i32.const 3))
-(assert_return (invoke $Pm "grow" (i32.const 1)) (i32.const 3))
-(assert_return (invoke $Pm "grow" (i32.const 1)) (i32.const 4))
-(assert_return (invoke $Pm "grow" (i32.const 0)) (i32.const 5))
-(assert_return (invoke $Pm "grow" (i32.const 1)) (i32.const -1))
-(assert_return (invoke $Pm "grow" (i32.const 0)) (i32.const 5))
+(assert_return (invoke $Qm "grow" (i32.const 0)) (i32.const 1))
+(assert_return (invoke $Qm "grow" (i32.const 2)) (i32.const 1))
+(assert_return (invoke $Qm "grow" (i32.const 0)) (i32.const 3))
+(assert_return (invoke $Qm "grow" (i32.const 1)) (i32.const 3))
+(assert_return (invoke $Qm "grow" (i32.const 1)) (i32.const 4))
+(assert_return (invoke $Qm "grow" (i32.const 0)) (i32.const 5))
+(assert_return (invoke $Qm "grow" (i32.const 1)) (i32.const -1))
+(assert_return (invoke $Qm "grow" (i32.const 0)) (i32.const 5))
 
 (assert_unlinkable
   (module
     (func $host (import "spectest" "print"))
     (memory (import "Mm" "mem") 1)
     (table (import "Mm" "tab") 0 anyfunc)  ;; does not exist
     (data (i32.const 0) "abc")
   )