Skip to content

Commit

Permalink
Added test_arch_systemz_detail(), pr fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
garnt authored and tmfink committed May 27, 2024
1 parent 0a35806 commit 4265854
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 2 deletions.
2 changes: 0 additions & 2 deletions capstone-rs/src/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,6 @@ impl<'a> InsnDetail<'a> {
$detail($insn_detail(unsafe { &self.0.__bindgen_anon_1.$arch }))
}
)*
#[allow(unreachable_patterns)]
_ => panic!("Unsupported detail arch"),
}
}
}
Expand Down
59 changes: 59 additions & 0 deletions capstone-rs/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2491,6 +2491,65 @@ fn test_arch_systemz() {
);
}

#[test]
fn test_arch_systemz_detail() {
use crate::arch::sysz::SysZOperand::*;
use crate::arch::sysz::SysZReg::*;
use crate::arch::sysz::*;
use capstone_sys::sysz_op_mem;

test_arch_mode_endian_insns_detail(
&mut Capstone::new()
.sysz()
.mode(sysz::ArchMode::Default)
.build()
.unwrap(),
Arch::SYSZ,
Mode::Default,
None,
&[],
&[
// br %r7
DII::new("br", b"\x07\xf7", &[Reg(RegId(SYSZ_REG_7 as RegIdInt))]),
// ear %r7, %a8
DII::new(
"ear",
b"\xb2\x4f\x00\x78",
&[
Reg(RegId(SYSZ_REG_7 as RegIdInt)),
Reg(RegId(SYSZ_REG_A8 as RegIdInt)),
],
),
// adb %f0, 0
DII::new(
"adb",
b"\xed\x00\x00\x00\x00\x1a",
&[Reg(RegId(SYSZ_REG_F0 as RegIdInt)), Imm(0)],
),
// afi %r0, -0x80000000
DII::new(
"afi",
b"\xc2\x09\x80\x00\x00\x00",
&[Reg(RegId(SYSZ_REG_0 as RegIdInt)), Imm(-0x80000000)],
),
// a %r0, 0xfff(%r15, %r1)
DII::new(
"a",
b"\x5a\x0f\x1f\xff",
&[
Reg(RegId(SYSZ_REG_0 as RegIdInt)),
Mem(SysZOpMem(sysz_op_mem {
base: SYSZ_REG_1 as u8,
index: SYSZ_REG_15 as u8,
disp: 0xfff,
length: 0,
})),
],
),
],
);
}

#[test]
fn test_arch_tms320c64x_detail() {
use crate::arch::tms320c64x::{
Expand Down

0 comments on commit 4265854

Please sign in to comment.