@@ -61,7 +61,7 @@ open BCHAnalyzeApp
6161
6262
6363let testname = " bCHARMConditionalExprTest"
64- let lastupdated = " 2024-05-25 "
64+ let lastupdated = " 2024-10-31 "
6565
6666
6767let make_dw (s : string ) = TR. tget_ok (string_to_doubleword s)
@@ -183,6 +183,41 @@ let compare_negative_tests () =
183183 end
184184
185185
186+ let move_tests () =
187+ let tests = [
188+ (" move-bne" , " 0x100b0" , " 0x100b4" , " 0500b0e1bcffff1a" , 3 , " (R5 != 0)" )
189+ ] in
190+ begin
191+ TS. new_testsuite (testname ^ " _subtract_tests" ) lastupdated;
192+
193+ system_info#set_elf_is_code_address wordzero codemax;
194+ ARMU. arm_instructions_setup (make_dw " 0x100b0" ) 0x10000 ;
195+ List. iter (fun (title , cfaddr , ccaddr , bytes , iterations , expectedcond ) ->
196+
197+ TS. add_simple_test
198+ ~title
199+ (fun () ->
200+ let _ = functions_data#reset in
201+ let _ = arm_assembly_functions#reset in
202+ let faddr = make_dw cfaddr in
203+ let bytes = bytes ^ bxlr_bxlr in
204+ let fn = ARMU. arm_function_setup faddr bytes in
205+ (* let _ = CHPretty.pr_debug [fn#toPretty; NL] in *)
206+ let _ =
207+ for _i = 1 to iterations do
208+ analyze_arm_function faddr fn 0
209+ done in
210+ let _ = testsupport#request_arm_conditional_expr in
211+ let _ = translate_arm_assembly_function fn in
212+ let (_, _, optxpr) =
213+ TR. tget_ok (testsupport#retrieve_arm_conditional_expr ccaddr) in
214+ ARMA. equal_arm_conditional_expr
215+ ~expected: expectedcond ~received: optxpr () )
216+ ) tests;
217+
218+ TS. launch_tests ()
219+ end
220+
186221
187222(* * Subtract subtracts the second argument from the first, writes the result to the
188223 destination and optionally updates the condition flags.
@@ -293,6 +328,7 @@ let () =
293328 TS. new_testfile testname lastupdated;
294329 compare_tests () ;
295330 compare_negative_tests () ;
331+ move_tests () ;
296332 subtract_tests () ;
297333 test_tests () ;
298334 TS. exit_file()
0 commit comments