summaryrefslogtreecommitdiff
path: root/test/passes
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes')
-rw-r--r--test/passes/Oz_fuzz-exec_all-features.txt35
-rw-r--r--test/passes/Oz_fuzz-exec_all-features.wast22
2 files changed, 57 insertions, 0 deletions
diff --git a/test/passes/Oz_fuzz-exec_all-features.txt b/test/passes/Oz_fuzz-exec_all-features.txt
index 329853ae2..4ac373f75 100644
--- a/test/passes/Oz_fuzz-exec_all-features.txt
+++ b/test/passes/Oz_fuzz-exec_all-features.txt
@@ -61,6 +61,10 @@
[LoggingExternalInterface logging 1]
[LoggingExternalInterface logging 0]
[LoggingExternalInterface logging 1]
+[fuzz-exec] calling array.init
+[LoggingExternalInterface logging 2]
+[LoggingExternalInterface logging 42]
+[LoggingExternalInterface logging 50]
(module
(type $extendedstruct (struct (field (mut i32)) (field f64)))
(type $struct (struct (field (mut i32))))
@@ -90,6 +94,7 @@
(export "cast-func-to-struct" (func $19))
(export "array-copy" (func $20))
(export "rtt_Fresh" (func $21))
+ (export "array.init" (func $22))
(func $0 (; has Stack IR ;)
(local $0 i32)
(call $log
@@ -456,6 +461,32 @@
)
)
)
+ (func $22 (; has Stack IR ;)
+ (local $0 (ref null $bytes))
+ (call $log
+ (array.len $bytes
+ (local.tee $0
+ (array.init $bytes
+ (i32.const 42)
+ (i32.const 50)
+ (rtt.canon $bytes)
+ )
+ )
+ )
+ )
+ (call $log
+ (array.get_u $bytes
+ (local.get $0)
+ (i32.const 0)
+ )
+ )
+ (call $log
+ (array.get_u $bytes
+ (local.get $0)
+ (i32.const 1)
+ )
+ )
+ )
)
[fuzz-exec] calling structs
[LoggingExternalInterface logging 0]
@@ -519,6 +550,10 @@
[LoggingExternalInterface logging 1]
[LoggingExternalInterface logging 0]
[LoggingExternalInterface logging 1]
+[fuzz-exec] calling array.init
+[LoggingExternalInterface logging 2]
+[LoggingExternalInterface logging 42]
+[LoggingExternalInterface logging 50]
ignoring comparison of ExecutionResults!
[fuzz-exec] calling foo
[host limit allocation failure]
diff --git a/test/passes/Oz_fuzz-exec_all-features.wast b/test/passes/Oz_fuzz-exec_all-features.wast
index 520747075..a41e2bf70 100644
--- a/test/passes/Oz_fuzz-exec_all-features.wast
+++ b/test/passes/Oz_fuzz-exec_all-features.wast
@@ -475,6 +475,28 @@
)
)
)
+ (func "array.init"
+ (local $x (ref null $bytes))
+ (local.set $x
+ (array.init $bytes
+ (i32.const 42) ;; first value
+ (i32.const 50) ;; second value
+ (rtt.canon $bytes)
+ )
+ )
+ ;; The length should be 2
+ (call $log
+ (array.len $bytes (local.get $x))
+ )
+ ;; The first value should be 42
+ (call $log
+ (array.get_u $bytes (local.get $x) (i32.const 0))
+ )
+ ;; The second value should be 50
+ (call $log
+ (array.get_u $bytes (local.get $x) (i32.const 1))
+ )
+ )
)
(module
(type $[mut:i8] (array (mut i8)))