diff options
author | Thomas Lively <tlively@google.com> | 2024-06-14 12:07:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-14 19:07:44 +0000 |
commit | 0fa99fb09b881985cf94e74b8c0b339bdef61be6 (patch) | |
tree | 81d1a340dc17a55e6b611962807dd34599757651 /test/lit | |
parent | 000fa2a8ac8dd66b8ca53b0451702966d59da4d0 (diff) | |
download | binaryen-0fa99fb09b881985cf94e74b8c0b339bdef61be6.tar.gz binaryen-0fa99fb09b881985cf94e74b8c0b339bdef61be6.tar.bz2 binaryen-0fa99fb09b881985cf94e74b8c0b339bdef61be6.zip |
[threads] Add a "shared-everything" feature (#6658)
Add the feature and flags to enable and disable it. Require the new feature to
be enabled for shared heap types to validate. To make the test work, update the
validator to actually check features for global types.
Diffstat (limited to 'test/lit')
-rw-r--r-- | test/lit/help/wasm-as.test | 4 | ||||
-rw-r--r-- | test/lit/help/wasm-ctor-eval.test | 4 | ||||
-rw-r--r-- | test/lit/help/wasm-dis.test | 4 | ||||
-rw-r--r-- | test/lit/help/wasm-emscripten-finalize.test | 4 | ||||
-rw-r--r-- | test/lit/help/wasm-merge.test | 4 | ||||
-rw-r--r-- | test/lit/help/wasm-metadce.test | 4 | ||||
-rw-r--r-- | test/lit/help/wasm-opt.test | 5 | ||||
-rw-r--r-- | test/lit/help/wasm-reduce.test | 4 | ||||
-rw-r--r-- | test/lit/help/wasm-split.test | 4 | ||||
-rw-r--r-- | test/lit/help/wasm2js.test | 5 | ||||
-rw-r--r-- | test/lit/validation/shared-struct.wast | 12 |
11 files changed, 54 insertions, 0 deletions
diff --git a/test/lit/help/wasm-as.test b/test/lit/help/wasm-as.test index 09e5b7c9d..114064576 100644 --- a/test/lit/help/wasm-as.test +++ b/test/lit/help/wasm-as.test @@ -108,6 +108,10 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-continuations Disable typed continuations ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-shared-everything Enable shared-everything threads +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-shared-everything Disable shared-everything threads +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/help/wasm-ctor-eval.test b/test/lit/help/wasm-ctor-eval.test index e511ef0b9..93b5654ed 100644 --- a/test/lit/help/wasm-ctor-eval.test +++ b/test/lit/help/wasm-ctor-eval.test @@ -115,6 +115,10 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-continuations Disable typed continuations ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-shared-everything Enable shared-everything threads +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-shared-everything Disable shared-everything threads +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/help/wasm-dis.test b/test/lit/help/wasm-dis.test index 2dffcc945..06dda9e96 100644 --- a/test/lit/help/wasm-dis.test +++ b/test/lit/help/wasm-dis.test @@ -101,6 +101,10 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-continuations Disable typed continuations ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-shared-everything Enable shared-everything threads +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-shared-everything Disable shared-everything threads +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/help/wasm-emscripten-finalize.test b/test/lit/help/wasm-emscripten-finalize.test index a4ba48b16..1b31e1e44 100644 --- a/test/lit/help/wasm-emscripten-finalize.test +++ b/test/lit/help/wasm-emscripten-finalize.test @@ -143,6 +143,10 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-continuations Disable typed continuations ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-shared-everything Enable shared-everything threads +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-shared-everything Disable shared-everything threads +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/help/wasm-merge.test b/test/lit/help/wasm-merge.test index c87be5edf..293bdbff0 100644 --- a/test/lit/help/wasm-merge.test +++ b/test/lit/help/wasm-merge.test @@ -131,6 +131,10 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-continuations Disable typed continuations ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-shared-everything Enable shared-everything threads +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-shared-everything Disable shared-everything threads +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/help/wasm-metadce.test b/test/lit/help/wasm-metadce.test index f0889eb81..453328df1 100644 --- a/test/lit/help/wasm-metadce.test +++ b/test/lit/help/wasm-metadce.test @@ -156,6 +156,10 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-continuations Disable typed continuations ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-shared-everything Enable shared-everything threads +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-shared-everything Disable shared-everything threads +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/help/wasm-opt.test b/test/lit/help/wasm-opt.test index 727d1ab21..9dd38e03e 100644 --- a/test/lit/help/wasm-opt.test +++ b/test/lit/help/wasm-opt.test @@ -721,6 +721,11 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-continuations Disable typed continuations ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-shared-everything Enable shared-everything threads +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-shared-everything Disable shared-everything +;; CHECK-NEXT: threads +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/help/wasm-reduce.test b/test/lit/help/wasm-reduce.test index a98b8a199..397952855 100644 --- a/test/lit/help/wasm-reduce.test +++ b/test/lit/help/wasm-reduce.test @@ -137,6 +137,10 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-continuations Disable typed continuations ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-shared-everything Enable shared-everything threads +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-shared-everything Disable shared-everything threads +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/help/wasm-split.test b/test/lit/help/wasm-split.test index fcd919ea8..333864bcb 100644 --- a/test/lit/help/wasm-split.test +++ b/test/lit/help/wasm-split.test @@ -217,6 +217,10 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-continuations Disable typed continuations ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-shared-everything Enable shared-everything threads +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-shared-everything Disable shared-everything threads +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/help/wasm2js.test b/test/lit/help/wasm2js.test index d8768f35e..72efcd223 100644 --- a/test/lit/help/wasm2js.test +++ b/test/lit/help/wasm2js.test @@ -675,6 +675,11 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-continuations Disable typed continuations ;; CHECK-NEXT: +;; CHECK-NEXT: --enable-shared-everything Enable shared-everything threads +;; CHECK-NEXT: +;; CHECK-NEXT: --disable-shared-everything Disable shared-everything +;; CHECK-NEXT: threads +;; CHECK-NEXT: ;; CHECK-NEXT: --enable-typed-function-references Deprecated compatibility flag ;; CHECK-NEXT: ;; CHECK-NEXT: --disable-typed-function-references Deprecated compatibility flag diff --git a/test/lit/validation/shared-struct.wast b/test/lit/validation/shared-struct.wast new file mode 100644 index 000000000..ee25b6f24 --- /dev/null +++ b/test/lit/validation/shared-struct.wast @@ -0,0 +1,12 @@ +;; Test that shared structs require shared-everything threads + +;; RUN: not wasm-opt %s 2>&1 | filecheck %s --check-prefix NO-SHARED +;; RUN: wasm-opt %s --enable-reference-types --enable-gc --enable-shared-everything -o - -S | filecheck %s --check-prefix SHARED + +;; NO-SHARED: global type requires additional features [--enable-reference-types --enable-gc --enable-shared-everything] +;; SHARED: (type $t (shared (struct ))) + +(module + (type $t (shared (struct))) + (global (import "" "") (ref null $t)) +) |