diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ctor-eval/imported-min.wast | 47 | ||||
-rw-r--r-- | test/ctor-eval/imported-min.wast.ctors | 1 | ||||
-rw-r--r-- | test/ctor-eval/imported-min.wast.out | 2 | ||||
-rw-r--r-- | test/ctor-eval/imported.wast | 45 | ||||
-rw-r--r-- | test/ctor-eval/imported.wast.ctors | 1 | ||||
-rw-r--r-- | test/ctor-eval/imported.wast.out | 2 | ||||
-rw-r--r-- | test/ctor-eval/stack-direction.wast | 30 | ||||
-rw-r--r-- | test/ctor-eval/stack-direction.wast.ctors | 1 | ||||
-rw-r--r-- | test/ctor-eval/stack-direction.wast.out | 2 |
9 files changed, 0 insertions, 131 deletions
diff --git a/test/ctor-eval/imported-min.wast b/test/ctor-eval/imported-min.wast deleted file mode 100644 index 48608d526..000000000 --- a/test/ctor-eval/imported-min.wast +++ /dev/null @@ -1,47 +0,0 @@ -(module - (memory 256 256) - (data (i32.const 10) "waka waka waka waka waka") - ;; stack imports are special - (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) - (import "env" "STACK_MAX" (global $STACK_MAX$asm2wasm$import i32)) - (import "env" "tempDoublePtr" (global $tempDoublePtr i32)) - (global $tempDoublePtrMut (mut i32) (global.get $tempDoublePtr)) - (export "test1" $test1) - (export "test2" $test2) - (export "test3" $test3) - ;; ok to modify a global, if we keep it the same value - (global $mine (mut i32) (i32.const 1)) - ;; stack imports are ok to use. their uses are the same as other - ;; globals - must keep the same value (which means, unwind the stack) - ;; here the global names are "minified" - (global $global0 (mut i32) (global.get $STACKTOP$asm2wasm$import)) - (global $global1 (mut i32) (global.get $STACK_MAX$asm2wasm$import)) - ;; a global initialized by an import, so bad, but ok if not used - (global $do-not-use (mut i32) (global.get $tempDoublePtr)) - (func $test1 - (local $temp i32) - (global.set $mine (i32.const 1)) - (local.set $temp (global.get $global0)) - (global.set $global0 (i32.const 1337)) ;; bad - (global.set $global0 (local.get $temp)) ;; save us - (global.set $global1 (i32.const 913370)) ;; bad - (global.set $global1 (local.get $temp)) ;; save us - ;; use the stack memory - (i32.store (local.get $temp) (i32.const 1337)) - (if - (i32.ne - (i32.load (local.get $temp)) - (i32.const 1337) - ) - (unreachable) ;; they should be equal, never get here - ) - ;; finally, do a valid store - (i32.store8 (i32.const 12) (i32.const 115)) - ) - (func $test2 - (i32.store8 (i32.const 13) (i32.const 115)) - ) - (func $test3 - (i32.store8 (i32.const 14) (i32.const 115)) - ) -) diff --git a/test/ctor-eval/imported-min.wast.ctors b/test/ctor-eval/imported-min.wast.ctors deleted file mode 100644 index c7060ede5..000000000 --- a/test/ctor-eval/imported-min.wast.ctors +++ /dev/null @@ -1 +0,0 @@ -test1,test2,test3 diff --git a/test/ctor-eval/imported-min.wast.out b/test/ctor-eval/imported-min.wast.out deleted file mode 100644 index 4427f36e0..000000000 --- a/test/ctor-eval/imported-min.wast.out +++ /dev/null @@ -1,2 +0,0 @@ -(module -) diff --git a/test/ctor-eval/imported.wast b/test/ctor-eval/imported.wast deleted file mode 100644 index 96cf837c3..000000000 --- a/test/ctor-eval/imported.wast +++ /dev/null @@ -1,45 +0,0 @@ -(module - (memory 256 256) - (data (i32.const 10) "waka waka waka waka waka") - ;; stack imports are special - (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) - (import "env" "STACK_MAX" (global $STACK_MAX$asm2wasm$import i32)) - ;; other imports must not be touched! - (import "env" "tempDoublePtr" (global $tempDoublePtr i32)) - (global $tempDoublePtrMut (mut i32) (global.get $tempDoublePtr)) - (export "test1" $test1) - (export "test2" $test2) - (export "test3" $test3) - ;; ok to modify a global, if we keep it the same value - (global $mine (mut i32) (i32.const 1)) - ;; stack imports are ok to use. their uses are the same as other - ;; globals - must keep the same value (which means, unwind the stack) - (global $STACKTOP (mut i32) (global.get $STACKTOP$asm2wasm$import)) - (global $STACK_MAX (mut i32) (global.get $STACK_MAX$asm2wasm$import)) - ;; a global initialized by an import, so bad, but ok if not used - (global $do-not-use (mut i32) (global.get $tempDoublePtr)) - (func $test1 - (local $temp i32) - (global.set $mine (i32.const 1)) - (local.set $temp (global.get $STACKTOP)) - (global.set $STACKTOP (i32.const 1337)) ;; bad - (global.set $STACKTOP (local.get $temp)) ;; save us - ;; use the stack memory - (i32.store (local.get $temp) (i32.const 1337)) - (if - (i32.ne - (i32.load (local.get $temp)) - (i32.const 1337) - ) - (unreachable) ;; they should be equal, never get here - ) - ;; finally, do a valid store - (i32.store8 (i32.const 12) (i32.const 115)) - ) - (func $test2 - (i32.store8 (i32.const 13) (i32.const 115)) - ) - (func $test3 - (i32.store8 (i32.const 14) (i32.const 115)) - ) -) diff --git a/test/ctor-eval/imported.wast.ctors b/test/ctor-eval/imported.wast.ctors deleted file mode 100644 index c7060ede5..000000000 --- a/test/ctor-eval/imported.wast.ctors +++ /dev/null @@ -1 +0,0 @@ -test1,test2,test3 diff --git a/test/ctor-eval/imported.wast.out b/test/ctor-eval/imported.wast.out deleted file mode 100644 index 4427f36e0..000000000 --- a/test/ctor-eval/imported.wast.out +++ /dev/null @@ -1,2 +0,0 @@ -(module -) diff --git a/test/ctor-eval/stack-direction.wast b/test/ctor-eval/stack-direction.wast deleted file mode 100644 index 38465557e..000000000 --- a/test/ctor-eval/stack-direction.wast +++ /dev/null @@ -1,30 +0,0 @@ -(module - (type $0 (func)) - (import "env" "memory" (memory $1 256 256)) - (import "env" "STACKTOP" (global $gimport$0 i32)) - (global $global$0 (mut i32) (global.get $gimport$0)) - (export "__post_instantiate" (func $0)) - ;; if the stack goes **down**, this may seem to write to memory we care about - (func $0 (; 0 ;) (type $0) - (local $0 i32) - (i32.store offset=12 - (local.tee $0 - (i32.sub - (global.get $global$0) - (i32.const 16) - ) - ) - (i32.const 10) - ) - (i32.store offset=12 - (local.get $0) - (i32.add - (i32.load offset=12 - (local.get $0) - ) - (i32.const 1) - ) - ) - ) -) - diff --git a/test/ctor-eval/stack-direction.wast.ctors b/test/ctor-eval/stack-direction.wast.ctors deleted file mode 100644 index a9d301395..000000000 --- a/test/ctor-eval/stack-direction.wast.ctors +++ /dev/null @@ -1 +0,0 @@ -__post_instantiate diff --git a/test/ctor-eval/stack-direction.wast.out b/test/ctor-eval/stack-direction.wast.out deleted file mode 100644 index 4427f36e0..000000000 --- a/test/ctor-eval/stack-direction.wast.out +++ /dev/null @@ -1,2 +0,0 @@ -(module -) |