Skip to content

Commit

Permalink
Make assert_instr stricter
Browse files Browse the repository at this point in the history
  • Loading branch information
sayantn committed Dec 20, 2024
1 parent a514252 commit 47fb609
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/stdarch-test/src/disassembly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ fn parse(output: &str) -> HashSet<Function> {
instruction
.split_whitespace()
.skip(1)
.skip_while(|s| *s == "lock" || *s == "{evex}") // skip x86-specific prefix
.skip_while(|s| *s == "lock" || *s == "{evex}" || *s == "{vex}") // skip x86-specific prefix
.map(std::string::ToString::to_string)
.collect::<Vec<String>>()
};
Expand Down
2 changes: 1 addition & 1 deletion crates/stdarch-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub fn assert(shim_addr: usize, fnname: &str, expected: &str) {
// 2. It is a mark, indicating that the instruction will be
// compiled into other instructions - mainly because of llvm
// optimization.
let found = expected == "nop" || instrs.iter().any(|s| s.contains(expected));
let found = expected == "nop" || instrs.iter().any(|s| s.starts_with(expected));

// Look for subroutine call instructions in the disassembly to detect whether
// inlining failed: all intrinsics are `#[inline(always)]`, so calling one
Expand Down

0 comments on commit 47fb609

Please sign in to comment.