summaryrefslogtreecommitdiffhomepage
path: root/mixlib/testsuite
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2019-01-08 05:22:16 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2019-01-08 05:22:16 +0000
commit8981c9336bd73b0fabe65f449ccbe5fb808bebdd (patch)
treef8ce47c4cda988788b1fdb353a30416a086b75da /mixlib/testsuite
parentcb2780e435aede4e13653af62a1758e33bd4527c (diff)
downloadmdk-8981c9336bd73b0fabe65f449ccbe5fb808bebdd.tar.gz
mdk-8981c9336bd73b0fabe65f449ccbe5fb808bebdd.tar.bz2
Fix for bug #43634: keep sign of rA for ADD/SUB yielding 0
Diffstat (limited to 'mixlib/testsuite')
-rw-r--r--mixlib/testsuite/mix_vm_ins_t.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/mixlib/testsuite/mix_vm_ins_t.c b/mixlib/testsuite/mix_vm_ins_t.c
index 1d368a7..239b737 100644
--- a/mixlib/testsuite/mix_vm_ins_t.c
+++ b/mixlib/testsuite/mix_vm_ins_t.c
@@ -135,6 +135,18 @@ test_arithmetics_(mix_vm_t *vm, mix_dump_context_t *dc)
test.rA_a = mix_word_new_b(20,54,6,3,8);
run_test_(&test, vm, dc);
+ mix_vm_set_rA(vm, mix_word_new_bn(0,0,0,0,1));
+ mix_vm_set_addr_contents(vm, 1000, mix_word_new_b(0,0,0,0,1));
+ fill_test_desc_(&test,vm,&ins);
+ test.rA_a = MIX_WORD_MINUS_ZERO;
+ run_test_(&test, vm, dc);
+
+ mix_vm_set_rA(vm, mix_word_new_b(0,0,0,0,1));
+ mix_vm_set_addr_contents(vm, 1000, mix_word_new_bn(0,0,0,0,1));
+ fill_test_desc_(&test,vm,&ins);
+ test.rA_a = MIX_WORD_ZERO;
+ run_test_(&test, vm, dc);
+
mix_ins_fill_from_id(ins,mix_SUB);
mix_vm_set_rA(vm,mix_word_new_bn(19,18,0,0,9));
mix_vm_set_addr_contents(vm,1000,mix_word_new_bn(31,16,2,22,0));
@@ -519,4 +531,3 @@ main(int argc, const char **argv)
return EXIT_SUCCESS;
}
-