diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-03-16 20:41:50 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-03-16 20:41:50 +0900 |
| commit | 3d2d891d7e1492d179cd8da7a618fbdd5efcca2c (patch) | |
| tree | 45367f35d98af1125a2197b3bc3dbc35700128d7 /tests/fixtures/spec_testsuites/core/table.wast | |
| parent | 9b45796547c8022b98a9254320323d72aecd81cb (diff) | |
| download | php-waddiwasi-3d2d891d7e1492d179cd8da7a618fbdd5efcca2c.tar.gz php-waddiwasi-3d2d891d7e1492d179cd8da7a618fbdd5efcca2c.tar.zst php-waddiwasi-3d2d891d7e1492d179cd8da7a618fbdd5efcca2c.zip | |
feat: add spec testsuites
Diffstat (limited to 'tests/fixtures/spec_testsuites/core/table.wast')
| -rw-r--r-- | tests/fixtures/spec_testsuites/core/table.wast | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/fixtures/spec_testsuites/core/table.wast b/tests/fixtures/spec_testsuites/core/table.wast new file mode 100644 index 0000000..0bd04f5 --- /dev/null +++ b/tests/fixtures/spec_testsuites/core/table.wast @@ -0,0 +1,54 @@ +;; Test table section structure + +(module (table 0 funcref)) +(module (table 1 funcref)) +(module (table 0 0 funcref)) +(module (table 0 1 funcref)) +(module (table 1 256 funcref)) +(module (table 0 65536 funcref)) +(module (table 0 0xffff_ffff funcref)) + +(module (table 0 funcref) (table 0 funcref)) +(module (table (import "spectest" "table") 0 funcref) (table 0 funcref)) + +(assert_invalid (module (elem (i32.const 0))) "unknown table") +(assert_invalid (module (elem (i32.const 0) $f) (func $f)) "unknown table") + + +(assert_invalid + (module (table 1 0 funcref)) + "size minimum must not be greater than maximum" +) +(assert_invalid + (module (table 0xffff_ffff 0 funcref)) + "size minimum must not be greater than maximum" +) + +(assert_malformed + (module quote "(table 0x1_0000_0000 funcref)") + "i32 constant out of range" +) +(assert_malformed + (module quote "(table 0x1_0000_0000 0x1_0000_0000 funcref)") + "i32 constant out of range" +) +(assert_malformed + (module quote "(table 0 0x1_0000_0000 funcref)") + "i32 constant out of range" +) + + +;; Duplicate table identifiers + +(assert_malformed (module quote + "(table $foo 1 funcref)" + "(table $foo 1 funcref)") + "duplicate table") +(assert_malformed (module quote + "(import \"\" \"\" (table $foo 1 funcref))" + "(table $foo 1 funcref)") + "duplicate table") +(assert_malformed (module quote + "(import \"\" \"\" (table $foo 1 funcref))" + "(import \"\" \"\" (table $foo 1 funcref))") + "duplicate table") |
