diff options
author | Thomas Lively <tlively@google.com> | 2024-05-15 12:07:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-15 12:07:34 -0700 |
commit | 6b43a5ef76149c92e216fddb0a1ee17f736b4b6e (patch) | |
tree | 7b2deb1e6924ba8f74e0b25c26cf2d9a63ad610a /test/example | |
parent | ef4b57c2a491a2193435dccdc9305f6a79965715 (diff) | |
download | binaryen-6b43a5ef76149c92e216fddb0a1ee17f736b4b6e.tar.gz binaryen-6b43a5ef76149c92e216fddb0a1ee17f736b4b6e.tar.bz2 binaryen-6b43a5ef76149c92e216fddb0a1ee17f736b4b6e.zip |
[Strings] Remove operations not included in imported strings (#6589)
The stringref proposal has been superseded by the imported JS strings proposal,
but the former has many more operations than the latter. To reduce complexity,
remove all operations that are part of stringref but not part of imported
strings.
Diffstat (limited to 'test/example')
-rw-r--r-- | test/example/c-api-kitchen-sink.c | 117 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 99 |
2 files changed, 4 insertions, 212 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c index 1b78ea1e7..5fb71b4d6 100644 --- a/test/example/c-api-kitchen-sink.c +++ b/test/example/c-api-kitchen-sink.c @@ -1170,82 +1170,17 @@ void test_core() { makeInt32(module, 2)), // Strings BinaryenStringNew(module, - BinaryenStringNewUTF8(), - makeInt32(module, 0), - makeInt32(module, 0), - 0, - 0, - false), - BinaryenStringNew(module, - BinaryenStringNewUTF8(), - makeInt32(module, 0), - makeInt32(module, 0), - 0, - 0, - true), - BinaryenStringNew(module, - BinaryenStringNewWTF8(), - makeInt32(module, 0), - makeInt32(module, 0), - 0, - 0, - false), - BinaryenStringNew(module, - BinaryenStringNewLossyUTF8(), - makeInt32(module, 0), - makeInt32(module, 0), - 0, - 0, - false), - BinaryenStringNew(module, - BinaryenStringNewWTF16(), - makeInt32(module, 0), - makeInt32(module, 0), - 0, - 0, - false), - BinaryenStringNew(module, - BinaryenStringNewUTF8Array(), - BinaryenGlobalGet(module, "i8Array-global", i8Array), - 0, - makeInt32(module, 0), - makeInt32(module, 0), - false), - BinaryenStringNew(module, - BinaryenStringNewUTF8Array(), - BinaryenGlobalGet(module, "i8Array-global", i8Array), - 0, - makeInt32(module, 0), - makeInt32(module, 0), - true), - BinaryenStringNew(module, - BinaryenStringNewWTF8Array(), - BinaryenGlobalGet(module, "i8Array-global", i8Array), - 0, - makeInt32(module, 0), - makeInt32(module, 0), - false), - BinaryenStringNew(module, BinaryenStringNewLossyUTF8Array(), BinaryenGlobalGet(module, "i8Array-global", i8Array), - 0, - makeInt32(module, 0), makeInt32(module, 0), - false), + makeInt32(module, 0)), BinaryenStringNew(module, BinaryenStringNewWTF16Array(), BinaryenGlobalGet(module, "i16Array-global", i8Array), - 0, - makeInt32(module, 0), makeInt32(module, 0), - false), - BinaryenStringNew(module, - BinaryenStringNewFromCodePoint(), - makeInt32(module, 1), - 0, - 0, - 0, - false), + makeInt32(module, 0)), + BinaryenStringNew( + module, BinaryenStringNewFromCodePoint(), makeInt32(module, 1), 0, 0), BinaryenStringConst(module, "hello world"), BinaryenStringMeasure( module, @@ -1253,46 +1188,8 @@ void test_core() { BinaryenGlobalGet(module, "string-global", BinaryenTypeStringref())), BinaryenStringMeasure( module, - BinaryenStringMeasureWTF8(), - BinaryenGlobalGet(module, "string-global", BinaryenTypeStringref())), - BinaryenStringMeasure( - module, BinaryenStringMeasureWTF16(), BinaryenGlobalGet(module, "string-global", BinaryenTypeStringref())), - BinaryenStringMeasure( - module, - BinaryenStringMeasureIsUSV(), - BinaryenGlobalGet(module, "string-global", BinaryenTypeStringref())), - BinaryenStringEncode( - module, - BinaryenStringEncodeUTF8(), - BinaryenGlobalGet(module, "string-global", BinaryenTypeStringref()), - makeInt32(module, 0), - 0), - BinaryenStringEncode( - module, - BinaryenStringEncodeLossyUTF8(), - BinaryenGlobalGet(module, "string-global", BinaryenTypeStringref()), - makeInt32(module, 0), - 0), - BinaryenStringEncode( - module, - BinaryenStringEncodeWTF8(), - BinaryenGlobalGet(module, "string-global", BinaryenTypeStringref()), - makeInt32(module, 0), - 0), - BinaryenStringEncode( - module, - BinaryenStringEncodeWTF16(), - BinaryenGlobalGet(module, "string-global", BinaryenTypeStringref()), - makeInt32(module, 0), - 0), - BinaryenStringEncode( - module, - BinaryenStringEncodeUTF8Array(), - BinaryenGlobalGet(module, "string-global", BinaryenTypeStringref()), - BinaryenGlobalGet(module, "i8Array-global", i8Array), - makeInt32(module, 0)), BinaryenStringEncode( module, BinaryenStringEncodeLossyUTF8Array(), @@ -1301,12 +1198,6 @@ void test_core() { makeInt32(module, 0)), BinaryenStringEncode( module, - BinaryenStringEncodeWTF8Array(), - BinaryenGlobalGet(module, "string-global", BinaryenTypeStringref()), - BinaryenGlobalGet(module, "i8Array-global", i8Array), - makeInt32(module, 0)), - BinaryenStringEncode( - module, BinaryenStringEncodeWTF16Array(), BinaryenGlobalGet(module, "string-global", BinaryenTypeStringref()), BinaryenGlobalGet(module, "i16Array-global", i16Array), diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index e10c3b47b..7231ded9a 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -2337,57 +2337,6 @@ BinaryenFeatureAll: 131071 (i32.const 2) ) (drop - (string.new_utf8 - (i32.const 0) - (i32.const 0) - ) - ) - (drop - (string.new_utf8_try - (i32.const 0) - (i32.const 0) - ) - ) - (drop - (string.new_wtf8 - (i32.const 0) - (i32.const 0) - ) - ) - (drop - (string.new_lossy_utf8 - (i32.const 0) - (i32.const 0) - ) - ) - (drop - (string.new_wtf16 - (i32.const 0) - (i32.const 0) - ) - ) - (drop - (string.new_utf8_array - (global.get $i8Array-global) - (i32.const 0) - (i32.const 0) - ) - ) - (drop - (string.new_utf8_array_try - (global.get $i8Array-global) - (i32.const 0) - (i32.const 0) - ) - ) - (drop - (string.new_wtf8_array - (global.get $i8Array-global) - (i32.const 0) - (i32.const 0) - ) - ) - (drop (string.new_lossy_utf8_array (global.get $i8Array-global) (i32.const 0) @@ -2415,52 +2364,11 @@ BinaryenFeatureAll: 131071 ) ) (drop - (string.measure_wtf8 - (global.get $string-global) - ) - ) - (drop (string.measure_wtf16 (global.get $string-global) ) ) (drop - (string.is_usv_sequence - (global.get $string-global) - ) - ) - (drop - (string.encode_utf8 - (global.get $string-global) - (i32.const 0) - ) - ) - (drop - (string.encode_lossy_utf8 - (global.get $string-global) - (i32.const 0) - ) - ) - (drop - (string.encode_wtf8 - (global.get $string-global) - (i32.const 0) - ) - ) - (drop - (string.encode_wtf16 - (global.get $string-global) - (i32.const 0) - ) - ) - (drop - (string.encode_utf8_array - (global.get $string-global) - (global.get $i8Array-global) - (i32.const 0) - ) - ) - (drop (string.encode_lossy_utf8_array (global.get $string-global) (global.get $i8Array-global) @@ -2468,13 +2376,6 @@ BinaryenFeatureAll: 131071 ) ) (drop - (string.encode_wtf8_array - (global.get $string-global) - (global.get $i8Array-global) - (i32.const 0) - ) - ) - (drop (string.encode_wtf16_array (global.get $string-global) (global.get $i16Array-global) |