File: nominal-chain.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 (35 lines) | stat: -rw-r--r-- 1,228 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
30
31
32
33
34
35
;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.
;; RUN: wasm-opt %s -all --nominal -S -o - | filecheck %s
;; RUN: wasm-opt %s -all --nominal --roundtrip -S -o - | filecheck %s

;; Check that intermediate types in subtype chains are also included in the
;; output module, even if there are no other references to those intermediate
;; types.

(module
  ;; CHECK:      (type $root (struct_subtype  data))

  ;; CHECK:      (type $trunk (struct_subtype (field i32) $root))

  ;; CHECK:      (type $branch (struct_subtype (field i32) (field i64) $trunk))

  ;; CHECK:      (type $twig (struct_subtype (field i32) (field i64) (field f32) $branch))

  ;; CHECK:      (type $leaf (struct_subtype (field i32) (field i64) (field f32) (field f64) $twig))
  (type $leaf (struct_subtype i32 i64 f32 f64 $twig))

  (type $twig (struct_subtype i32 i64 f32 $branch))

  (type $branch (struct_subtype i32 i64 $trunk))

  (type $trunk (struct_subtype i32 $root))

  (type $root (struct))

  ;; CHECK:      (func $make-root (type $none_=>_ref?|$root|) (result (ref null $root))
  ;; CHECK-NEXT:  (ref.null $leaf)
  ;; CHECK-NEXT: )
  (func $make-root (result (ref null $root))
    (ref.null $leaf)
  )
)