File: duplicate-function-elimination_all-features.wast

package info (click to toggle)
binaryen 99-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 31,352 kB
  • sloc: cpp: 134,831; javascript: 61,839; ansic: 12,369; python: 4,620; pascal: 441; sh: 72; asm: 27; makefile: 6
file content (23 lines) | stat: -rw-r--r-- 542 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
;; --duplicate-function-elimination should not remove functions used in ref.func.
(module
  (func $0 (result i32)
    (i32.const 0)
  )
  (func $1 (result i32)
    (i32.const 0)
  )
  (func $test (result funcref)
    (ref.func $1)
  )
)
;; renaming after deduplication must only affect functions
(module
 (memory $foo 16 16)
 (global $bar i32 (i32.const 0))
 (export "memory" (memory $foo))
 (export "global" (global $bar))
 (func $bar ;; happens to share a name with the global
 )
 (func $foo ;; happens to share a name with the memory
 )
)