File: data_drop.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 (38 lines) | stat: -rw-r--r-- 1,159 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
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
;; RUN: wasm-ctor-eval %s --ctors=test --kept-exports=test --quiet -all -S -o - | filecheck %s

(module
  ;; CHECK:      (type $0 (func))

  ;; CHECK:      (memory $0 1)
  (memory $0 1)
  (data (i32.const 0) "__________")
  (data (i32.const 20) "__________")

  ;; CHECK:      (data $0 (i32.const 0) "__________")

  ;; CHECK:      (data $1 (i32.const 20) "__________")

  ;; CHECK:      (export "test" (func $test))

  ;; CHECK:      (func $test (type $0)
  ;; CHECK-NEXT:  (i32.store8
  ;; CHECK-NEXT:   (i32.const 4)
  ;; CHECK-NEXT:   (i32.const 100)
  ;; CHECK-NEXT:  )
  ;; CHECK-NEXT:  (data.drop $1)
  ;; CHECK-NEXT: )
  (func $test (export "test")
    ;; A store that can be evalled, but we do not do so because of the
    ;; instruction after us.
    (i32.store8
      (i32.const 4)
      (i32.const 100)
    )

    ;; A memory init cannot be evalled since ctor-eval flattens memory segments
    ;; atm. In fact the module would not validate as we refer to segment 1 here
    ;; but after flattening only segment 0 exists.
    (data.drop 1)
  )
)