| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- diff --git a/test/core/linking.wast b/test/core/linking.wast
- index d0bfb5f..6617945 100644
- --- a/test/core/linking.wast
- +++ b/test/core/linking.wast
- @@ -35,7 +35,7 @@
-
-
- ;; Globals
- -
- +(;
- (module $Mg
- (global $glob (export "glob") i32 (i32.const 42))
- (func (export "get") (result i32) (global.get $glob))
- @@ -63,7 +63,7 @@
- (export "Mg.get_mut" (func $get_mut))
- (export "Mg.set_mut" (func $set_mut))
- )
- -
- +;)
- (;
- (assert_return (get $Mg "glob") (i32.const 42))
- (assert_return (get $Ng "Mg.glob") (i32.const 42))
- @@ -84,7 +84,7 @@
- (assert_return (invoke $Ng "Mg.get_mut") (i32.const 241))
- ;)
-
- -
- +(;
- (assert_unlinkable
- (module (import "Mg" "mut_glob" (global i32)))
- "incompatible import type"
- @@ -166,7 +166,7 @@
- (call_indirect (type 1) (local.get 0))
- )
- )
- -
- +;)
- (;
- (assert_return (invoke $Mt "call" (i32.const 2)) (i32.const 4))
- (assert_return (invoke $Nt "Mt.call" (i32.const 2)) (i32.const 4))
- @@ -191,7 +191,7 @@
- (assert_return (invoke $Nt "call" (i32.const 3)) (i32.const -4))
- (assert_trap (invoke $Nt "call" (i32.const 4)) "indirect call type mismatch")
- ;)
- -
- +(;
- (module $Ot
- (type (func (result i32)))
-
- @@ -204,7 +204,7 @@
- (call_indirect (type 0) (local.get 0))
- )
- )
- -
- +;)
- (;
- (assert_return (invoke $Mt "call" (i32.const 3)) (i32.const 4))
- (assert_return (invoke $Nt "Mt.call" (i32.const 3)) (i32.const 4))
- @@ -231,7 +231,7 @@
-
- (assert_trap (invoke $Ot "call" (i32.const 20)) "undefined element")
- ;)
- -
- +(;
- (module
- (table (import "Mt" "tab") 0 funcref)
- (elem (i32.const 9) $f)
- @@ -266,7 +266,7 @@
- "unknown import"
- )
- (assert_trap (invoke $Mt "call" (i32.const 7)) "uninitialized element")
- -
- +;)
- ;; Unlike in the v1 spec, active element segments stored before an
- ;; out-of-bounds access persist after the instantiation failure.
- (;
- @@ -297,7 +297,7 @@
- (assert_return (invoke $Mt "call" (i32.const 7)) (i32.const 0))
- ;)
-
- -
- +(;
- (module $Mtable_ex
- (table $t1 (export "t-func") 1 funcref)
- (table $t2 (export "t-extern") 1 externref)
- @@ -308,7 +308,7 @@
- (table (import "Mtable_ex" "t-func") 1 funcref)
- (table (import "Mtable_ex" "t-extern") 1 externref)
- )
- -
- +;)
- (;
- (assert_unlinkable
- (module (table (import "Mtable_ex" "t-func") 1 externref))
- @@ -322,7 +322,7 @@
-
-
- ;; Memories
- -
- +(;
- (module $Mm
- (memory (export "mem") 1 5)
- (data (i32.const 10) "\00\01\02\03\04\05\06\07\08\09")
- @@ -357,14 +357,14 @@
- (i32.load8_u (local.get 0))
- )
- )
- -
- +;)
- (;
- (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
- (memory (import "Mm" "mem") 0)
- (data (i32.const 0xffff) "a")
- @@ -385,7 +385,7 @@
- (memory.grow (local.get 0))
- )
- )
- -
- +;)
- (;
- (assert_return (invoke $Pm "grow" (i32.const 0)) (i32.const 1))
- (assert_return (invoke $Pm "grow" (i32.const 2)) (i32.const 1))
- @@ -396,7 +396,7 @@
- (assert_return (invoke $Pm "grow" (i32.const 1)) (i32.const -1))
- (assert_return (invoke $Pm "grow" (i32.const 0)) (i32.const 5))
- ;)
- -
- +(;
- (assert_unlinkable
- (module
- (func $host (import "spectest" "print"))
- @@ -419,11 +419,12 @@
- )
- "out of bounds memory access"
- )
- +;)
- (;
- (assert_return (invoke $Mm "load" (i32.const 0)) (i32.const 97))
- (assert_return (invoke $Mm "load" (i32.const 327670)) (i32.const 0))
- ;)
- -
- +(;
- (assert_trap
- (module
- (memory (import "Mm" "mem") 1)
- @@ -434,10 +435,11 @@
- )
- "out of bounds table access"
- )
- +;)
- (;
- (assert_return (invoke $Mm "load" (i32.const 0)) (i32.const 97))
- ;)
- -
- +(;
- ;; Store is modified if the start function traps.
- (module $Ms
- (type $t (func (result i32)))
- @@ -451,7 +453,7 @@
- )
- )
- (register "Ms" $Ms)
- -
- +;)
- (;
- (assert_trap
- (module
|