aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/fixtures/spec_testsuites/core/traps.json
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-03-16 20:41:50 +0900
committernsfisis <nsfisis@gmail.com>2024-03-16 20:41:50 +0900
commit3d2d891d7e1492d179cd8da7a618fbdd5efcca2c (patch)
tree45367f35d98af1125a2197b3bc3dbc35700128d7 /tests/fixtures/spec_testsuites/core/traps.json
parent9b45796547c8022b98a9254320323d72aecd81cb (diff)
downloadphp-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/traps.json')
-rw-r--r--tests/fixtures/spec_testsuites/core/traps.json38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/fixtures/spec_testsuites/core/traps.json b/tests/fixtures/spec_testsuites/core/traps.json
new file mode 100644
index 0000000..a430fef
--- /dev/null
+++ b/tests/fixtures/spec_testsuites/core/traps.json
@@ -0,0 +1,38 @@
+{"source_filename": "./traps.wast",
+ "commands": [
+ {"type": "module", "line": 5, "filename": "traps.0.wasm"},
+ {"type": "assert_trap", "line": 16, "action": {"type": "invoke", "field": "no_dce.i32.div_s", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}]}, "text": "integer divide by zero", "expected": []},
+ {"type": "assert_trap", "line": 17, "action": {"type": "invoke", "field": "no_dce.i32.div_u", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}]}, "text": "integer divide by zero", "expected": []},
+ {"type": "assert_trap", "line": 18, "action": {"type": "invoke", "field": "no_dce.i64.div_s", "args": [{"type": "i64", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "integer divide by zero", "expected": []},
+ {"type": "assert_trap", "line": 19, "action": {"type": "invoke", "field": "no_dce.i64.div_u", "args": [{"type": "i64", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "integer divide by zero", "expected": []},
+ {"type": "assert_trap", "line": 20, "action": {"type": "invoke", "field": "no_dce.i32.div_s", "args": [{"type": "i32", "value": "2147483648"}, {"type": "i32", "value": "4294967295"}]}, "text": "integer overflow", "expected": []},
+ {"type": "assert_trap", "line": 21, "action": {"type": "invoke", "field": "no_dce.i64.div_s", "args": [{"type": "i64", "value": "9223372036854775808"}, {"type": "i64", "value": "18446744073709551615"}]}, "text": "integer overflow", "expected": []},
+ {"type": "module", "line": 23, "filename": "traps.1.wasm"},
+ {"type": "assert_trap", "line": 34, "action": {"type": "invoke", "field": "no_dce.i32.rem_s", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}]}, "text": "integer divide by zero", "expected": []},
+ {"type": "assert_trap", "line": 35, "action": {"type": "invoke", "field": "no_dce.i32.rem_u", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}]}, "text": "integer divide by zero", "expected": []},
+ {"type": "assert_trap", "line": 36, "action": {"type": "invoke", "field": "no_dce.i64.rem_s", "args": [{"type": "i64", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "integer divide by zero", "expected": []},
+ {"type": "assert_trap", "line": 37, "action": {"type": "invoke", "field": "no_dce.i64.rem_u", "args": [{"type": "i64", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "integer divide by zero", "expected": []},
+ {"type": "module", "line": 39, "filename": "traps.2.wasm"},
+ {"type": "assert_trap", "line": 50, "action": {"type": "invoke", "field": "no_dce.i32.trunc_f32_s", "args": [{"type": "f32", "value": "2143289344"}]}, "text": "invalid conversion to integer", "expected": []},
+ {"type": "assert_trap", "line": 51, "action": {"type": "invoke", "field": "no_dce.i32.trunc_f32_u", "args": [{"type": "f32", "value": "2143289344"}]}, "text": "invalid conversion to integer", "expected": []},
+ {"type": "assert_trap", "line": 52, "action": {"type": "invoke", "field": "no_dce.i32.trunc_f64_s", "args": [{"type": "f64", "value": "9221120237041090560"}]}, "text": "invalid conversion to integer", "expected": []},
+ {"type": "assert_trap", "line": 53, "action": {"type": "invoke", "field": "no_dce.i32.trunc_f64_u", "args": [{"type": "f64", "value": "9221120237041090560"}]}, "text": "invalid conversion to integer", "expected": []},
+ {"type": "assert_trap", "line": 54, "action": {"type": "invoke", "field": "no_dce.i64.trunc_f32_s", "args": [{"type": "f32", "value": "2143289344"}]}, "text": "invalid conversion to integer", "expected": []},
+ {"type": "assert_trap", "line": 55, "action": {"type": "invoke", "field": "no_dce.i64.trunc_f32_u", "args": [{"type": "f32", "value": "2143289344"}]}, "text": "invalid conversion to integer", "expected": []},
+ {"type": "assert_trap", "line": 56, "action": {"type": "invoke", "field": "no_dce.i64.trunc_f64_s", "args": [{"type": "f64", "value": "9221120237041090560"}]}, "text": "invalid conversion to integer", "expected": []},
+ {"type": "assert_trap", "line": 57, "action": {"type": "invoke", "field": "no_dce.i64.trunc_f64_u", "args": [{"type": "f64", "value": "9221120237041090560"}]}, "text": "invalid conversion to integer", "expected": []},
+ {"type": "module", "line": 59, "filename": "traps.3.wasm"},
+ {"type": "assert_trap", "line": 78, "action": {"type": "invoke", "field": "no_dce.i32.load", "args": [{"type": "i32", "value": "65536"}]}, "text": "out of bounds memory access", "expected": []},
+ {"type": "assert_trap", "line": 79, "action": {"type": "invoke", "field": "no_dce.i32.load16_s", "args": [{"type": "i32", "value": "65536"}]}, "text": "out of bounds memory access", "expected": []},
+ {"type": "assert_trap", "line": 80, "action": {"type": "invoke", "field": "no_dce.i32.load16_u", "args": [{"type": "i32", "value": "65536"}]}, "text": "out of bounds memory access", "expected": []},
+ {"type": "assert_trap", "line": 81, "action": {"type": "invoke", "field": "no_dce.i32.load8_s", "args": [{"type": "i32", "value": "65536"}]}, "text": "out of bounds memory access", "expected": []},
+ {"type": "assert_trap", "line": 82, "action": {"type": "invoke", "field": "no_dce.i32.load8_u", "args": [{"type": "i32", "value": "65536"}]}, "text": "out of bounds memory access", "expected": []},
+ {"type": "assert_trap", "line": 83, "action": {"type": "invoke", "field": "no_dce.i64.load", "args": [{"type": "i32", "value": "65536"}]}, "text": "out of bounds memory access", "expected": []},
+ {"type": "assert_trap", "line": 84, "action": {"type": "invoke", "field": "no_dce.i64.load32_s", "args": [{"type": "i32", "value": "65536"}]}, "text": "out of bounds memory access", "expected": []},
+ {"type": "assert_trap", "line": 85, "action": {"type": "invoke", "field": "no_dce.i64.load32_u", "args": [{"type": "i32", "value": "65536"}]}, "text": "out of bounds memory access", "expected": []},
+ {"type": "assert_trap", "line": 86, "action": {"type": "invoke", "field": "no_dce.i64.load16_s", "args": [{"type": "i32", "value": "65536"}]}, "text": "out of bounds memory access", "expected": []},
+ {"type": "assert_trap", "line": 87, "action": {"type": "invoke", "field": "no_dce.i64.load16_u", "args": [{"type": "i32", "value": "65536"}]}, "text": "out of bounds memory access", "expected": []},
+ {"type": "assert_trap", "line": 88, "action": {"type": "invoke", "field": "no_dce.i64.load8_s", "args": [{"type": "i32", "value": "65536"}]}, "text": "out of bounds memory access", "expected": []},
+ {"type": "assert_trap", "line": 89, "action": {"type": "invoke", "field": "no_dce.i64.load8_u", "args": [{"type": "i32", "value": "65536"}]}, "text": "out of bounds memory access", "expected": []},
+ {"type": "assert_trap", "line": 90, "action": {"type": "invoke", "field": "no_dce.f32.load", "args": [{"type": "i32", "value": "65536"}]}, "text": "out of bounds memory access", "expected": []},
+ {"type": "assert_trap", "line": 91, "action": {"type": "invoke", "field": "no_dce.f64.load", "args": [{"type": "i32", "value": "65536"}]}, "text": "out of bounds memory access", "expected": []}]}