File: em_asm_partial.wat

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 (24 lines) | stat: -rw-r--r-- 1,010 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
;; Test that em_asm string are extraced correctly when the __start_em_asm
;; and __stop_em_asm globals are exported.

;; RUN: wasm-emscripten-finalize %s -S | filecheck %s

;; Check for the case when __start_em_asm and __stop_em_asm don't define an
;; entire segment. In this case we preserve the segment but zero the data.

;; CHECK: (data (i32.const 512) "xx\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00yy")

;; CHECK:       "asmConsts": {
;; CHECK-NEXT:     "514": "{ console.log('JS hello'); }",
;; CHECK-NEXT:     "543": "{ console.log('hello again'); }"
;; CHECK-NEXT:   },

;; Check that the exports are removed
;; CHECK-NOT: export

(module
 (memory 1 1)
 (global (export "__start_em_asm") i32 (i32.const 514))
 (global (export "__stop_em_asm") i32 (i32.const 575))
 (data (i32.const 512) "xx{ console.log('JS hello'); }\00{ console.log('hello again'); }\00yy")
)