File: extended-const.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 (24 lines) | stat: -rw-r--r-- 835 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 shared memory requires atomics

;; RUN: not wasm-opt %s 2>&1 | filecheck %s --check-prefix NO-EXTENDED
;; RUN: wasm-opt %s --enable-extended-const -o - -S | filecheck %s --check-prefix EXTENDED

;; NO-EXTENDED: unexpected false: global init must be valid
;; NO-EXTENDED: unexpected false: memory segment offset should be reasonable

;; EXTENDED: (import "env" "global" (global $gimport$0 i32))
;; EXTENDED: (global $1 i32 (i32.add
;; EXTENDED:  (global.get $gimport$0)
;; EXTENDED:  (i32.const 42)
;; EXTENDED: ))
;; EXTENDED: (data (i32.sub
;; EXTENDED:  (global.get $gimport$0)
;; EXTENDED:  (i32.const 10)
;; EXTENDED: ) "hello world")

(module
  (memory 1 1)
  (import "env" "global" (global i32))
  (global i32 (i32.add (global.get 0) (i32.const 42)))
  (data (i32.sub (global.get 0) (i32.const 10)) "hello world")
)