File: nominal-bad.wast

package info (click to toggle)
binaryen 108-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 35,424 kB
  • sloc: cpp: 151,487; javascript: 62,522; ansic: 13,124; python: 5,260; pascal: 441; sh: 75; asm: 27; makefile: 8
file content (29 lines) | stat: -rw-r--r-- 759 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
;; RUN: not wasm-opt %s -all --nominal -S -o - 2>&1 | filecheck %s

;; CHECK: [wasm-validator error in function make-super-struct] function body type must match
;; CHECK: [wasm-validator error in function make-super-array] function body type must match

(module

  (type $sub-struct (struct i32 i64))
  (type $super-struct (struct i32))

  (type $sub-array (array (ref $sub-struct)))
  (type $super-array (array (ref $super-struct)))

  (func $make-sub-struct (result (ref $sub-struct))
    (unreachable)
  )

  (func $make-super-struct (result (ref $super-struct))
    (call $make-sub-struct)
  )

  (func $make-sub-array (result (ref $sub-array))
    (unreachable)
  )

  (func $make-super-array (result (ref $super-array))
    (call $make-sub-array)
  )
)