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:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user