@@ -2091,9 +2091,7 @@ fn test_arch_hppa() {
20912091 Some ( Endian :: Big ) ,
20922092 & [ ] ,
20932093 & [
2094- // Upstream bug: access to uninitialized value
2095- // https://github.com/capstone-engine/capstone/issues/2717
2096- // ("ldsid", b"\x00\x20\x50\xa2"),
2094+ ( "ldsid" , b"\x00 \x20 \x50 \xa2 " ) ,
20972095 ( "mtsp" , b"\x00 \x01 \x58 \x20 " ) ,
20982096 ] ,
20992097 ) ;
@@ -2102,8 +2100,8 @@ fn test_arch_hppa() {
21022100#[ cfg( feature = "arch_hppa" ) ]
21032101#[ test]
21042102fn test_arch_hppa_detail ( ) {
2105- use crate :: arch:: hppa:: HppaOperand ;
2106- use capstone_sys:: hppa_reg:: * ;
2103+ use crate :: arch:: hppa:: { HppaMem , HppaOperand } ;
2104+ use capstone_sys:: { hppa_mem , hppa_reg:: * } ;
21072105
21082106 test_arch_mode_endian_insns_detail (
21092107 & mut Capstone :: new ( )
@@ -2117,10 +2115,6 @@ fn test_arch_hppa_detail() {
21172115 Some ( Endian :: Big ) ,
21182116 & [ ] ,
21192117 & [
2120- // Upstream bug: access to uninitialized value
2121- // https://github.com/capstone-engine/capstone/issues/2717
2122- // ldsid (sr1, r1), rp
2123- /*
21242118 DII :: new (
21252119 "ldsid" ,
21262120 b"\x00 \x20 \x50 \xa2 " ,
@@ -2129,17 +2123,15 @@ fn test_arch_hppa_detail() {
21292123 op_type : hppa:: HppaOperandType :: Mem ( HppaMem ( hppa_mem {
21302124 base : HPPA_REG_GR1 ,
21312125 space : HPPA_REG_SR1 ,
2132- base_access: cs_ac_type::CS_AC_READ,
21332126 } ) ) ,
2134- access: None ,
2127+ access : Some ( RegAccessType :: ReadOnly ) ,
21352128 } ,
21362129 HppaOperand {
21372130 op_type : hppa:: HppaOperandType :: Reg ( RegId ( HPPA_REG_GR2 as RegIdInt ) ) ,
21382131 access : Some ( RegAccessType :: WriteOnly ) ,
21392132 } ,
21402133 ] ,
21412134 ) ,
2142- */
21432135 // mtsp r1, sr1
21442136 DII :: new (
21452137 "mtsp" ,
@@ -3373,12 +3365,13 @@ fn test_arch_sparc() {
33733365 test_arch_mode_endian_insns (
33743366 & mut Capstone :: new ( )
33753367 . sparc ( )
3376- . mode ( sparc:: ArchMode :: Default )
3368+ . mode ( sparc:: ArchMode :: V9 )
3369+ . endian ( Endian :: Big )
33773370 . build ( )
33783371 . unwrap ( ) ,
33793372 Arch :: SPARC ,
3380- Mode :: Default ,
3381- None ,
3373+ Mode :: V9 ,
3374+ Some ( Endian :: Big ) ,
33823375 & [ ] ,
33833376 & [
33843377 ( "cmp" , b"\x80 \xa0 \x40 \x02 " ) ,
@@ -3404,6 +3397,7 @@ fn test_arch_sparc() {
34043397 & mut Capstone :: new ( )
34053398 . sparc ( )
34063399 . mode ( sparc:: ArchMode :: V9 )
3400+ . endian ( Endian :: Big )
34073401 . build ( )
34083402 . unwrap ( ) ,
34093403 Arch :: SPARC ,
@@ -3430,12 +3424,13 @@ fn test_arch_sparc_detail() {
34303424 test_arch_mode_endian_insns_detail (
34313425 & mut Capstone :: new ( )
34323426 . sparc ( )
3433- . mode ( sparc:: ArchMode :: Default )
3427+ . mode ( sparc:: ArchMode :: V9 )
3428+ . endian ( Endian :: Big )
34343429 . build ( )
34353430 . unwrap ( ) ,
34363431 Arch :: SPARC ,
3437- Mode :: Default ,
3438- None ,
3432+ Mode :: V9 ,
3433+ Some ( Endian :: Big ) ,
34393434 & [ ] ,
34403435 & [
34413436 // cmp %g1, %g2
@@ -3453,7 +3448,7 @@ fn test_arch_sparc_detail() {
34533448 b"\x85 \xc2 \x60 \x08 " ,
34543449 & [
34553450 Mem ( SparcOpMem ( sparc_op_mem {
3456- base : SPARC_REG_O1 as u8 ,
3451+ base : SPARC_REG_O1 ,
34573452 index : 0 ,
34583453 disp : 8 ,
34593454 } ) ) ,
@@ -3482,7 +3477,7 @@ fn test_arch_sparc_detail() {
34823477 b"\xd5 \xf6 \x10 \x16 " ,
34833478 & [
34843479 Mem ( SparcOpMem ( sparc_op_mem {
3485- base : SPARC_REG_I0 as u8 ,
3480+ base : SPARC_REG_I0 ,
34863481 index : 0 ,
34873482 disp : 0 ,
34883483 } ) ) ,
@@ -3531,7 +3526,7 @@ fn test_arch_sparc_detail() {
35313526 & [
35323527 Reg ( RegId ( SPARC_REG_O2 as RegIdInt ) ) ,
35333528 Mem ( SparcOpMem ( sparc_op_mem {
3534- base : SPARC_REG_G1 as u8 ,
3529+ base : SPARC_REG_G1 ,
35353530 index : 0 ,
35363531 disp : 0 ,
35373532 } ) ) ,
@@ -3543,8 +3538,8 @@ fn test_arch_sparc_detail() {
35433538 b"\xd4 \x4e \x00 \x16 " ,
35443539 & [
35453540 Mem ( SparcOpMem ( sparc_op_mem {
3546- base : SPARC_REG_I0 as u8 ,
3547- index : SPARC_REG_L6 as u8 ,
3541+ base : SPARC_REG_I0 ,
3542+ index : SPARC_REG_L6 ,
35483543 disp : 0 ,
35493544 } ) ) ,
35503545 Reg ( RegId ( SPARC_REG_O2 as RegIdInt ) ) ,
@@ -3556,6 +3551,26 @@ fn test_arch_sparc_detail() {
35563551 b"\x2a \xc2 \x80 \x03 " ,
35573552 & [ Reg ( RegId ( SPARC_REG_O2 as RegIdInt ) ) , Imm ( 0x1044 ) ] ,
35583553 ) ,
3554+ // membar #LoadLoad
3555+ DII :: new (
3556+ "membar" ,
3557+ b"\x81 \x43 \xe0 \x01 " ,
3558+ & [ MembarTag ( SparcMembarTag :: SPARC_MEMBAR_TAG_LOADLOAD ) ] ,
3559+ ) ,
3560+ // ldstuba [%i0+%l6] 4, %o2
3561+ DII :: new (
3562+ "ldstuba" ,
3563+ b"\xd4 \xee \x00 \x96 " ,
3564+ & [
3565+ Mem ( SparcOpMem ( sparc_op_mem {
3566+ base : SPARC_REG_I0 ,
3567+ index : SPARC_REG_L6 ,
3568+ disp : 0 ,
3569+ } ) ) ,
3570+ Asi ( SparcAsi :: SPARC_ASITAG_ASI_N ) ,
3571+ Reg ( RegId ( SPARC_REG_O2 as RegIdInt ) ) ,
3572+ ] ,
3573+ ) ,
35593574 ] ,
35603575 ) ;
35613576
@@ -3568,21 +3583,24 @@ fn test_arch_sparc_detail() {
35683583 & mut Capstone :: new ( )
35693584 . sparc ( )
35703585 . mode ( sparc:: ArchMode :: V9 )
3586+ . endian ( Endian :: Big )
35713587 . build ( )
35723588 . unwrap ( ) ,
35733589 Arch :: SPARC ,
35743590 Mode :: V9 ,
3575- None ,
3591+ Some ( Endian :: Big ) ,
35763592 & [ ] ,
35773593 & [
35783594 // fcmps %f0, %f4
35793595 DII :: new ( "fcmps" , b"\x81 \xa8 \x0a \x24 " , & f0_f4) ,
3596+ // Upstream bug
3597+ // https://github.com/capstone-engine/capstone/issues/2749
35803598 // fstox %f0, %f4
3581- DII :: new ( "fstox" , b"\x89 \xa0 \x10 \x20 " , & f0_f4) ,
3599+ // DII::new("fstox", b"\x89\xa0\x10\x20", &f0_f4),
35823600 // fqtoi %f0, %f4
3583- DII :: new ( "fqtoi" , b"\x89 \xa0 \x1a \x60 " , & f0_f4) ,
3601+ // DII::new("fqtoi", b"\x89\xa0\x1a\x60", &f0_f4),
35843602 // fnegq %f0, %f4
3585- DII :: new ( "fnegq" , b"\x89 \xa0 \x00 \xe0 " , & f0_f4) ,
3603+ // DII::new("fnegq", b"\x89\xa0\x00\xe0", &f0_f4),
35863604 ] ,
35873605 ) ;
35883606}
0 commit comments