|
7 | 7 | (module |
8 | 8 | ;; CHECK: (type $0 (array (mut i16))) |
9 | 9 |
|
10 | | - ;; CHECK: (type $1 (func (param externref externref) (result i32))) |
| 10 | + ;; CHECK: (type $1 (func)) |
11 | 11 |
|
12 | | - ;; CHECK: (type $2 (func)) |
| 12 | + ;; CHECK: (type $2 (func (param externref externref) (result i32))) |
13 | 13 |
|
14 | 14 | ;; CHECK: (type $3 (func (param (ref null $0) i32 i32) (result (ref extern)))) |
15 | 15 |
|
|
29 | 29 |
|
30 | 30 | ;; CHECK: (import "string.const" "1" (global $"string.const_\"foo\"" (ref extern))) |
31 | 31 |
|
| 32 | + ;; CHECK: (import "string.const" "2" (global $"string.const_\"needs\\tescaping\\00.\\\'#%\\\"\"" (ref extern))) |
| 33 | + |
32 | 34 | ;; CHECK: (import "wasm:js-string" "fromCharCodeArray" (func $fromCharCodeArray (type $3) (param (ref null $0) i32 i32) (result (ref extern)))) |
33 | 35 |
|
34 | 36 | ;; CHECK: (import "wasm:js-string" "fromCodePoint" (func $fromCodePoint (type $4) (param i32) (result (ref extern)))) |
|
37 | 39 |
|
38 | 40 | ;; CHECK: (import "wasm:js-string" "intoCharCodeArray" (func $intoCharCodeArray (type $6) (param externref (ref null $0) i32) (result i32))) |
39 | 41 |
|
40 | | - ;; CHECK: (import "wasm:js-string" "equals" (func $equals (type $1) (param externref externref) (result i32))) |
| 42 | + ;; CHECK: (import "wasm:js-string" "equals" (func $equals (type $2) (param externref externref) (result i32))) |
41 | 43 |
|
42 | | - ;; CHECK: (import "wasm:js-string" "compare" (func $compare (type $1) (param externref externref) (result i32))) |
| 44 | + ;; CHECK: (import "wasm:js-string" "compare" (func $compare (type $2) (param externref externref) (result i32))) |
43 | 45 |
|
44 | 46 | ;; CHECK: (import "wasm:js-string" "length" (func $length (type $7) (param externref) (result i32))) |
45 | 47 |
|
46 | 48 | ;; CHECK: (import "wasm:js-string" "charCodeAt" (func $charCodeAt (type $8) (param externref i32) (result i32))) |
47 | 49 |
|
48 | 50 | ;; CHECK: (import "wasm:js-string" "substring" (func $substring (type $9) (param externref i32 i32) (result (ref extern)))) |
49 | 51 |
|
50 | | - ;; CHECK: (func $consts (type $2) |
| 52 | + ;; CHECK: (func $consts (type $1) |
51 | 53 | ;; CHECK-NEXT: (drop |
52 | 54 | ;; CHECK-NEXT: (string.const "foo") |
53 | 55 | ;; CHECK-NEXT: ) |
|
71 | 73 | (drop |
72 | 74 | (string.const "foo") |
73 | 75 | ) |
74 | | - ;; TODO: test utf-8 etc. |
| 76 | + ) |
| 77 | + |
| 78 | + ;; CHECK: (func $tricky-consts (type $1) |
| 79 | + ;; CHECK-NEXT: (drop |
| 80 | + ;; CHECK-NEXT: (string.const "needs\tescaping\00.\'#%\"") |
| 81 | + ;; CHECK-NEXT: ) |
| 82 | + ;; CHECK-NEXT: ) |
| 83 | + (func $tricky-consts |
| 84 | + ;; This tricky string should remain exactly the same after lowering and |
| 85 | + ;; lifting. |
| 86 | + (drop |
| 87 | + (string.const "needs\tescaping\00.'#%\"") |
| 88 | + ) |
75 | 89 | ) |
76 | 90 | ) |
77 | 91 |
|
0 commit comments