MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / should_fail

Method should_fail

crates/test-util/src/wast.rs:386–429  ·  view source on GitHub ↗

Returns whether this compiler is known to fail for the provided `TestConfig`. This function will determine if the configuration of the test provided is known to guarantee fail. This effectively tracks the proposal support for each compiler backend/runtime and tests whether `config` enables or disables features that aren't supported. Note that this is closely aligned with `Config::compiler_panick

(&self, config: &TestConfig)

Source from the content-addressed store, hash-verified

384 /// Note that this is closely aligned with
385 /// `Config::compiler_panicking_wasm_features`.
386 pub fn should_fail(&self, config: &TestConfig) -> bool {
387 match self {
388 Compiler::CraneliftNative => {
389 if config.legacy_exceptions() {
390 return true;
391 }
392
393 // Stack-switching is only implemented on x86_64 for unix
394 // platforms right now.
395 if config.stack_switching() && !(cfg!(target_arch = "x86_64") && cfg!(unix)) {
396 return true;
397 }
398
399 false
400 }
401
402 Compiler::Winch => {
403 if config.gc()
404 || config.tail_call()
405 || config.function_references()
406 || config.gc()
407 || config.relaxed_simd()
408 || config.gc_types()
409 || config.exceptions()
410 || config.legacy_exceptions()
411 || config.stack_switching()
412 || config.legacy_exceptions()
413 || config.component_model_async()
414 {
415 return true;
416 }
417
418 if cfg!(target_arch = "aarch64") {
419 return (config.simd() && !config.spec_test()) || config.threads();
420 }
421
422 !cfg!(target_arch = "x86_64")
423 }
424
425 Compiler::CraneliftPulley => {
426 config.threads() || config.legacy_exceptions() || config.stack_switching()
427 }
428 }
429 }
430
431 /// Returns whether this compiler configuration supports the current host
432 /// architecture.

Callers 2

run_wastFunction · 0.80
wast_testFunction · 0.80

Calls 4

supports_hostMethod · 0.80
anyMethod · 0.80
gcMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected