Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 4f1b72f

Browse files
committed
Fix tests on Windows
Can't use `:` in filenames on Windows prtest:full
1 parent 202e12e commit 4f1b72f

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

crates/cranelift/src/compiler.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -975,14 +975,14 @@ impl FunctionCompiler<'_> {
975975
(builder, block0)
976976
}
977977

978-
fn finish(self, clif_filename: &str) -> Result<CompiledFunction, CompileError> {
979-
self.finish_with_info(None, clif_filename)
978+
fn finish(self, symbol: &str) -> Result<CompiledFunction, CompileError> {
979+
self.finish_with_info(None, symbol)
980980
}
981981

982982
fn finish_with_info(
983983
mut self,
984984
body_and_tunables: Option<(&FunctionBody<'_>, &Tunables)>,
985-
clif_filename: &str,
985+
symbol: &str,
986986
) -> Result<CompiledFunction, CompileError> {
987987
let context = &mut self.cx.codegen_context;
988988
let isa = &*self.compiler.isa;
@@ -998,7 +998,7 @@ impl FunctionCompiler<'_> {
998998
if let Some(path) = &self.compiler.clif_dir {
999999
use std::io::Write;
10001000

1001-
let mut path = path.join(clif_filename);
1001+
let mut path = path.join(symbol.replace(":", "-"));
10021002
path.set_extension("clif");
10031003

10041004
let mut output = std::fs::File::create(path).unwrap();

tests/disas.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl Test {
221221
let entry = entry.context("failed to iterate over tempdir")?;
222222
let path = entry.path();
223223
if let Some(name) = path.file_name().and_then(|s| s.to_str()) {
224-
let filter = self.config.filter.as_deref().unwrap_or("wasm[0]::function");
224+
let filter = self.config.filter.as_deref().unwrap_or("wasm[0]--function");
225225
if !name.contains(filter) {
226226
continue;
227227
}

tests/disas/component-model/enum.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
;;! target = "riscv64"
22
;;! test = 'optimize'
3-
;;! filter = 'wasm[2]::function[1]'
3+
;;! filter = 'wasm[2]--function[1]'
44

55
(component
66
(type $a (enum "a" "b" "c"))

0 commit comments

Comments
 (0)