| ;; NOTE: Assertions have been generated by update_lit_checks.py --output=fuzz-exec and should not be edited. |
| |
| ;; RUN: wasm-opt %s -all --fuzz-exec-before -q -o /dev/null 2>&1 | filecheck %s |
| |
| (module |
| (tag $A (param (ref $A))) |
| (tag $B (param (ref $B))) |
| |
| (type $A (array (field (mut i32)))) |
| |
| (type $B (struct (field (mut anyref)))) |
| |
| ;; CHECK: [fuzz-exec] export array |
| ;; CHECK-NEXT: [exception thrown: A object(null)] |
| (func $array (export "array") (result (ref $A)) |
| ;; Throw a very large array. We should not print all 12K items in it, as that |
| ;; would be very verbose. Instead we print exactly what fuzz_shel.js would |
| ;; print. |
| (throw $A |
| (array.new_default $A |
| (i32.const 12345) |
| ) |
| ) |
| ) |
| |
| ;; CHECK: [fuzz-exec] export struct |
| ;; CHECK-NEXT: [exception thrown: B object(null)] |
| (func $struct (export "struct") (result (ref $B)) |
| (local $x (ref $B)) |
| ;; As above, but now with a recursive struct. |
| (local.set $x |
| (struct.new_default $B) |
| ) |
| (struct.set $B 0 |
| (local.get $x) |
| (local.get $x) |
| ) |
| (throw $B |
| (local.get $x) |
| ) |
| ) |
| ) |