diff options
author | Alon Zakai <azakai@google.com> | 2024-07-29 11:37:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-29 11:37:55 -0700 |
commit | eac08461444da84e20d0641e429db7b03e45a21c (patch) | |
tree | 902da6a22d0b7e8ae49c92173f687adf4fbf56e2 /test | |
parent | f938154a44ae4dd2733537c5683ebe2eeb1989a2 (diff) | |
download | binaryen-eac08461444da84e20d0641e429db7b03e45a21c.tar.gz binaryen-eac08461444da84e20d0641e429db7b03e45a21c.tar.bz2 binaryen-eac08461444da84e20d0641e429db7b03e45a21c.zip |
Generalize Literal::externalize/internalize for strings and shareability (#6784)
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/ctor-eval/shared-i31.wast | 9 | ||||
-rw-r--r-- | test/lit/exec/strings.wast | 26 |
2 files changed, 35 insertions, 0 deletions
diff --git a/test/lit/ctor-eval/shared-i31.wast b/test/lit/ctor-eval/shared-i31.wast index 2c1d8da59..fe79ce412 100644 --- a/test/lit/ctor-eval/shared-i31.wast +++ b/test/lit/ctor-eval/shared-i31.wast @@ -17,6 +17,15 @@ (i32.const 42) ) ) + ;; Also externalizing and internalizing works: this code can be precomputed + ;; and hence removed. + (drop + (any.convert_extern + (extern.convert_any + (global.get $global) + ) + ) + ) (global.get $global) ) diff --git a/test/lit/exec/strings.wast b/test/lit/exec/strings.wast index f0c659d19..f4ba59844 100644 --- a/test/lit/exec/strings.wast +++ b/test/lit/exec/strings.wast @@ -476,6 +476,24 @@ (string.const "five!") ) ) + + ;; CHECK: [fuzz-exec] calling extern + ;; CHECK-NEXT: [fuzz-exec] note result: extern => string("string") + (func $extern (export "extern") (result externref) + (extern.convert_any + (string.const "string") + ) + ) + + ;; CHECK: [fuzz-exec] calling extern-intern + ;; CHECK-NEXT: [fuzz-exec] note result: extern-intern => string("string") + (func $extern-intern (export "extern-intern") (result anyref) + (any.convert_extern + (extern.convert_any + (string.const "string") + ) + ) + ) ) ;; CHECK: [fuzz-exec] calling new_wtf16_array ;; CHECK-NEXT: [fuzz-exec] note result: new_wtf16_array => string("ello") @@ -604,6 +622,12 @@ ;; CHECK: [fuzz-exec] calling string.measure ;; CHECK-NEXT: [fuzz-exec] note result: string.measure => 5 + +;; CHECK: [fuzz-exec] calling extern +;; CHECK-NEXT: [fuzz-exec] note result: extern => string("string") + +;; CHECK: [fuzz-exec] calling extern-intern +;; CHECK-NEXT: [fuzz-exec] note result: extern-intern => string("string") ;; CHECK-NEXT: [fuzz-exec] comparing compare.1 ;; CHECK-NEXT: [fuzz-exec] comparing compare.10 ;; CHECK-NEXT: [fuzz-exec] comparing compare.2 @@ -624,6 +648,8 @@ ;; CHECK-NEXT: [fuzz-exec] comparing eq.3 ;; CHECK-NEXT: [fuzz-exec] comparing eq.4 ;; CHECK-NEXT: [fuzz-exec] comparing eq.5 +;; CHECK-NEXT: [fuzz-exec] comparing extern +;; CHECK-NEXT: [fuzz-exec] comparing extern-intern ;; CHECK-NEXT: [fuzz-exec] comparing get_codeunit ;; CHECK-NEXT: [fuzz-exec] comparing invalid_code_point ;; CHECK-NEXT: [fuzz-exec] comparing isolated_high_code_point |