Skip to content

Commit e463354

Browse files
committed
Handle double undescores in symbol names
1 parent 5353052 commit e463354

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

crates/stdsimd-test/src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,16 @@ struct Instruction {
5959

6060
fn normalize(symbol: &str) -> String {
6161
let symbol = rustc_demangle::demangle(symbol).to_string();
62-
match symbol.rfind("::h") {
62+
let mut ret = match symbol.rfind("::h") {
6363
Some(i) => symbol[..i].to_string(),
6464
None => symbol.to_string(),
65+
};
66+
// Normalize to no leading underscore to handle platforms that may
67+
// inject extra ones in symbol names
68+
while ret.starts_with("_") {
69+
ret.remove(0);
6570
}
71+
return ret;
6672
}
6773

6874
/// Main entry point for this crate, called by the `#[assert_instr]` macro.

0 commit comments

Comments
 (0)