File: string-lowering-imports.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 (92 lines) | stat: -rw-r--r-- 3,316 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.

;; RUN: wasm-opt %s -all --string-lowering-magic-imports --remove-unused-module-elements -S -o - | filecheck %s

;; Text round tripping
;; RUN: wasm-opt %s -all --string-lowering-magic-imports --remove-unused-module-elements -S -o - | wasm-opt -all -S -o - | filecheck %s

;; Binary round tripping
;; RUN: wasm-opt %s -all --string-lowering-magic-imports --remove-unused-module-elements --roundtrip -S -o - | filecheck %s --check-prefix=RTRIP


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

  ;; CHECK:      (import "\'" "bar" (global $"string.const_\"bar\"" (ref extern)))

  ;; CHECK:      (import "\'" "foo" (global $"string.const_\"foo\"" (ref extern)))

  ;; CHECK:      (import "\'" "needs\tescaping\00.\'#%- .\r\n\\08\0c\n\r\t.\ea\99\ae" (global $"string.const_\"needs\\tescaping\\00.\\\'#%- .\\r\\n\\\\08\\0c\\n\\r\\t.\\ea\\99\\ae\"" (ref extern)))

  ;; CHECK:      (import "string.const" "0" (global $"string.const_\"unpaired high surrogate \\ed\\a0\\80 \"" (ref extern)))

  ;; CHECK:      (import "string.const" "1" (global $"string.const_\"unpaired low surrogate \\ed\\bd\\88 \"" (ref extern)))

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

  ;; CHECK:      (func $consts (type $0)
  ;; CHECK-NEXT:  (drop
  ;; CHECK-NEXT:   (global.get $"string.const_\"foo\"")
  ;; CHECK-NEXT:  )
  ;; CHECK-NEXT:  (drop
  ;; CHECK-NEXT:   (global.get $"string.const_\"bar\"")
  ;; CHECK-NEXT:  )
  ;; CHECK-NEXT:  (drop
  ;; CHECK-NEXT:   (global.get $"string.const_\"needs\\tescaping\\00.\\\'#%- .\\r\\n\\\\08\\0c\\n\\r\\t.\\ea\\99\\ae\"")
  ;; CHECK-NEXT:  )
  ;; CHECK-NEXT:  (drop
  ;; CHECK-NEXT:   (global.get $"string.const_\"unpaired high surrogate \\ed\\a0\\80 \"")
  ;; CHECK-NEXT:  )
  ;; CHECK-NEXT:  (drop
  ;; CHECK-NEXT:   (global.get $"string.const_\"unpaired low surrogate \\ed\\bd\\88 \"")
  ;; CHECK-NEXT:  )
  ;; CHECK-NEXT: )
  ;; RTRIP:      (type $0 (func))

  ;; RTRIP:      (import "\'" "bar" (global $gimport$0 (ref extern)))

  ;; RTRIP:      (import "\'" "foo" (global $gimport$1 (ref extern)))

  ;; RTRIP:      (import "\'" "needs\tescaping\00.\'#%- .\r\n\\08\0c\n\r\t.\ea\99\ae" (global $gimport$2 (ref extern)))

  ;; RTRIP:      (import "string.const" "0" (global $gimport$3 (ref extern)))

  ;; RTRIP:      (import "string.const" "1" (global $gimport$4 (ref extern)))

  ;; RTRIP:      (export "consts" (func $consts))

  ;; RTRIP:      (func $consts (type $0)
  ;; RTRIP-NEXT:  (drop
  ;; RTRIP-NEXT:   (global.get $gimport$1)
  ;; RTRIP-NEXT:  )
  ;; RTRIP-NEXT:  (drop
  ;; RTRIP-NEXT:   (global.get $gimport$0)
  ;; RTRIP-NEXT:  )
  ;; RTRIP-NEXT:  (drop
  ;; RTRIP-NEXT:   (global.get $gimport$2)
  ;; RTRIP-NEXT:  )
  ;; RTRIP-NEXT:  (drop
  ;; RTRIP-NEXT:   (global.get $gimport$3)
  ;; RTRIP-NEXT:  )
  ;; RTRIP-NEXT:  (drop
  ;; RTRIP-NEXT:   (global.get $gimport$4)
  ;; RTRIP-NEXT:  )
  ;; RTRIP-NEXT: )
  (func $consts (export "consts")
    (drop
      (string.const "foo")
    )
    (drop
      (string.const "bar")
    )
    (drop
      (string.const "needs\tescaping\00.'#%- .\r\n\\08\0C\0A\0D\09.ꙮ")
    )
    (drop
      (string.const "unpaired high surrogate \ED\A0\80 ")
    )
    (drop
      (string.const "unpaired low surrogate \ED\BD\88 ")
    )
  )
)