File: data-names.test

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 (25 lines) | stat: -rw-r--r-- 834 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
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
;; RUN: wasm-opt -all %s.wasm -q -S -o - | filecheck %s

;; Test that data segment names roundtrip properly. The wasm file contains
;;
;; (module
;;   (memory $mem 10)
;;   (data $passive1 "passive1")
;;   (data $passive2 "passive2")
;;   (data $active1 (offset i32.const 0) "active1")
;;   (data $active2 (offset i32.const 0) "active2")
;; )
;;
;; But the names section is *reversed*: the name of the last data segment is
;; first, and so forth. We must still give the proper segments their names.

;; CHECK:      (memory $mem 10)

;; CHECK:      (data $passive1 "passive1")

;; CHECK:      (data $passive2 "passive2")

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

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