cranelift: Add wasm tests for duplicate loads (#5514)

* cranelift-filetests: Add the ability to test optimized CLIF in Wasm tests

* cranelift: Add Wasm tests for identical loads, back to back
This commit is contained in:
Nick Fitzgerald
2023-01-04 10:52:32 -08:00
committed by GitHub
parent 7c67378ab6
commit d1920f5a2d
4 changed files with 215 additions and 0 deletions

View File

@@ -18,6 +18,9 @@ pub struct TestConfig {
#[serde(default)]
pub compile: bool,
#[serde(default)]
pub optimize: bool,
#[serde(default)]
pub settings: Vec<String>,
@@ -30,6 +33,13 @@ pub struct TestConfig {
impl TestConfig {
pub fn validate(&self) -> Result<()> {
if self.compile || self.optimize {
ensure!(
!(self.compile && self.optimize),
"The `compile` and `optimize` options are mutually exclusive."
);
}
for global in self.globals.values() {
ensure!(
global.vmctx || global.load.is_some(),