mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
Add assembly generation test to x86_64 subtraction instruction
This commit is contained in:
parent
414bad5b28
commit
7f27f9b854
1 changed files with 28 additions and 0 deletions
|
@ -1581,6 +1581,34 @@ mod tests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_sub_reg64_reg64() {
|
||||||
|
let arena = bumpalo::Bump::new();
|
||||||
|
let mut buf = bumpalo::vec![in &arena];
|
||||||
|
for ((dst, src), expected) in &[
|
||||||
|
(
|
||||||
|
(X86_64GeneralReg::RAX, X86_64GeneralReg::RAX),
|
||||||
|
[0x48, 0x29, 0xC0],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
(X86_64GeneralReg::RAX, X86_64GeneralReg::R15),
|
||||||
|
[0x4C, 0x29, 0xF8],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
(X86_64GeneralReg::R15, X86_64GeneralReg::RAX),
|
||||||
|
[0x49, 0x29, 0xC7],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
(X86_64GeneralReg::R15, X86_64GeneralReg::R15),
|
||||||
|
[0x4D, 0x29, 0xFF],
|
||||||
|
),
|
||||||
|
] {
|
||||||
|
buf.clear();
|
||||||
|
sub_reg64_reg64(&mut buf, *dst, *src);
|
||||||
|
assert_eq!(expected, &buf[..]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_addsd_freg64_freg64() {
|
fn test_addsd_freg64_freg64() {
|
||||||
let arena = bumpalo::Bump::new();
|
let arena = bumpalo::Bump::new();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue