diff options
author | Thomas Lively <tlively@google.com> | 2024-07-17 12:42:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-17 09:42:57 -0700 |
commit | 55d888acac2e78f110e298e2502517db1523a67e (patch) | |
tree | c0118d749d245788fca05b2e4ad8391c03e02b96 /test | |
parent | 994d8d31381dbc9dbaa89809c75b2c8d804e0d7f (diff) | |
download | binaryen-55d888acac2e78f110e298e2502517db1523a67e.tar.gz binaryen-55d888acac2e78f110e298e2502517db1523a67e.tar.bz2 binaryen-55d888acac2e78f110e298e2502517db1523a67e.zip |
[threads] Validate all features required by ref.null (#6758)
`ref.null` of shared types should only be allowed when shared-everything
is enabled, but we were previously checking only that reference types
were enabled when validating `ref.null`. Update the code to check all
features required by the null type and factor out shared logic for
printing lists of missing feature options in error messages.
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/ctor-eval/shared-i31.wast | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/lit/ctor-eval/shared-i31.wast b/test/lit/ctor-eval/shared-i31.wast new file mode 100644 index 000000000..2c1d8da59 --- /dev/null +++ b/test/lit/ctor-eval/shared-i31.wast @@ -0,0 +1,38 @@ +;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. +;; RUN: wasm-ctor-eval %s --ctors=test --kept-exports=test,other --quiet -all -S -o - | filecheck %s + +;; We should be able to update `global` with a proper shared i31 reference. + +(module + ;; CHECK: (type $0 (func (result (ref null (shared any))))) + + ;; CHECK: (global $global (mut (ref null (shared i31))) (ref.i31_shared + ;; CHECK-NEXT: (i32.const 42) + ;; CHECK-NEXT: )) + (global $global (mut (ref null (shared i31))) (ref.null (shared none))) + + (func $test (export "test") (result (ref null (shared any))) + (global.set $global + (ref.i31_shared + (i32.const 42) + ) + ) + (global.get $global) + ) + + ;; CHECK: (export "test" (func $test_2)) + + ;; CHECK: (export "other" (func $other)) + + ;; CHECK: (func $other (type $0) (result (ref null (shared any))) + ;; CHECK-NEXT: (global.get $global) + ;; CHECK-NEXT: ) + (func $other (export "other") (result (ref null (shared any))) + (global.get $global) + ) +) +;; CHECK: (func $test_2 (type $0) (result (ref null (shared any))) +;; CHECK-NEXT: (ref.i31_shared +;; CHECK-NEXT: (i32.const 42) +;; CHECK-NEXT: ) +;; CHECK-NEXT: ) |