Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/crates/test-util/src/wast.rs
3069 views
1
use serde::de::DeserializeOwned;
2
use serde_derive::Deserialize;
3
use std::fmt;
4
use std::fs;
5
use std::path::Path;
6
use std::path::PathBuf;
7
use wasmtime_environ::prelude::*;
8
9
/// Limits for running wast tests.
10
///
11
/// This is useful for sharing between `tests/wast.rs` and fuzzing, for
12
/// example, and is used as the minimum threshold for configuration when
13
/// fuzzing.
14
///
15
/// Note that it's ok to increase these numbers if a test comes along and needs
16
/// it, they're just here as empirically found minimum thresholds so far and
17
/// they're not too scientific.
18
pub mod limits {
19
pub const MEMORY_SIZE: usize = 805 << 16;
20
pub const MEMORIES: u32 = 450;
21
pub const TABLES: u32 = 200;
22
pub const MEMORIES_PER_MODULE: u32 = 9;
23
pub const TABLES_PER_MODULE: u32 = 5;
24
pub const COMPONENT_INSTANCES: u32 = 50;
25
pub const CORE_INSTANCES: u32 = 900;
26
pub const TABLE_ELEMENTS: usize = 1000;
27
pub const CORE_INSTANCE_SIZE: usize = 64 * 1024;
28
pub const TOTAL_STACKS: u32 = 10;
29
}
30
31
/// Local all `*.wast` tests under `root` which should be the path to the root
32
/// of the wasmtime repository.
33
pub fn find_tests(root: &Path) -> Result<Vec<WastTest>> {
34
let mut tests = Vec::new();
35
36
let spec_tests = root.join("tests/spec_testsuite");
37
add_tests(
38
&mut tests,
39
&spec_tests,
40
&FindConfig::Infer(spec_test_config),
41
)
42
.with_context(|| format!("failed to add tests from `{}`", spec_tests.display()))?;
43
44
let misc_tests = root.join("tests/misc_testsuite");
45
add_tests(&mut tests, &misc_tests, &FindConfig::InTest)
46
.with_context(|| format!("failed to add tests from `{}`", misc_tests.display()))?;
47
48
let cm_tests = root.join("tests/component-model/test");
49
add_tests(
50
&mut tests,
51
&cm_tests,
52
&FindConfig::Infer(component_test_config),
53
)
54
.with_context(|| format!("failed to add tests from `{}`", cm_tests.display()))?;
55
56
// Temporarily work around upstream tests that fail in unexpected ways (e.g.
57
// panics, loops, etc).
58
{
59
let skip_list = &[
60
// FIXME(#12510)
61
"drop-cross-task-borrow.wast",
62
];
63
tests.retain(|test| {
64
test.path
65
.file_name()
66
.and_then(|name| name.to_str())
67
.map(|name| !skip_list.contains(&name))
68
.unwrap_or(true)
69
});
70
}
71
72
Ok(tests)
73
}
74
75
enum FindConfig {
76
InTest,
77
Infer(fn(&Path) -> TestConfig),
78
}
79
80
fn add_tests(tests: &mut Vec<WastTest>, path: &Path, config: &FindConfig) -> Result<()> {
81
for entry in path.read_dir().context("failed to read directory")? {
82
let entry = entry.context("failed to read directory entry")?;
83
let path = entry.path();
84
if entry
85
.file_type()
86
.context("failed to get file type")?
87
.is_dir()
88
{
89
add_tests(tests, &path, config).context("failed to read sub-directory")?;
90
continue;
91
}
92
93
if path.extension().and_then(|s| s.to_str()) != Some("wast") {
94
continue;
95
}
96
97
let contents =
98
fs::read_to_string(&path).with_context(|| format!("failed to read test: {path:?}"))?;
99
let config = match config {
100
FindConfig::InTest => parse_test_config(&contents, ";;!")
101
.with_context(|| format!("failed to parse test configuration: {path:?}"))?,
102
FindConfig::Infer(f) => f(&path),
103
};
104
tests.push(WastTest {
105
path,
106
contents,
107
config,
108
})
109
}
110
Ok(())
111
}
112
113
fn spec_test_config(test: &Path) -> TestConfig {
114
let mut ret = TestConfig::default();
115
ret.spec_test = Some(true);
116
match spec_proposal_from_path(test) {
117
Some("wide-arithmetic") => {
118
ret.wide_arithmetic = Some(true);
119
}
120
Some("threads") => {
121
ret.threads = Some(true);
122
ret.reference_types = Some(false);
123
}
124
Some("custom-page-sizes") => {
125
ret.custom_page_sizes = Some(true);
126
ret.multi_memory = Some(true);
127
ret.memory64 = Some(true);
128
129
// See commentary below in `wasm-3.0` case for why these "hog
130
// memory"
131
if test.ends_with("memory_max.wast") || test.ends_with("memory_max_i64.wast") {
132
ret.hogs_memory = Some(true);
133
}
134
}
135
Some("custom-descriptors") => {
136
ret.custom_descriptors = Some(true);
137
}
138
Some(proposal) => panic!("unsupported proposal {proposal:?}"),
139
None => {
140
ret.reference_types = Some(true);
141
ret.simd = Some(true);
142
ret.simd = Some(true);
143
ret.relaxed_simd = Some(true);
144
ret.multi_memory = Some(true);
145
ret.gc = Some(true);
146
ret.reference_types = Some(true);
147
ret.memory64 = Some(true);
148
ret.tail_call = Some(true);
149
ret.extended_const = Some(true);
150
ret.exceptions = Some(true);
151
152
if test.parent().unwrap().ends_with("legacy") {
153
ret.legacy_exceptions = Some(true);
154
}
155
156
// These tests technically don't actually hog any memory but they
157
// do have a module definition with a table/memory that is the
158
// maximum size. These modules fail to compile in the pooling
159
// allocator which has limits on the minimum size of
160
// memories/tables by default.
161
//
162
// Pretend that these hog memory to avoid running the tests in the
163
// pooling allocator.
164
if test.ends_with("memory.wast")
165
|| test.ends_with("table.wast")
166
|| test.ends_with("memory64.wast")
167
|| test.ends_with("table64.wast")
168
{
169
ret.hogs_memory = Some(true);
170
}
171
}
172
}
173
174
ret
175
}
176
177
fn component_test_config(test: &Path) -> TestConfig {
178
let mut ret = TestConfig::default();
179
ret.spec_test = Some(true);
180
ret.reference_types = Some(true);
181
ret.multi_memory = Some(true);
182
183
if let Some(parent) = test.parent() {
184
if parent.ends_with("async")
185
|| [
186
"trap-in-post-return.wast",
187
"resources.wast",
188
"multiple-resources.wast",
189
]
190
.into_iter()
191
.any(|name| Some(name) == test.file_name().and_then(|s| s.to_str()))
192
{
193
ret.component_model_async = Some(true);
194
ret.component_model_async_stackful = Some(true);
195
ret.component_model_async_builtins = Some(true);
196
ret.component_model_threading = Some(true);
197
}
198
if parent.ends_with("wasm-tools") {
199
ret.memory64 = Some(true);
200
ret.threads = Some(true);
201
ret.exceptions = Some(true);
202
ret.gc = Some(true);
203
}
204
if parent.ends_with("wasmtime") {
205
ret.exceptions = Some(true);
206
ret.gc = Some(true);
207
}
208
}
209
210
ret
211
}
212
213
/// Parse test configuration from the specified test, comments starting with
214
/// `;;!`.
215
pub fn parse_test_config<T>(wat: &str, comment: &'static str) -> Result<T>
216
where
217
T: DeserializeOwned,
218
{
219
// The test config source is the leading lines of the WAT file that are
220
// prefixed with `;;!`.
221
let config_lines: Vec<_> = wat
222
.lines()
223
.take_while(|l| l.starts_with(comment))
224
.map(|l| &l[comment.len()..])
225
.collect();
226
let config_text = config_lines.join("\n");
227
228
toml::from_str(&config_text).context("failed to parse the test configuration")
229
}
230
231
/// A `*.wast` test with its path, contents, and configuration.
232
#[derive(Clone)]
233
pub struct WastTest {
234
pub path: PathBuf,
235
pub contents: String,
236
pub config: TestConfig,
237
}
238
239
impl fmt::Debug for WastTest {
240
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
241
f.debug_struct("WastTest")
242
.field("path", &self.path)
243
.field("contents", &"...")
244
.field("config", &self.config)
245
.finish()
246
}
247
}
248
249
macro_rules! foreach_config_option {
250
($m:ident) => {
251
$m! {
252
memory64
253
custom_page_sizes
254
multi_memory
255
threads
256
shared_everything_threads
257
gc
258
function_references
259
relaxed_simd
260
reference_types
261
tail_call
262
extended_const
263
wide_arithmetic
264
hogs_memory
265
nan_canonicalization
266
component_model_async
267
component_model_async_builtins
268
component_model_async_stackful
269
component_model_threading
270
component_model_error_context
271
component_model_gc
272
component_model_fixed_length_lists
273
simd
274
gc_types
275
exceptions
276
legacy_exceptions
277
stack_switching
278
spec_test
279
custom_descriptors
280
}
281
};
282
}
283
284
macro_rules! define_test_config {
285
($($option:ident)*) => {
286
/// Per-test configuration which is written down in the test file itself for
287
/// `misc_testsuite/**/*.wast` or in `spec_test_config` above for spec tests.
288
#[derive(Debug, PartialEq, Default, Deserialize, Clone)]
289
#[serde(deny_unknown_fields)]
290
pub struct TestConfig {
291
$(pub $option: Option<bool>,)*
292
}
293
294
impl TestConfig {
295
$(
296
pub fn $option(&self) -> bool {
297
self.$option.unwrap_or(false)
298
}
299
)*
300
}
301
}
302
}
303
304
foreach_config_option!(define_test_config);
305
306
impl TestConfig {
307
/// Returns an iterator over each option.
308
pub fn options_mut(&mut self) -> impl Iterator<Item = (&'static str, &mut Option<bool>)> {
309
macro_rules! mk {
310
($($option:ident)*) => {
311
[
312
$((stringify!($option), &mut self.$option),)*
313
].into_iter()
314
}
315
}
316
foreach_config_option!(mk)
317
}
318
}
319
320
/// Configuration that spec tests can run under.
321
#[derive(Debug)]
322
pub struct WastConfig {
323
/// Compiler chosen to run this test.
324
pub compiler: Compiler,
325
/// Whether or not the pooling allocator is enabled.
326
pub pooling: bool,
327
/// What garbage collector is being used.
328
pub collector: Collector,
329
}
330
331
/// Different compilers that can be tested in Wasmtime.
332
#[derive(PartialEq, Debug, Copy, Clone)]
333
pub enum Compiler {
334
/// Cranelift backend.
335
///
336
/// This tests the Cranelift code generator for native platforms. This
337
/// notably excludes Pulley since that's listed separately below even though
338
/// Pulley is a backend of Cranelift. This is only used for native code
339
/// generation such as x86_64.
340
CraneliftNative,
341
342
/// Winch backend.
343
///
344
/// This tests the Winch backend for native platforms. Currently Winch
345
/// primarily supports x86_64.
346
Winch,
347
348
/// Pulley interpreter.
349
///
350
/// This tests the Cranelift pulley backend plus the pulley execution
351
/// environment of the output bytecode. Note that this is separate from
352
/// `Cranelift` above to be able to test both on platforms where Cranelift
353
/// has native codegen support.
354
CraneliftPulley,
355
}
356
357
impl Compiler {
358
/// Returns whether this compiler is known to fail for the provided
359
/// `TestConfig`.
360
///
361
/// This function will determine if the configuration of the test provided
362
/// is known to guarantee fail. This effectively tracks the proposal support
363
/// for each compiler backend/runtime and tests whether `config` enables or
364
/// disables features that aren't supported.
365
///
366
/// Note that this is closely aligned with
367
/// `Config::compiler_panicking_wasm_features`.
368
pub fn should_fail(&self, config: &TestConfig) -> bool {
369
match self {
370
Compiler::CraneliftNative => config.legacy_exceptions(),
371
372
Compiler::Winch => {
373
if config.gc()
374
|| config.tail_call()
375
|| config.function_references()
376
|| config.gc()
377
|| config.relaxed_simd()
378
|| config.gc_types()
379
|| config.exceptions()
380
|| config.legacy_exceptions()
381
|| config.stack_switching()
382
|| config.legacy_exceptions()
383
|| config.component_model_async()
384
{
385
return true;
386
}
387
388
if cfg!(target_arch = "aarch64") {
389
return config.wide_arithmetic()
390
|| (config.simd() && !config.spec_test())
391
|| config.threads();
392
}
393
394
!cfg!(target_arch = "x86_64")
395
}
396
397
Compiler::CraneliftPulley => {
398
config.threads() || config.legacy_exceptions() || config.stack_switching()
399
}
400
}
401
}
402
403
/// Returns whether this compiler configuration supports the current host
404
/// architecture.
405
pub fn supports_host(&self) -> bool {
406
match self {
407
Compiler::CraneliftNative => {
408
cfg!(target_arch = "x86_64")
409
|| cfg!(target_arch = "aarch64")
410
|| cfg!(target_arch = "riscv64")
411
|| cfg!(target_arch = "s390x")
412
}
413
Compiler::Winch => cfg!(target_arch = "x86_64") || cfg!(target_arch = "aarch64"),
414
Compiler::CraneliftPulley => true,
415
}
416
}
417
}
418
419
#[derive(PartialEq, Debug, Copy, Clone)]
420
pub enum Collector {
421
Auto,
422
Null,
423
DeferredReferenceCounting,
424
}
425
426
impl WastTest {
427
/// Returns whether this test exercises the GC types and might want to use
428
/// multiple different garbage collectors.
429
pub fn test_uses_gc_types(&self) -> bool {
430
self.config.gc() || self.config.function_references()
431
}
432
433
/// Returns the optional spec proposal that this test is associated with.
434
pub fn spec_proposal(&self) -> Option<&str> {
435
spec_proposal_from_path(&self.path)
436
}
437
438
/// Returns whether this test should fail under the specified extra
439
/// configuration.
440
pub fn should_fail(&self, config: &WastConfig) -> bool {
441
if !config.compiler.supports_host() {
442
return true;
443
}
444
445
// Some tests are known to fail with the pooling allocator
446
if config.pooling {
447
let unsupported = [
448
// allocates too much memory for the pooling configuration here
449
"misc_testsuite/memory64/more-than-4gb.wast",
450
// shared memories + pooling allocator aren't supported yet
451
"misc_testsuite/memory-combos.wast",
452
"misc_testsuite/threads/atomics-end-of-memory.wast",
453
"misc_testsuite/threads/LB.wast",
454
"misc_testsuite/threads/LB_atomic.wast",
455
"misc_testsuite/threads/MP.wast",
456
"misc_testsuite/threads/MP_atomic.wast",
457
"misc_testsuite/threads/MP_wait.wast",
458
"misc_testsuite/threads/SB.wast",
459
"misc_testsuite/threads/SB_atomic.wast",
460
"misc_testsuite/threads/atomics_notify.wast",
461
"misc_testsuite/threads/atomics_wait_address.wast",
462
"misc_testsuite/threads/wait_notify.wast",
463
"spec_testsuite/proposals/threads/atomic.wast",
464
"spec_testsuite/proposals/threads/exports.wast",
465
"spec_testsuite/proposals/threads/memory.wast",
466
];
467
468
if unsupported.iter().any(|part| self.path.ends_with(part)) {
469
return true;
470
}
471
}
472
473
if config.compiler.should_fail(&self.config) {
474
return true;
475
}
476
477
// Disable spec tests per target for proposals that Winch does not implement yet.
478
if config.compiler == Compiler::Winch {
479
// Common list for tests that fail in all targets supported by Winch.
480
let unsupported = [
481
"extended-const/elem.wast",
482
"extended-const/global.wast",
483
"misc_testsuite/component-model/modules.wast",
484
"misc_testsuite/externref-id-function.wast",
485
"misc_testsuite/externref-segment.wast",
486
"misc_testsuite/externref-segments.wast",
487
"misc_testsuite/externref-table-dropped-segment-issue-8281.wast",
488
"misc_testsuite/linking-errors.wast",
489
"misc_testsuite/many_table_gets_lead_to_gc.wast",
490
"misc_testsuite/mutable_externref_globals.wast",
491
"misc_testsuite/no-mixup-stack-maps.wast",
492
"misc_testsuite/no-panic.wast",
493
"misc_testsuite/simple_ref_is_null.wast",
494
"misc_testsuite/table_grow_with_funcref.wast",
495
"spec_testsuite/br_table.wast",
496
"spec_testsuite/global.wast",
497
"spec_testsuite/ref_func.wast",
498
"spec_testsuite/ref_is_null.wast",
499
"spec_testsuite/ref_null.wast",
500
"spec_testsuite/select.wast",
501
"spec_testsuite/table_fill.wast",
502
"spec_testsuite/table_get.wast",
503
"spec_testsuite/table_grow.wast",
504
"spec_testsuite/table_set.wast",
505
"spec_testsuite/table_size.wast",
506
"spec_testsuite/elem.wast",
507
"spec_testsuite/linking.wast",
508
];
509
510
if unsupported.iter().any(|part| self.path.ends_with(part)) {
511
return true;
512
}
513
514
#[cfg(target_arch = "aarch64")]
515
{
516
let unsupported = [
517
"misc_testsuite/int-to-float-splat.wast",
518
"misc_testsuite/issue6562.wast",
519
"misc_testsuite/memory64/simd.wast",
520
"misc_testsuite/simd/almost-extmul.wast",
521
"misc_testsuite/simd/canonicalize-nan.wast",
522
"misc_testsuite/simd/cvt-from-uint.wast",
523
"misc_testsuite/simd/edge-of-memory.wast",
524
"misc_testsuite/simd/interesting-float-splat.wast",
525
"misc_testsuite/simd/issue4807.wast",
526
"misc_testsuite/simd/issue6725-no-egraph-panic.wast",
527
"misc_testsuite/simd/issue_3173_select_v128.wast",
528
"misc_testsuite/simd/issue_3327_bnot_lowering.wast",
529
"misc_testsuite/simd/load_splat_out_of_bounds.wast",
530
"misc_testsuite/simd/replace-lane-preserve.wast",
531
"misc_testsuite/simd/spillslot-size-fuzzbug.wast",
532
"misc_testsuite/simd/sse-cannot-fold-unaligned-loads.wast",
533
"misc_testsuite/simd/unaligned-load.wast",
534
"misc_testsuite/simd/v128-select.wast",
535
"misc_testsuite/winch/issue-10331.wast",
536
"misc_testsuite/winch/issue-10357.wast",
537
"misc_testsuite/winch/issue-10460.wast",
538
"misc_testsuite/winch/replace_lane.wast",
539
"misc_testsuite/winch/simd_multivalue.wast",
540
"misc_testsuite/winch/v128_load_lane_invalid_address.wast",
541
"spec_testsuite/proposals/annotations/simd_lane.wast",
542
"spec_testsuite/proposals/multi-memory/simd_memory-multi.wast",
543
"spec_testsuite/simd_address.wast",
544
"spec_testsuite/simd_align.wast",
545
"spec_testsuite/simd_bit_shift.wast",
546
"spec_testsuite/simd_bitwise.wast",
547
"spec_testsuite/simd_boolean.wast",
548
"spec_testsuite/simd_const.wast",
549
"spec_testsuite/simd_conversions.wast",
550
"spec_testsuite/simd_f32x4.wast",
551
"spec_testsuite/simd_f32x4_arith.wast",
552
"spec_testsuite/simd_f32x4_cmp.wast",
553
"spec_testsuite/simd_f32x4_pmin_pmax.wast",
554
"spec_testsuite/simd_f32x4_rounding.wast",
555
"spec_testsuite/simd_f64x2.wast",
556
"spec_testsuite/simd_f64x2_arith.wast",
557
"spec_testsuite/simd_f64x2_cmp.wast",
558
"spec_testsuite/simd_f64x2_pmin_pmax.wast",
559
"spec_testsuite/simd_f64x2_rounding.wast",
560
"spec_testsuite/simd_i16x8_arith.wast",
561
"spec_testsuite/simd_i16x8_arith2.wast",
562
"spec_testsuite/simd_i16x8_cmp.wast",
563
"spec_testsuite/simd_i16x8_extadd_pairwise_i8x16.wast",
564
"spec_testsuite/simd_i16x8_extmul_i8x16.wast",
565
"spec_testsuite/simd_i16x8_q15mulr_sat_s.wast",
566
"spec_testsuite/simd_i16x8_sat_arith.wast",
567
"spec_testsuite/simd_i32x4_arith.wast",
568
"spec_testsuite/simd_i32x4_arith2.wast",
569
"spec_testsuite/simd_i32x4_cmp.wast",
570
"spec_testsuite/simd_i32x4_dot_i16x8.wast",
571
"spec_testsuite/simd_i32x4_extadd_pairwise_i16x8.wast",
572
"spec_testsuite/simd_i32x4_extmul_i16x8.wast",
573
"spec_testsuite/simd_i32x4_trunc_sat_f32x4.wast",
574
"spec_testsuite/simd_i32x4_trunc_sat_f64x2.wast",
575
"spec_testsuite/simd_i64x2_arith.wast",
576
"spec_testsuite/simd_i64x2_arith2.wast",
577
"spec_testsuite/simd_i64x2_cmp.wast",
578
"spec_testsuite/simd_i64x2_extmul_i32x4.wast",
579
"spec_testsuite/simd_i8x16_arith.wast",
580
"spec_testsuite/simd_i8x16_arith2.wast",
581
"spec_testsuite/simd_i8x16_cmp.wast",
582
"spec_testsuite/simd_i8x16_sat_arith.wast",
583
"spec_testsuite/simd_int_to_int_extend.wast",
584
"spec_testsuite/simd_lane.wast",
585
"spec_testsuite/simd_load.wast",
586
"spec_testsuite/simd_load16_lane.wast",
587
"spec_testsuite/simd_load32_lane.wast",
588
"spec_testsuite/simd_load64_lane.wast",
589
"spec_testsuite/simd_load8_lane.wast",
590
"spec_testsuite/simd_load_extend.wast",
591
"spec_testsuite/simd_load_splat.wast",
592
"spec_testsuite/simd_load_zero.wast",
593
"spec_testsuite/simd_select.wast",
594
"spec_testsuite/simd_splat.wast",
595
"spec_testsuite/simd_store.wast",
596
"spec_testsuite/simd_store16_lane.wast",
597
"spec_testsuite/simd_store32_lane.wast",
598
"spec_testsuite/simd_store64_lane.wast",
599
"spec_testsuite/simd_store8_lane.wast",
600
];
601
602
if unsupported.iter().any(|part| self.path.ends_with(part)) {
603
return true;
604
}
605
}
606
607
#[cfg(target_arch = "x86_64")]
608
{
609
let unsupported = [
610
// externref/reference-types related
611
// simd-related failures
612
"misc_testsuite/simd/canonicalize-nan.wast",
613
];
614
615
if unsupported.iter().any(|part| self.path.ends_with(part)) {
616
return true;
617
}
618
619
// SIMD on Winch requires AVX instructions.
620
#[cfg(target_arch = "x86_64")]
621
if !(std::is_x86_feature_detected!("avx") && std::is_x86_feature_detected!("avx2"))
622
{
623
let unsupported = [
624
"annotations/simd_lane.wast",
625
"memory64/simd.wast",
626
"misc_testsuite/int-to-float-splat.wast",
627
"misc_testsuite/issue6562.wast",
628
"misc_testsuite/simd/almost-extmul.wast",
629
"misc_testsuite/simd/cvt-from-uint.wast",
630
"misc_testsuite/simd/edge-of-memory.wast",
631
"misc_testsuite/simd/issue_3327_bnot_lowering.wast",
632
"misc_testsuite/simd/issue6725-no-egraph-panic.wast",
633
"misc_testsuite/simd/replace-lane-preserve.wast",
634
"misc_testsuite/simd/spillslot-size-fuzzbug.wast",
635
"misc_testsuite/simd/sse-cannot-fold-unaligned-loads.wast",
636
"misc_testsuite/winch/issue-10331.wast",
637
"misc_testsuite/winch/replace_lane.wast",
638
"spec_testsuite/simd_align.wast",
639
"spec_testsuite/simd_boolean.wast",
640
"spec_testsuite/simd_conversions.wast",
641
"spec_testsuite/simd_f32x4.wast",
642
"spec_testsuite/simd_f32x4_arith.wast",
643
"spec_testsuite/simd_f32x4_cmp.wast",
644
"spec_testsuite/simd_f32x4_pmin_pmax.wast",
645
"spec_testsuite/simd_f32x4_rounding.wast",
646
"spec_testsuite/simd_f64x2.wast",
647
"spec_testsuite/simd_f64x2_arith.wast",
648
"spec_testsuite/simd_f64x2_cmp.wast",
649
"spec_testsuite/simd_f64x2_pmin_pmax.wast",
650
"spec_testsuite/simd_f64x2_rounding.wast",
651
"spec_testsuite/simd_i16x8_cmp.wast",
652
"spec_testsuite/simd_i32x4_cmp.wast",
653
"spec_testsuite/simd_i64x2_arith2.wast",
654
"spec_testsuite/simd_i64x2_cmp.wast",
655
"spec_testsuite/simd_i8x16_arith2.wast",
656
"spec_testsuite/simd_i8x16_cmp.wast",
657
"spec_testsuite/simd_int_to_int_extend.wast",
658
"spec_testsuite/simd_load.wast",
659
"spec_testsuite/simd_load_extend.wast",
660
"spec_testsuite/simd_load_splat.wast",
661
"spec_testsuite/simd_load_zero.wast",
662
"spec_testsuite/simd_splat.wast",
663
"spec_testsuite/simd_store16_lane.wast",
664
"spec_testsuite/simd_store32_lane.wast",
665
"spec_testsuite/simd_store64_lane.wast",
666
"spec_testsuite/simd_store8_lane.wast",
667
"spec_testsuite/simd_load16_lane.wast",
668
"spec_testsuite/simd_load32_lane.wast",
669
"spec_testsuite/simd_load64_lane.wast",
670
"spec_testsuite/simd_load8_lane.wast",
671
"spec_testsuite/simd_bitwise.wast",
672
"misc_testsuite/simd/load_splat_out_of_bounds.wast",
673
"misc_testsuite/simd/unaligned-load.wast",
674
"multi-memory/simd_memory-multi.wast",
675
"misc_testsuite/simd/issue4807.wast",
676
"spec_testsuite/simd_const.wast",
677
"spec_testsuite/simd_i8x16_sat_arith.wast",
678
"spec_testsuite/simd_i64x2_arith.wast",
679
"spec_testsuite/simd_i16x8_arith.wast",
680
"spec_testsuite/simd_i16x8_arith2.wast",
681
"spec_testsuite/simd_i16x8_q15mulr_sat_s.wast",
682
"spec_testsuite/simd_i16x8_sat_arith.wast",
683
"spec_testsuite/simd_i32x4_arith.wast",
684
"spec_testsuite/simd_i32x4_dot_i16x8.wast",
685
"spec_testsuite/simd_i32x4_trunc_sat_f32x4.wast",
686
"spec_testsuite/simd_i32x4_trunc_sat_f64x2.wast",
687
"spec_testsuite/simd_i8x16_arith.wast",
688
"spec_testsuite/simd_bit_shift.wast",
689
"spec_testsuite/simd_lane.wast",
690
"spec_testsuite/simd_i16x8_extmul_i8x16.wast",
691
"spec_testsuite/simd_i32x4_extmul_i16x8.wast",
692
"spec_testsuite/simd_i64x2_extmul_i32x4.wast",
693
"spec_testsuite/simd_i16x8_extadd_pairwise_i8x16.wast",
694
"spec_testsuite/simd_i32x4_extadd_pairwise_i16x8.wast",
695
"spec_testsuite/simd_i32x4_arith2.wast",
696
];
697
698
if unsupported.iter().any(|part| self.path.ends_with(part)) {
699
return true;
700
}
701
}
702
}
703
}
704
705
// Not implemented in Wasmtime anywhere yet.
706
if self.config.custom_descriptors() {
707
let happens_to_work =
708
["spec_testsuite/proposals/custom-descriptors/binary-leb128.wast"];
709
710
if happens_to_work.iter().any(|part| self.path.ends_with(part)) {
711
return false;
712
}
713
return true;
714
}
715
716
false
717
}
718
}
719
720
fn spec_proposal_from_path(path: &Path) -> Option<&str> {
721
let mut iter = path.iter();
722
loop {
723
match iter.next()?.to_str()? {
724
"proposals" => break,
725
_ => {}
726
}
727
}
728
Some(iter.next()?.to_str()?)
729
}
730
731