Skip to content

Commit f48eabd

Browse files
committedJan 9, 2020
Update testsuite
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: WebAssembly/spec#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: WebAssembly/bulk-memory-operations#111 And: WebAssembly/bulk-memory-operations#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. 3. nullref is now permitted in the text and binary format.
1 parent d7f7fd7 commit f48eabd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1163
-1304
lines changed
 

‎fuzz-in/wast.dict

-2
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,5 @@ op_assert_malformed="assert_malformed"
225225
op_assert_invalid="assert_invalid"
226226
op_assert_unlinkable="assert_unlinkable"
227227
op_assert_return="assert_return"
228-
op_assert_return_canonical_nan="assert_return_canonical_nan"
229-
op_assert_return_arithmetic_nan="assert_return_arithmetic_nan"
230228
op_assert_trap="assert_trap"
231229
op_assert_exhaustion="assert_exhaustion"

‎src/binary-writer-spec.cc

+18-28
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ void BinaryWriterSpec::WriteCommandType(const Command& command) {
131131
"assert_uninstantiable",
132132
"assert_return",
133133
"assert_return_func",
134-
"assert_return_canonical_nan",
135-
"assert_return_arithmetic_nan",
136134
"assert_trap",
137135
"assert_exhaustion",
138136
};
@@ -189,7 +187,15 @@ void BinaryWriterSpec::WriteConst(const Const& const_) {
189187
WriteString("f32");
190188
WriteSeparator();
191189
WriteKey("value");
192-
json_stream_->Writef("\"%u\"", const_.f32_bits);
190+
if (const_.is_expected_nan) {
191+
if (const_.expected == ExpectedNan::Arithmetic) {
192+
WriteString("nan:arithmetic");
193+
} else {
194+
WriteString("nan:canonical");
195+
}
196+
} else {
197+
json_stream_->Writef("\"%u\"", const_.f32_bits);
198+
}
193199
break;
194200
}
195201

@@ -198,7 +204,15 @@ void BinaryWriterSpec::WriteConst(const Const& const_) {
198204
WriteString("f64");
199205
WriteSeparator();
200206
WriteKey("value");
201-
json_stream_->Writef("\"%" PRIu64 "\"", const_.f64_bits);
207+
if (const_.is_expected_nan) {
208+
if (const_.expected == ExpectedNan::Arithmetic) {
209+
WriteString("nan:arithmetic");
210+
} else {
211+
WriteString("nan:canonical");
212+
}
213+
} else {
214+
json_stream_->Writef("\"%" PRIu64 "\"", const_.f64_bits);
215+
}
202216
break;
203217
}
204218

@@ -490,30 +504,6 @@ void BinaryWriterSpec::WriteCommands() {
490504
break;
491505
}
492506

493-
case CommandType::AssertReturnCanonicalNan: {
494-
auto* assert_return_canonical_nan_command =
495-
cast<AssertReturnCanonicalNanCommand>(command);
496-
WriteLocation(assert_return_canonical_nan_command->action->loc);
497-
WriteSeparator();
498-
WriteAction(*assert_return_canonical_nan_command->action);
499-
WriteSeparator();
500-
WriteKey("expected");
501-
WriteActionResultType(*assert_return_canonical_nan_command->action);
502-
break;
503-
}
504-
505-
case CommandType::AssertReturnArithmeticNan: {
506-
auto* assert_return_arithmetic_nan_command =
507-
cast<AssertReturnArithmeticNanCommand>(command);
508-
WriteLocation(assert_return_arithmetic_nan_command->action->loc);
509-
WriteSeparator();
510-
WriteAction(*assert_return_arithmetic_nan_command->action);
511-
WriteSeparator();
512-
WriteKey("expected");
513-
WriteActionResultType(*assert_return_arithmetic_nan_command->action);
514-
break;
515-
}
516-
517507
case CommandType::AssertTrap: {
518508
auto* assert_trap_command = cast<AssertTrapCommand>(command);
519509
WriteLocation(assert_trap_command->action->loc);

0 commit comments

Comments
 (0)