From c5e6d7a89ca1939092cc7d427379e5cfd7f55cd4 Mon Sep 17 00:00:00 2001 From: Henny Sipma Date: Sun, 6 Oct 2024 23:48:51 -0700 Subject: [PATCH] CHT: fix warnings and add tests to dune files --- .gitignore | 1 + .../txbchlib/bCHARMFunctionInterfaceTest.ml | 12 ++--- .../bchlib_tests/txbchlib/bCHFlocTest.ml | 13 ------ .../txbchlib/bCHFunctionInterfaceTest.ml | 8 +--- .../txbchlib/bCHMemoryReferenceTest.ml | 18 -------- .../txbchlib/bCHTypeConstraintStoreTest.ml | 2 - .../bchlib_tests/txbchlib/bCHXprUtilTest.ml | 6 --- .../CHT/CHB_tests/bchlib_tests/txbchlib/dune | 17 +++++-- .../tbchlibarm32/tCHBchlibarm32Utils.ml | 2 +- .../txbchlibelf/bCHDwarfTest.ml | 14 +----- .../bCHELFDebugAbbrevSectionTest.ml | 15 +----- .../txbchlibelf/bCHELFDebugLocSectionTest.ml | 29 ++++-------- .../bchlibelf_tests/txbchlibelf/dune | 4 -- .../bCHAssembleMIPSInstructionTest.ml | 26 +++-------- .../bCHDisassembleMIPSInstructionTest.ml | 46 ++++++------------- .../bchlibmips32_tests/txbchlibmips32/dune | 4 -- .../txbchlibpower32/Makefile | 1 + .../bCHDisassemblePowerInstructionTest.ml | 8 ---- .../bCHDisassembleVLEInstructionTest.ml | 10 +--- .../bchlibpower32_tests/txbchlibpower32/dune | 4 -- .../CHB_tests/bchlibx86_tests/tbchlibx86/dune | 4 -- .../bchlibx86_tests/txbchlibx86/Makefile | 1 + .../bCHDisassembleInstructionTest.ml | 16 +------ .../txbchlibx86/bCHDisassembleX0Test.ml | 16 +------ .../bchlibx86_tests/txbchlibx86/dune | 4 -- 25 files changed, 62 insertions(+), 219 deletions(-) diff --git a/.gitignore b/.gitignore index df0867de..16ab0ff9 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ _build/ *.mli~ *.sh~ *.yaml~ +*.i~ .gitignore~ # binary analyzer executables diff --git a/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHARMFunctionInterfaceTest.ml b/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHARMFunctionInterfaceTest.ml index 332c4fe5..b6d6c496 100644 --- a/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHARMFunctionInterfaceTest.ml +++ b/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHARMFunctionInterfaceTest.ml @@ -58,12 +58,12 @@ let get_arm_int_param_next_state_test () = TS.new_testsuite (testname ^ "_get_int_paramloc_next_test") lastupdated; - List.iter (fun (title, nxtreg, xlocreg, xnxtreg, xnxtoff) -> + List.iter (fun (title, nxtreg, _xlocreg, xnxtreg, xnxtoff) -> TS.add_simple_test ~title (fun () -> let aas = {aas_start_state with aas_next_core_reg = Some nxtreg} in - let (par, naas) = get_arm_int_param_next_state 4 "name" t_int aas 1 in + let (_par, naas) = get_arm_int_param_next_state 4 "name" t_int aas 1 in let xnaas = {aas_start_state with aas_next_core_reg = xnxtreg; aas_next_offset = xnxtoff} in @@ -76,7 +76,7 @@ let get_arm_int_param_next_state_test () = let aas = {aas_start_state with aas_next_core_reg = None; aas_next_offset = Some 0} in - let (par, naas) = get_arm_int_param_next_state 4 "name" t_int aas 1 in + let (_par, naas) = get_arm_int_param_next_state 4 "name" t_int aas 1 in let xnaas = {aas with aas_next_offset = Some 4} in BA.equal_arm_argument_state ~expected:xnaas ~received:naas ()); @@ -105,14 +105,14 @@ let get_arm_struct_field_locations_test () = parse_cil_file ~removeUnused:false "header.i"; - List.iter (fun (title, locations) -> + List.iter (fun (title, _locations) -> TS.add_simple_test ~title (fun () -> let cinfo = bcfiles#get_compinfo_by_name title in let finfo = List.hd cinfo.bcfields in let aas = push_field_pos aas_start_state finfo in - let (locs, naas) = get_arm_struct_field_locations finfo aas in + let (locs, _naas) = get_arm_struct_field_locations finfo aas in let xlocs = [ mk_register_parameter_location ~position:[mk_field_position cinfo.bckey 0 (get_struct_field_name finfo)] @@ -140,7 +140,7 @@ let get_arm_struct_param_next_state_test () = let cinfo = bcfiles#get_compinfo_by_name title in let btype = get_compinfo_struct_type cinfo in let size = CHTraceResult.tget_ok (size_of_btype btype) in - let (param, naas) = + let (param, _naas) = get_arm_struct_param_next_state size "arg_1" btype aas_start_state 1 in let xlocs = diff --git a/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHFlocTest.ml b/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHFlocTest.ml index 5fb26836..21753efc 100644 --- a/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHFlocTest.ml +++ b/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHFlocTest.ml @@ -28,19 +28,12 @@ (* chlib *) open CHNumerical -open CHPretty - -(* chutil *) -open CHLogger -open CHPrettyUtil (* xprlib *) open Xprt -open XprToPretty open XprTypes (* bchlib *) -open BCHBasicTypes open BCHBCFiles open BCHBCTypes open BCHConstantDefinitions @@ -49,7 +42,6 @@ open BCHFloc open BCHFunctionData open BCHFunctionInfo open BCHLibTypes -open BCHMemoryReference (* bchcil *) open BCHParseCilFile @@ -63,11 +55,6 @@ let testname = "bCHFlocTest" let lastupdated = "2024-08-20" -let x2p = xpr_formatter#pr_expr -let p2s = pretty_to_string -let x2s x = p2s (x2p x) - - let decompose_memvar_address_test () = let faddr = "0x1d6bfc" in let iaddr = "0x1d6cbc" in diff --git a/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHFunctionInterfaceTest.ml b/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHFunctionInterfaceTest.ml index 7b5de2f2..ad581b0a 100644 --- a/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHFunctionInterfaceTest.ml +++ b/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHFunctionInterfaceTest.ml @@ -5,7 +5,7 @@ ------------------------------------------------------------------------------ The MIT License (MIT) - Copyright (c) 2023 Aarno Labs LLC + Copyright (c) 2023-2024 Aarno Labs LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -35,10 +35,6 @@ (* chlib *) open CHPretty -open CHNumerical - -(* tchblib *) -open TCHSpecification (* bchlib *) open BCHBasicTypes @@ -181,7 +177,7 @@ let function_signature_of_bvarinfo_arm () = else raise (BCH_failure (LBLOCK [STR title; STR " not found"])) in - let (xresult, fintf, tsig) = + let (xresult, _fintf, tsig) = try let xresult = List.map BU.convert_fts_parameter_input result in let fintf = FI.bvarinfo_to_function_interface bvinfo in diff --git a/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHMemoryReferenceTest.ml b/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHMemoryReferenceTest.ml index cdc887bd..507d30a6 100644 --- a/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHMemoryReferenceTest.ml +++ b/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHMemoryReferenceTest.ml @@ -28,26 +28,13 @@ (* chlib *) open CHNumerical -open CHPretty - -(* chutil *) -open CHLogger -open CHPrettyUtil - -(* xprlib *) -open Xprt -open XprToPretty -open XprTypes (* bchlib *) -open BCHBasicTypes open BCHBCFiles open BCHBCTypes open BCHConstantDefinitions open BCHDoubleword -open BCHFloc open BCHFunctionData -open BCHFunctionInfo open BCHLibTypes (* bchcil *) @@ -65,11 +52,6 @@ let testname = "bCHMemoryReferenceTest" let lastupdated = "2024-08-21" -let x2p = xpr_formatter#pr_expr -let p2s = pretty_to_string -let x2s x = p2s (x2p x) - - let mk_maximal_memory_offset_test () = begin diff --git a/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHTypeConstraintStoreTest.ml b/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHTypeConstraintStoreTest.ml index e05cdcf9..1c69d906 100644 --- a/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHTypeConstraintStoreTest.ml +++ b/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHTypeConstraintStoreTest.ml @@ -36,8 +36,6 @@ open CHPretty (* bchlib *) open BCHBasicTypes open BCHBCFiles -open BCHBCTypePretty -open BCHCPURegisters open BCHFunctionInterface open BCHLibTypes open BCHSystemSettings diff --git a/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHXprUtilTest.ml b/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHXprUtilTest.ml index 64f2526c..67d12fb6 100644 --- a/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHXprUtilTest.ml +++ b/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/bCHXprUtilTest.ml @@ -28,14 +28,8 @@ (* chlib *) open CHNumerical -open CHPretty - -(* chutil *) -open CHPrettyUtil (* xprlib *) -open Xprt -open XprToPretty open XprTypes open Xsimplify diff --git a/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/dune b/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/dune index 34b1cd2c..8c26ce5c 100644 --- a/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/dune +++ b/CodeHawk/CHT/CHB_tests/bchlib_tests/txbchlib/dune @@ -1,3 +1,14 @@ -(tests - (names bCHDoublewordTest bCHImmediateTest bCHLocationTest bCHStreamWrapperTest) - (libraries bchlib chlib chutil tbchlib tchlib)) +(tests + (names + bCHDoublewordTest + bCHImmediateTest + bCHLocationTest + bCHStreamWrapperTest + bCHXprUtilTest + bCHMemoryReferenceTest + bCHFunctionInterfaceTest + bCHARMFunctionInterfaceTest + bCHTypeConstraintStoreTest + bCHFlocTest) + (deps header.i decompose_array_address.i) + (libraries bchcil bchlib xprlib chlib chutil tbchlib tchlib txprlib)) diff --git a/CodeHawk/CHT/CHB_tests/bchlibarm32_tests/tbchlibarm32/tCHBchlibarm32Utils.ml b/CodeHawk/CHT/CHB_tests/bchlibarm32_tests/tbchlibarm32/tCHBchlibarm32Utils.ml index 142048bc..1515a36f 100644 --- a/CodeHawk/CHT/CHB_tests/bchlibarm32_tests/tbchlibarm32/tCHBchlibarm32Utils.ml +++ b/CodeHawk/CHT/CHB_tests/bchlibarm32_tests/tbchlibarm32/tCHBchlibarm32Utils.ml @@ -125,7 +125,7 @@ let thumb_function_setup | _ -> () done; let _ = set_block_boundaries () in - let _ = construct_functions_arm ~construct_all_functions:false in + let _ = construct_functions_arm ~construct_all_functions:false () in get_arm_assembly_function faddr end diff --git a/CodeHawk/CHT/CHB_tests/bchlibelf_tests/txbchlibelf/bCHDwarfTest.ml b/CodeHawk/CHT/CHB_tests/bchlibelf_tests/txbchlibelf/bCHDwarfTest.ml index 33bb6caa..dd376f87 100644 --- a/CodeHawk/CHT/CHB_tests/bchlibelf_tests/txbchlibelf/bCHDwarfTest.ml +++ b/CodeHawk/CHT/CHB_tests/bchlibelf_tests/txbchlibelf/bCHDwarfTest.ml @@ -5,7 +5,7 @@ ------------------------------------------------------------------------------ The MIT License (MIT) - Copyright (c) 2023 Aarno Labs LLC + Copyright (c) 2023-2024 Aarno Labs LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -26,17 +26,8 @@ SOFTWARE. ============================================================================= *) -(* chlib *) -open CHPretty - -(* chutil *) -open CHXmlDocument -open CHXmlReader - (* bchlib *) -open BCHBasicTypes open BCHDoubleword -open BCHLibTypes open BCHStreamWrapper (* bchlibelf *) @@ -44,7 +35,6 @@ open BCHDwarf open BCHDwarfTypes open BCHDwarfUtils open BCHELFDebugAbbrevSection -open BCHELFTypes open BCHELFSectionHeader (* tchlib *) @@ -169,7 +159,7 @@ let decode_variable_die_test () = let sh = mk_elf_section_header () in let section = mk_elf_debug_abbrev_section astring sh in let abbreventry = section#get_abbrev_entry in - let fabbrev = fun (i: int) -> abbreventry in + let fabbrev = fun (_i: int) -> abbreventry in let chi = make_pushback_stream ~little_endian:true istring in let base = TR.tget_ok (string_to_doubleword base) in let var = diff --git a/CodeHawk/CHT/CHB_tests/bchlibelf_tests/txbchlibelf/bCHELFDebugAbbrevSectionTest.ml b/CodeHawk/CHT/CHB_tests/bchlibelf_tests/txbchlibelf/bCHELFDebugAbbrevSectionTest.ml index 07e5f190..98069878 100644 --- a/CodeHawk/CHT/CHB_tests/bchlibelf_tests/txbchlibelf/bCHELFDebugAbbrevSectionTest.ml +++ b/CodeHawk/CHT/CHB_tests/bchlibelf_tests/txbchlibelf/bCHELFDebugAbbrevSectionTest.ml @@ -5,7 +5,7 @@ ------------------------------------------------------------------------------ The MIT License (MIT) - Copyright (c) 2023 Aarno Labs LLC + Copyright (c) 2023-2024 Aarno Labs LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -26,21 +26,8 @@ SOFTWARE. ============================================================================= *) -(* chlib *) -open CHPretty - -(* chutil *) -open CHXmlDocument -open CHXmlReader - -(* bchlib *) -open BCHBasicTypes -open BCHLibTypes - (* bchlibelf *) -open BCHDwarfUtils open BCHELFDebugAbbrevSection -open BCHELFTypes open BCHELFSectionHeader (* tchlib *) diff --git a/CodeHawk/CHT/CHB_tests/bchlibelf_tests/txbchlibelf/bCHELFDebugLocSectionTest.ml b/CodeHawk/CHT/CHB_tests/bchlibelf_tests/txbchlibelf/bCHELFDebugLocSectionTest.ml index a45727ec..f2ac8393 100644 --- a/CodeHawk/CHT/CHB_tests/bchlibelf_tests/txbchlibelf/bCHELFDebugLocSectionTest.ml +++ b/CodeHawk/CHT/CHB_tests/bchlibelf_tests/txbchlibelf/bCHELFDebugLocSectionTest.ml @@ -1,11 +1,11 @@ (* ============================================================================= - CodeHawk Unit Testing Framework + CodeHawk Unit Testing Framework Author: Henny Sipma Adapted from: Kaputt (https://kaputt.x9c.fr/index.html) ------------------------------------------------------------------------------ The MIT License (MIT) - - Copyright (c) 2023 Aarno Labs LLC + + Copyright (c) 2023-2024 Aarno Labs LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -13,10 +13,10 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -26,21 +26,8 @@ SOFTWARE. ============================================================================= *) -(* chlib *) -open CHPretty - -(* chutil *) -open CHXmlDocument -open CHXmlReader - -(* bchlib *) -open BCHBasicTypes -open BCHLibTypes - (* bchlibelf *) -open BCHDwarfUtils open BCHELFDebugLocSection -open BCHELFTypes open BCHELFSectionHeader (* tchlib *) @@ -142,11 +129,12 @@ let debug_location_list_test () = ~title (fun () -> let bytes = bytes ^ "000000000000000000" in - let bytestring = U.write_hex_bytes_to_bytestring bytes in + let bytestring = U.write_hex_bytes_to_bytestring bytes in let sectionheader = mk_elf_section_header () in let section = mk_elf_debug_loc_section bytestring sectionheader in let loclist = section#get_location_list in - EA.equal_debug_location_list result loclist ())) tests; + EA.equal_debug_location_list + ~expected:result ~received:loclist ())) tests; TS.launch_tests () end @@ -158,4 +146,3 @@ let () = debug_location_list_test (); TS.exit_file () end - diff --git a/CodeHawk/CHT/CHB_tests/bchlibelf_tests/txbchlibelf/dune b/CodeHawk/CHT/CHB_tests/bchlibelf_tests/txbchlibelf/dune index 01ded517..57d4b761 100644 --- a/CodeHawk/CHT/CHB_tests/bchlibelf_tests/txbchlibelf/dune +++ b/CodeHawk/CHT/CHB_tests/bchlibelf_tests/txbchlibelf/dune @@ -1,7 +1,3 @@ (tests (names bCHDwarfTest bCHELFDebugAbbrevSectionTest bCHELFDebugLocSectionTest) (libraries bchlib bchlibelf chlib chutil tbchlibelf tchlib)) - -(env - (dev - (flags (:standard -warn-error -A)))) diff --git a/CodeHawk/CHT/CHB_tests/bchlibmips32_tests/txbchlibmips32/bCHAssembleMIPSInstructionTest.ml b/CodeHawk/CHT/CHB_tests/bchlibmips32_tests/txbchlibmips32/bCHAssembleMIPSInstructionTest.ml index d21a4125..e4e41353 100644 --- a/CodeHawk/CHT/CHB_tests/bchlibmips32_tests/txbchlibmips32/bCHAssembleMIPSInstructionTest.ml +++ b/CodeHawk/CHT/CHB_tests/bchlibmips32_tests/txbchlibmips32/bCHAssembleMIPSInstructionTest.ml @@ -1,11 +1,11 @@ (* ============================================================================= - CodeHawk Unit Testing Framework + CodeHawk Unit Testing Framework Author: Henny Sipma Adapted from: Kaputt (https://kaputt.x9c.fr/index.html) ------------------------------------------------------------------------------ The MIT License (MIT) - - Copyright (c) 2022 Aarno Labs LLC + + Copyright (c) 2022-2024 Aarno Labs LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -13,10 +13,10 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -26,20 +26,9 @@ SOFTWARE. ============================================================================= *) -(* chlib *) -open CHPretty - -(* chutil *) -open CHXmlDocument -open CHXmlReader - (* bchlib *) -open BCHBasicTypes open BCHLibTypes -(* bchlibmips32 *) -open BCHMIPSTypes - (* tchlib *) module TS = TCHTestSuite @@ -64,7 +53,6 @@ module TR = CHTraceResult let testname = "bCHAssembleMIPSInstructionTest" let lastupdated = "2022-12-18" -let make_dw (s: string) = TR.tget_ok (D.string_to_doubleword s) let make_stream ?(len=0) (s: string) = let bytestring = U.write_hex_bytes_to_bytestring s in @@ -127,8 +115,8 @@ let mips_assemble_sw_be () = TS.launch_tests () end - - + + let () = begin diff --git a/CodeHawk/CHT/CHB_tests/bchlibmips32_tests/txbchlibmips32/bCHDisassembleMIPSInstructionTest.ml b/CodeHawk/CHT/CHB_tests/bchlibmips32_tests/txbchlibmips32/bCHDisassembleMIPSInstructionTest.ml index 189700b2..4933c896 100644 --- a/CodeHawk/CHT/CHB_tests/bchlibmips32_tests/txbchlibmips32/bCHDisassembleMIPSInstructionTest.ml +++ b/CodeHawk/CHT/CHB_tests/bchlibmips32_tests/txbchlibmips32/bCHDisassembleMIPSInstructionTest.ml @@ -1,11 +1,11 @@ (* ============================================================================= - CodeHawk Unit Testing Framework + CodeHawk Unit Testing Framework Author: Henny Sipma Adapted from: Kaputt (https://kaputt.x9c.fr/index.html) ------------------------------------------------------------------------------ The MIT License (MIT) - - Copyright (c) 2022-2023 Aarno Labs LLC + + Copyright (c) 2022-2024 Aarno Labs LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -13,10 +13,10 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -26,20 +26,6 @@ SOFTWARE. ============================================================================= *) -(* chlib *) -open CHPretty - -(* chutil *) -open CHXmlDocument -open CHXmlReader - -(* bchlib *) -open BCHBasicTypes -open BCHLibTypes - -(* bchlibmips32 *) -open BCHMIPSTypes - (* tchlib *) module TS = TCHTestSuite @@ -66,7 +52,7 @@ let lastupdated = "2023-03-10" let make_dw (s: string) = TR.tget_ok (D.string_to_doubleword s) -let missing_I_opcodes = [ +let _missing_I_opcodes = [ "ldc1"; "ll"; "lwc1"; @@ -79,26 +65,26 @@ let missing_I_opcodes = [ "swc1" ] -let missing_I_opcode_branches = [ +let _missing_I_opcode_branches = [ "bgezal"; - "bltzal"; + "bltzal"; "teqi"; "blezl"; ] -let missing_R_opcode = [ +let _missing_R_opcode = [ "add", "mthi", "mtlo", "sub" ] -let missing_R2_opcode = [ +let _missing_R2_opcode = [ "madd"; "maddu" ] -let missing_R3_opcode = [ +let _missing_R3_opcode = [ "ext"; "ins"; "rdhwr"; @@ -257,7 +243,7 @@ let mips_R_opcode_be () = TS.launch_tests () end - + let mips_R2_opcode_be () = let tests = [ @@ -313,9 +299,9 @@ let mips_test_code_be () = ("sw-ra", "0x40516c", "afbf0010", "sw $ra, 0x10($sp)"); ("lw-t9", "0x494d98", "8f9983e0", "lw $t9, -0x7c20($gp)"); ("jalr-t9", "0x40518c", "0320f809", "jalr $ra, $t9"); - ("nop", "0x405178", "00000000", ""); + ("nop", "0x405178", "00000000", ""); ("lw-ra", "0x4052d4", "8fbf0010", "lw $ra, 0x10($sp)"); - ("jr-ra", "0x4051c0", "03e00008", "jr $ra"); + ("jr-ra", "0x4051c0", "03e00008", "jr $ra"); ("sp-inc-4", "0x45ff34", "27bd0014", "addiu $sp, $sp, 0x14"); ("move-a3", "0x494db4", "00063821", "move $a3, $a2"); ("move-a2", "0x494db8", "00053021", "move $a2, $a1"); @@ -338,9 +324,7 @@ let mips_test_code_be () = TS.launch_tests () end - - - + let () = begin diff --git a/CodeHawk/CHT/CHB_tests/bchlibmips32_tests/txbchlibmips32/dune b/CodeHawk/CHT/CHB_tests/bchlibmips32_tests/txbchlibmips32/dune index 15ccbcdc..bd7f54b9 100644 --- a/CodeHawk/CHT/CHB_tests/bchlibmips32_tests/txbchlibmips32/dune +++ b/CodeHawk/CHT/CHB_tests/bchlibmips32_tests/txbchlibmips32/dune @@ -1,7 +1,3 @@ (tests (names bCHAssembleMIPSInstructionTest bCHDisassembleMIPSInstructionTest) (libraries bchlib bchlibmips32 chlib chutil tchlib)) - -(env - (dev - (flags (:standard -warn-error -A)))) diff --git a/CodeHawk/CHT/CHB_tests/bchlibpower32_tests/txbchlibpower32/Makefile b/CodeHawk/CHT/CHB_tests/bchlibpower32_tests/txbchlibpower32/Makefile index ed49f60d..42df8917 100644 --- a/CodeHawk/CHT/CHB_tests/bchlibpower32_tests/txbchlibpower32/Makefile +++ b/CodeHawk/CHT/CHB_tests/bchlibpower32_tests/txbchlibpower32/Makefile @@ -100,4 +100,5 @@ clean: rm -f *.mli~ rm -f Makefile~ rm -f bCHDisassembleVLEInstructionTest + rm -f bCHDisassemblePowerInstructionTest rm -rf doc diff --git a/CodeHawk/CHT/CHB_tests/bchlibpower32_tests/txbchlibpower32/bCHDisassemblePowerInstructionTest.ml b/CodeHawk/CHT/CHB_tests/bchlibpower32_tests/txbchlibpower32/bCHDisassemblePowerInstructionTest.ml index d7056d9f..94776ea6 100644 --- a/CodeHawk/CHT/CHB_tests/bchlibpower32_tests/txbchlibpower32/bCHDisassemblePowerInstructionTest.ml +++ b/CodeHawk/CHT/CHB_tests/bchlibpower32_tests/txbchlibpower32/bCHDisassemblePowerInstructionTest.ml @@ -29,16 +29,8 @@ (* chlib *) open CHPretty -(* chutil *) -open CHXmlDocument -open CHXmlReader - (* bchlib *) open BCHBasicTypes -open BCHLibTypes - -(* bchlibpower32 *) -open BCHPowerTypes (* tchlib *) module TS = TCHTestSuite diff --git a/CodeHawk/CHT/CHB_tests/bchlibpower32_tests/txbchlibpower32/bCHDisassembleVLEInstructionTest.ml b/CodeHawk/CHT/CHB_tests/bchlibpower32_tests/txbchlibpower32/bCHDisassembleVLEInstructionTest.ml index 7427ff96..47a9d2a3 100644 --- a/CodeHawk/CHT/CHB_tests/bchlibpower32_tests/txbchlibpower32/bCHDisassembleVLEInstructionTest.ml +++ b/CodeHawk/CHT/CHB_tests/bchlibpower32_tests/txbchlibpower32/bCHDisassembleVLEInstructionTest.ml @@ -5,7 +5,7 @@ ------------------------------------------------------------------------------ The MIT License (MIT) - Copyright (c) 2022-2023 Aarno Labs LLC + Copyright (c) 2022-2024 Aarno Labs LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -29,16 +29,8 @@ (* chlib *) open CHPretty -(* chutil *) -open CHXmlDocument -open CHXmlReader - (* bchlib *) open BCHBasicTypes -open BCHLibTypes - -(* bchlibpower32 *) -open BCHPowerTypes (* tchlib *) module TS = TCHTestSuite diff --git a/CodeHawk/CHT/CHB_tests/bchlibpower32_tests/txbchlibpower32/dune b/CodeHawk/CHT/CHB_tests/bchlibpower32_tests/txbchlibpower32/dune index ddbacc58..08c3c9dd 100644 --- a/CodeHawk/CHT/CHB_tests/bchlibpower32_tests/txbchlibpower32/dune +++ b/CodeHawk/CHT/CHB_tests/bchlibpower32_tests/txbchlibpower32/dune @@ -1,7 +1,3 @@ (tests (names bCHDisassemblePowerInstructionTest bCHDisassembleVLEInstructionTest) (libraries bchlib bchlibpower32 chlib chutil tchlib)) - -(env - (dev - (flags (:standard -warn-error -A)))) diff --git a/CodeHawk/CHT/CHB_tests/bchlibx86_tests/tbchlibx86/dune b/CodeHawk/CHT/CHB_tests/bchlibx86_tests/tbchlibx86/dune index 87e3cf18..26d1e675 100644 --- a/CodeHawk/CHT/CHB_tests/bchlibx86_tests/tbchlibx86/dune +++ b/CodeHawk/CHT/CHB_tests/bchlibx86_tests/tbchlibx86/dune @@ -3,7 +3,3 @@ (libraries bchlib chlib chutil tchlib xprlib) (public_name codehawk.tbchlibx86) (wrapped false)) - -(env - (dev - (flags (:standard -warn-error -A)))) diff --git a/CodeHawk/CHT/CHB_tests/bchlibx86_tests/txbchlibx86/Makefile b/CodeHawk/CHT/CHB_tests/bchlibx86_tests/txbchlibx86/Makefile index e8561cc0..d2a81473 100644 --- a/CodeHawk/CHT/CHB_tests/bchlibx86_tests/txbchlibx86/Makefile +++ b/CodeHawk/CHT/CHB_tests/bchlibx86_tests/txbchlibx86/Makefile @@ -119,4 +119,5 @@ clean: rm -f *.mli~ rm -f Makefile~ rm -f bCHDisassembleInstructionTest + rm -f bCHDisassembleXOTest rm -rf doc diff --git a/CodeHawk/CHT/CHB_tests/bchlibx86_tests/txbchlibx86/bCHDisassembleInstructionTest.ml b/CodeHawk/CHT/CHB_tests/bchlibx86_tests/txbchlibx86/bCHDisassembleInstructionTest.ml index e311aa04..9c64d237 100644 --- a/CodeHawk/CHT/CHB_tests/bchlibx86_tests/txbchlibx86/bCHDisassembleInstructionTest.ml +++ b/CodeHawk/CHT/CHB_tests/bchlibx86_tests/txbchlibx86/bCHDisassembleInstructionTest.ml @@ -5,7 +5,7 @@ ------------------------------------------------------------------------------ The MIT License (MIT) - Copyright (c) 2023 Aarno Labs LLC + Copyright (c) 2023-2024 Aarno Labs LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -26,20 +26,6 @@ SOFTWARE. ============================================================================= *) -(* chlib *) -open CHPretty - -(* chutil *) -open CHXmlDocument -open CHXmlReader - -(* bchlib *) -open BCHBasicTypes -open BCHLibTypes - -(* bchlibx86 *) -open BCHLibx86Types - (* tchlib *) module TS = TCHTestSuite diff --git a/CodeHawk/CHT/CHB_tests/bchlibx86_tests/txbchlibx86/bCHDisassembleX0Test.ml b/CodeHawk/CHT/CHB_tests/bchlibx86_tests/txbchlibx86/bCHDisassembleX0Test.ml index 2d981fdf..49e2c50e 100644 --- a/CodeHawk/CHT/CHB_tests/bchlibx86_tests/txbchlibx86/bCHDisassembleX0Test.ml +++ b/CodeHawk/CHT/CHB_tests/bchlibx86_tests/txbchlibx86/bCHDisassembleX0Test.ml @@ -5,7 +5,7 @@ ------------------------------------------------------------------------------ The MIT License (MIT) - Copyright (c) 2023 Aarno Labs LLC + Copyright (c) 2023-2024 Aarno Labs LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -26,20 +26,6 @@ SOFTWARE. ============================================================================= *) -(* chlib *) -open CHPretty - -(* chutil *) -open CHXmlDocument -open CHXmlReader - -(* bchlib *) -open BCHBasicTypes -open BCHLibTypes - -(* bchlibx86 *) -open BCHLibx86Types - (* tchlib *) module TS = TCHTestSuite diff --git a/CodeHawk/CHT/CHB_tests/bchlibx86_tests/txbchlibx86/dune b/CodeHawk/CHT/CHB_tests/bchlibx86_tests/txbchlibx86/dune index e711fcae..2e514ef4 100644 --- a/CodeHawk/CHT/CHB_tests/bchlibx86_tests/txbchlibx86/dune +++ b/CodeHawk/CHT/CHB_tests/bchlibx86_tests/txbchlibx86/dune @@ -1,7 +1,3 @@ (tests (names bCHDisassembleInstructionTest bCHDisassembleX0Test) (libraries bchlib bchlibx86 chlib chutil tchlib)) - -(env - (dev - (flags (:standard -warn-error -A))))