File: no-active-segment.wast

package info (click to toggle)
binaryen 120-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 41,284 kB
  • sloc: cpp: 189,449; javascript: 62,189; ansic: 14,087; python: 5,379; pascal: 441; sh: 77; makefile: 30; asm: 27
file content (41 lines) | stat: -rw-r--r-- 1,154 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
36
37
38
39
40
41
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.

;; Test that splitting succeeds even if there are no active segments for the function table.

;; RUN: wasm-split %s --split-funcs=foo -g -o1 %t.1.wasm -o2 %t.2.wasm
;; RUN: wasm-dis %t.1.wasm | filecheck %s --check-prefix PRIMARY
;; RUN: wasm-dis %t.2.wasm | filecheck %s --check-prefix SECONDARY

(module
 (table 0 funcref)
 (export "foo" (func $foo))
 ;; SECONDARY:      (type $0 (func))

 ;; SECONDARY:      (import "primary" "table" (table $timport$0 1 funcref))

 ;; SECONDARY:      (elem $0 (i32.const 0) $foo)

 ;; SECONDARY:      (func $foo
 ;; SECONDARY-NEXT:  (nop)
 ;; SECONDARY-NEXT: )
 (func $foo
  (nop)
 )
)
;; PRIMARY:      (type $0 (func))

;; PRIMARY:      (import "placeholder" "0" (func $placeholder_0))

;; PRIMARY:      (table $0 1 funcref)

;; PRIMARY:      (elem $0 (i32.const 0) $placeholder_0)

;; PRIMARY:      (export "foo" (func $0))

;; PRIMARY:      (export "table" (table $0))

;; PRIMARY:      (func $0
;; PRIMARY-NEXT:  (call_indirect (type $0)
;; PRIMARY-NEXT:   (i32.const 0)
;; PRIMARY-NEXT:  )
;; PRIMARY-NEXT: )