diff options
Diffstat (limited to 'test/passes')
-rw-r--r-- | test/passes/Oz_fuzz-exec_all-features.txt | 91 | ||||
-rw-r--r-- | test/passes/Oz_fuzz-exec_all-features.wast | 79 | ||||
-rw-r--r-- | test/passes/remove-unused-brs_all-features.txt | 44 | ||||
-rw-r--r-- | test/passes/remove-unused-brs_all-features.wast | 44 | ||||
-rw-r--r-- | test/passes/vacuum_all-features.wast | 2 |
5 files changed, 31 insertions, 229 deletions
diff --git a/test/passes/Oz_fuzz-exec_all-features.txt b/test/passes/Oz_fuzz-exec_all-features.txt index f67fc31c3..1d2fe7ed5 100644 --- a/test/passes/Oz_fuzz-exec_all-features.txt +++ b/test/passes/Oz_fuzz-exec_all-features.txt @@ -18,19 +18,10 @@ [LoggingExternalInterface logging 999] [fuzz-exec] calling cast-null-anyref-to-gc [LoggingExternalInterface logging 0] -[fuzz-exec] calling br_on_data -[LoggingExternalInterface logging 1] -[fuzz-exec] calling br_on_non_data-null -[fuzz-exec] calling br_on_non_data-data -[LoggingExternalInterface logging 1] -[fuzz-exec] calling br_on_non_data-other [fuzz-exec] calling br-on_non_null [fuzz-exec] calling br-on_non_null-2 [LoggingExternalInterface logging 1] [trap unreachable] -[fuzz-exec] calling ref-as-data-of-func -[trap not a data] -[fuzz-exec] calling ref-as-data-of-data [fuzz-exec] calling ref-as-func-of-data [trap not a func] [fuzz-exec] calling ref-as-func-of-func @@ -74,7 +65,6 @@ (type $struct (struct (field (mut i32)))) (type $i32_=>_none (func (param i32))) (type $extendedstruct (struct (field (mut i32)) (field f64))) - (type $anyref_=>_none (func (param anyref))) (type $int_func (func (result i32))) (import "fuzzing-support" "log-i32" (func $log (param i32))) (export "structs" (func $0)) @@ -83,26 +73,20 @@ (export "br_on_failed_cast-1" (func $3)) (export "br_on_failed_cast-2" (func $4)) (export "cast-null-anyref-to-gc" (func $5)) - (export "br_on_data" (func $7)) - (export "br_on_non_data-null" (func $8)) - (export "br_on_non_data-data" (func $9)) - (export "br_on_non_data-other" (func $8)) - (export "br-on_non_null" (func $8)) - (export "br-on_non_null-2" (func $12)) - (export "ref-as-data-of-func" (func $13)) - (export "ref-as-data-of-data" (func $8)) - (export "ref-as-func-of-data" (func $13)) - (export "ref-as-func-of-func" (func $8)) - (export "cast-on-func" (func $18)) - (export "array-alloc-failure" (func $8)) - (export "init-array-packed" (func $20)) - (export "cast-func-to-struct" (func $13)) - (export "array-copy" (func $23)) - (export "array.init" (func $24)) - (export "array.init-packed" (func $25)) - (export "static-casts" (func $26)) + (export "br-on_non_null" (func $7)) + (export "br-on_non_null-2" (func $8)) + (export "ref-as-func-of-data" (func $9)) + (export "ref-as-func-of-func" (func $7)) + (export "cast-on-func" (func $12)) + (export "array-alloc-failure" (func $7)) + (export "init-array-packed" (func $14)) + (export "cast-func-to-struct" (func $9)) + (export "array-copy" (func $17)) + (export "array.init" (func $18)) + (export "array.init-packed" (func $19)) + (export "static-casts" (func $20)) (export "static-br_on_cast" (func $2)) - (export "static-br_on_cast_fail" (func $28)) + (export "static-br_on_cast_fail" (func $22)) (func $0 (type $void_func) (; has Stack IR ;) (local $0 i32) (call $log @@ -202,30 +186,10 @@ (i32.const 0) ) ) - (func $7 (type $anyref_=>_none) (; has Stack IR ;) (param $0 anyref) - (drop - (block $data (result (ref data)) - (drop - (br_on_data $data - (local.get $0) - ) - ) - (call $log - (i32.const 1) - ) - (struct.new_default $struct) - ) - ) - ) - (func $8 (type $void_func) (; has Stack IR ;) + (func $7 (type $void_func) (; has Stack IR ;) (nop) ) - (func $9 (type $void_func) (; has Stack IR ;) - (call $log - (i32.const 1) - ) - ) - (func $12 (type $void_func) (; has Stack IR ;) + (func $8 (type $void_func) (; has Stack IR ;) (drop (block (call $log @@ -235,12 +199,12 @@ ) ) ) - (func $13 (type $void_func) (; has Stack IR ;) + (func $9 (type $void_func) (; has Stack IR ;) (drop (unreachable) ) ) - (func $18 (type $void_func) (; has Stack IR ;) + (func $12 (type $void_func) (; has Stack IR ;) (call $log (i32.const 0) ) @@ -252,7 +216,7 @@ ) (unreachable) ) - (func $20 (type $int_func) (; has Stack IR ;) (result i32) + (func $14 (type $int_func) (; has Stack IR ;) (result i32) (array.get_u $bytes (array.new $bytes (i32.const -43) @@ -261,7 +225,7 @@ (i32.const 10) ) ) - (func $23 (type $void_func) (; has Stack IR ;) + (func $17 (type $void_func) (; has Stack IR ;) (local $0 (ref $bytes)) (local $1 (ref $bytes)) (array.set $bytes @@ -316,7 +280,7 @@ ) ) ) - (func $24 (type $void_func) (; has Stack IR ;) + (func $18 (type $void_func) (; has Stack IR ;) (local $0 (ref $bytes)) (call $log (array.len @@ -341,7 +305,7 @@ ) ) ) - (func $25 (type $void_func) (; has Stack IR ;) + (func $19 (type $void_func) (; has Stack IR ;) (call $log (array.get_u $bytes (array.init_static $bytes @@ -351,7 +315,7 @@ ) ) ) - (func $26 (type $void_func) (; has Stack IR ;) + (func $20 (type $void_func) (; has Stack IR ;) (call $log (i32.const 1) ) @@ -371,7 +335,7 @@ (i32.const 0) ) ) - (func $28 (type $void_func) (; has Stack IR ;) + (func $22 (type $void_func) (; has Stack IR ;) (call $log (i32.const -2) ) @@ -397,19 +361,10 @@ [LoggingExternalInterface logging 999] [fuzz-exec] calling cast-null-anyref-to-gc [LoggingExternalInterface logging 0] -[fuzz-exec] calling br_on_data -[LoggingExternalInterface logging 1] -[fuzz-exec] calling br_on_non_data-null -[fuzz-exec] calling br_on_non_data-data -[LoggingExternalInterface logging 1] -[fuzz-exec] calling br_on_non_data-other [fuzz-exec] calling br-on_non_null [fuzz-exec] calling br-on_non_null-2 [LoggingExternalInterface logging 1] [trap unreachable] -[fuzz-exec] calling ref-as-data-of-func -[trap unreachable] -[fuzz-exec] calling ref-as-data-of-data [fuzz-exec] calling ref-as-func-of-data [trap unreachable] [fuzz-exec] calling ref-as-func-of-func diff --git a/test/passes/Oz_fuzz-exec_all-features.wast b/test/passes/Oz_fuzz-exec_all-features.wast index 94bc2aa3c..3d86b9f99 100644 --- a/test/passes/Oz_fuzz-exec_all-features.wast +++ b/test/passes/Oz_fuzz-exec_all-features.wast @@ -153,71 +153,9 @@ ) ) ) - (func $get_data (result dataref) + (func $get_struct (result structref) (struct.new_default $struct) ) - (func "br_on_data" (param $x anyref) - (local $y anyref) - (drop - (block $data (result dataref) - (local.set $y - (br_on_data $data (local.get $x)) - ) - (call $log (i32.const 1)) - (call $get_data) - ) - ) - ) - (func "br_on_non_data-null" - (local $x anyref) - (drop - (block $any (result anyref) - (drop - (br_on_non_data $any (local.get $x)) - ) - ;; $x is a null, and so it is not data, and the branch will be taken, and no - ;; logging will occur. - (call $log (i32.const 1)) - (ref.null any) - ) - ) - ) - (func "br_on_non_data-data" - (local $x anyref) - ;; set x to valid data - (local.set $x - (struct.new_default $struct) - ) - (drop - (block $any (result anyref) - (drop - (br_on_non_data $any (local.get $x)) - ) - ;; $x refers to valid data, and so we will not branch, and will log. - (call $log (i32.const 1)) - (ref.null any) - ) - ) - ) - (func "br_on_non_data-other" - (local $x anyref) - ;; set x to something that is not null, but also not data - (local.set $x - (i31.new - (i32.const 0) - ) - ) - (drop - (block $any (result anyref) - (drop - (br_on_non_data $any (local.get $x)) - ) - ;; $x refers to an i31, so we will branch, and not log - (call $log (i32.const 1)) - (ref.null any) - ) - ) - ) (func "br-on_non_null" (drop (block $non-null (result (ref any)) @@ -239,21 +177,6 @@ ) ) ) - (func "ref-as-data-of-func" - (drop - ;; This should trap. - (ref.as_data - (ref.func $0) - ) - ) - ) - (func "ref-as-data-of-data" - (drop - (ref.as_data - (struct.new_default $struct) - ) - ) - ) (func "ref-as-func-of-data" (drop ;; This should trap. diff --git a/test/passes/remove-unused-brs_all-features.txt b/test/passes/remove-unused-brs_all-features.txt index 4e8e101b2..d833e469e 100644 --- a/test/passes/remove-unused-brs_all-features.txt +++ b/test/passes/remove-unused-brs_all-features.txt @@ -83,26 +83,6 @@ (i32.const 4) ) (drop - (block $data (result (ref $vector)) - (drop - (br $data - (array.new_default $vector - (i32.const 1) - ) - ) - ) - (call $log - (i32.const 5) - ) - (array.new_default $vector - (i32.const 2) - ) - ) - ) - (call $log - (i32.const 6) - ) - (drop (block $i31 (result (ref i31)) (drop (br $i31 @@ -112,7 +92,7 @@ ) ) (call $log - (i32.const 7) + (i32.const 5) ) (i31.new (i32.const 1337) @@ -120,7 +100,7 @@ ) ) (call $log - (i32.const 8) + (i32.const 6) ) (drop (block $non-null (result (ref $ref|func|_=>_none)) @@ -128,7 +108,7 @@ (ref.func $br_on-to-br) ) (call $log - (i32.const 9) + (i32.const 7) ) (ref.func $br_on-to-br) ) @@ -136,24 +116,6 @@ ) (func $br_on-to-flow (type $none_=>_none) (drop - (block $data (result nullref) - (drop - (ref.func $br_on-to-flow) - ) - (ref.null none) - ) - ) - (drop - (block $datab (result nullref) - (drop - (i31.new - (i32.const 1337) - ) - ) - (ref.null none) - ) - ) - (drop (block $func (result nullfuncref) (drop (array.new_default $vector diff --git a/test/passes/remove-unused-brs_all-features.wast b/test/passes/remove-unused-brs_all-features.wast index 56a6ab98f..356616b7b 100644 --- a/test/passes/remove-unused-brs_all-features.wast +++ b/test/passes/remove-unused-brs_all-features.wast @@ -75,23 +75,6 @@ ) (call $log (i32.const 4)) (drop - (block $data (result dataref) - ;; a non-null data reference means we always take the br - (drop - (br_on_data $data - (array.new_default $vector - (i32.const 1) - ) - ) - ) - (call $log (i32.const 5)) - (array.new_default $vector - (i32.const 2) - ) - ) - ) - (call $log (i32.const 6)) - (drop (block $i31 (result i31ref) ;; a non-null i31 reference means we always take the br (drop @@ -99,16 +82,16 @@ (i31.new (i32.const 42)) ) ) - (call $log (i32.const 7)) + (call $log (i32.const 5)) (i31.new (i32.const 1337)) ) ) - (call $log (i32.const 8)) + (call $log (i32.const 6)) (drop (block $non-null (result (ref func)) ;; a non-null reference is not null, and the br is always taken (br_on_non_null $non-null (ref.func $br_on-to-br)) - (call $log (i32.const 9)) + (call $log (i32.const 7)) (ref.func $br_on-to-br) ) ) @@ -117,27 +100,6 @@ ;; a br_on of the obviously incorrect kind can just flow out the value as the ;; break is never taken (func $br_on-to-flow - ;; brs to data - (drop - (block $data (result (ref null data)) - (drop - (br_on_data $data - (ref.func $br_on-to-flow) - ) - ) - (ref.null data) - ) - ) - (drop - (block $datab (result (ref null data)) - (drop - (br_on_data $datab - (i31.new (i32.const 1337)) - ) - ) - (ref.null data) - ) - ) ;; brs to func (drop (block $func (result (ref null func)) diff --git a/test/passes/vacuum_all-features.wast b/test/passes/vacuum_all-features.wast index edf1e019c..c3643e420 100644 --- a/test/passes/vacuum_all-features.wast +++ b/test/passes/vacuum_all-features.wast @@ -802,7 +802,7 @@ (type $A (struct (field (mut i32)))) (func $foo (drop - (block (result dataref) + (block (result structref) ;; this dropped item can be vacuumed out in principle, but it is a non- ;; nullable reference type and we don't have a type to put in its place, so ;; don't try to replace it. (later operations will remove all the body of |