summaryrefslogtreecommitdiff
path: root/src/binary-writer-spec.cc
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2020-01-09 11:36:21 -0800
committerGitHub <noreply@github.com>2020-01-09 11:36:21 -0800
commit415c3bb1b70c5edc9beb3a7e2cea5d9247e1e52c (patch)
tree5cf869855722fce5f88e11c0968007d8f37109f8 /src/binary-writer-spec.cc
parent7de6d8eedd550a9001a2db9d9e04b7ad941c9be7 (diff)
downloadwabt-415c3bb1b70c5edc9beb3a7e2cea5d9247e1e52c.tar.gz
wabt-415c3bb1b70c5edc9beb3a7e2cea5d9247e1e52c.tar.bz2
wabt-415c3bb1b70c5edc9beb3a7e2cea5d9247e1e52c.zip
Update testsuite (#1275)
The two primary changes involved are: 1. Removal of `assert_return_canonical_nan`/`arithetic nan` in favor of special `nan:canonical`/`nan:arithmetic` constants that can only be used in test expectations. See: https://github.com/WebAssembly/spec/pull/1104 2. New trapping behaviour for bulk memory operations. Range checks are now performed up front for opterations such as memory.fill and memory.copy. See: https://github.com/webassembly/bulk-memory-operations/issues/111 And: https://github.com/webassembly/bulk-memory-operations/pull/123 The old behaviour is still kept around to support table.fill which is defined in reference-types proposal and has yet to be updated.
Diffstat (limited to 'src/binary-writer-spec.cc')
-rw-r--r--src/binary-writer-spec.cc46
1 files changed, 18 insertions, 28 deletions
diff --git a/src/binary-writer-spec.cc b/src/binary-writer-spec.cc
index 2c169426..d547f7d6 100644
--- a/src/binary-writer-spec.cc
+++ b/src/binary-writer-spec.cc
@@ -131,8 +131,6 @@ void BinaryWriterSpec::WriteCommandType(const Command& command) {
"assert_uninstantiable",
"assert_return",
"assert_return_func",
- "assert_return_canonical_nan",
- "assert_return_arithmetic_nan",
"assert_trap",
"assert_exhaustion",
};
@@ -189,7 +187,15 @@ void BinaryWriterSpec::WriteConst(const Const& const_) {
WriteString("f32");
WriteSeparator();
WriteKey("value");
- json_stream_->Writef("\"%u\"", const_.f32_bits);
+ if (const_.is_expected_nan) {
+ if (const_.expected == ExpectedNan::Arithmetic) {
+ WriteString("nan:arithmetic");
+ } else {
+ WriteString("nan:canonical");
+ }
+ } else {
+ json_stream_->Writef("\"%u\"", const_.f32_bits);
+ }
break;
}
@@ -198,7 +204,15 @@ void BinaryWriterSpec::WriteConst(const Const& const_) {
WriteString("f64");
WriteSeparator();
WriteKey("value");
- json_stream_->Writef("\"%" PRIu64 "\"", const_.f64_bits);
+ if (const_.is_expected_nan) {
+ if (const_.expected == ExpectedNan::Arithmetic) {
+ WriteString("nan:arithmetic");
+ } else {
+ WriteString("nan:canonical");
+ }
+ } else {
+ json_stream_->Writef("\"%" PRIu64 "\"", const_.f64_bits);
+ }
break;
}
@@ -490,30 +504,6 @@ void BinaryWriterSpec::WriteCommands() {
break;
}
- case CommandType::AssertReturnCanonicalNan: {
- auto* assert_return_canonical_nan_command =
- cast<AssertReturnCanonicalNanCommand>(command);
- WriteLocation(assert_return_canonical_nan_command->action->loc);
- WriteSeparator();
- WriteAction(*assert_return_canonical_nan_command->action);
- WriteSeparator();
- WriteKey("expected");
- WriteActionResultType(*assert_return_canonical_nan_command->action);
- break;
- }
-
- case CommandType::AssertReturnArithmeticNan: {
- auto* assert_return_arithmetic_nan_command =
- cast<AssertReturnArithmeticNanCommand>(command);
- WriteLocation(assert_return_arithmetic_nan_command->action->loc);
- WriteSeparator();
- WriteAction(*assert_return_arithmetic_nan_command->action);
- WriteSeparator();
- WriteKey("expected");
- WriteActionResultType(*assert_return_arithmetic_nan_command->action);
- break;
- }
-
case CommandType::AssertTrap: {
auto* assert_trap_command = cast<AssertTrapCommand>(command);
WriteLocation(assert_trap_command->action->loc);