diff options
Diffstat (limited to 'test/lit')
-rw-r--r-- | test/lit/passes/string-lowering.wast | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/test/lit/passes/string-lowering.wast b/test/lit/passes/string-lowering.wast index 43d30fc64..f7f47871b 100644 --- a/test/lit/passes/string-lowering.wast +++ b/test/lit/passes/string-lowering.wast @@ -14,7 +14,19 @@ (string.const "foo") ) (drop - (string.const "needs\tescaping\00.'#%\"- .\r\n\\.ꙮ") + (string.const "needs\tescaping\00.'#%\"- .\r\n\\08\0C\0A\0D\09.ꙮ") + ) + (drop + (string.const "invalid WTF-8 leading byte \FF") + ) + (drop + (string.const "invalid trailing byte \C0\00") + ) + (drop + (string.const "unexpected end \C0") + ) + (drop + (string.const "invalid surrogate sequence \ED\A0\81\ED\B0\B7") ) ) ) @@ -24,7 +36,7 @@ ;; ;; RUN: wasm-opt %s --string-lowering -all -S -o - | filecheck %s ;; -;; CHECK: custom section "string.consts", size 59, contents: "[\"bar\",\"foo\",\"needs\\tescaping\\u0000.'#%\\\"- .\\r\\n\\\\.\\ua66e\"]" +;; CHECK: custom section "string.consts", size 202, contents: "[\"bar\",\"foo\",\"invalid WTF-8 leading byte \\ufffd\",\"invalid surrogate sequence \\ud801\\udc37\",\"invalid trailing byte \\ufffd\",\"needs\\tescaping\\u0000.'#%\\\"- .\\r\\n\\\\08\\f\\n\\r\\t.\\ua66e\",\"unexpected end \\ufffd\"]" ;; The custom section should parse OK using JSON.parse from node. ;; (Note we run --remove-unused-module-elements to remove externref-using @@ -33,6 +45,5 @@ ;; RUN: wasm-opt %s --string-lowering --remove-unused-module-elements -all -o %t.wasm ;; RUN: node %S/string-lowering.js %t.wasm | filecheck %s --check-prefix=CHECK-JS ;; -;; CHECK-JS: string: ["bar","foo","needs\tescaping\x00.'#%\"- .\r\n\\.\ua66e"] -;; CHECK-JS: JSON: ["bar","foo","needs\tescaping\x00.'#%\"- .\r\n\\.ꙮ"] - +;; CHECK-JS: string: ["bar","foo","invalid WTF-8 leading byte \ufffd","invalid surrogate sequence \ud801\udc37","invalid trailing byte \ufffd","needs\tescaping\x00.'#%\"- .\r\n\\08\f\n\r\t.\ua66e","unexpected end \ufffd"] +;; CHECK-JS: JSON: ["bar","foo","invalid WTF-8 leading byte �","invalid surrogate sequence 𐐷","invalid trailing byte �","needs\tescaping\x00.'#%\"- .\r\n\\08\f\n\r\t.ꙮ","unexpected end �"] |