Commit acae4681ae29768c1d5f1641f5a2501c9ace8cf0
1 parent
42ad6ae9
fixed imul im test - added TEST_VM86 define for x86_64 tests
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1182 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
7 additions
and
5 deletions
tests/test-i386.c
@@ -32,6 +32,7 @@ | @@ -32,6 +32,7 @@ | ||
32 | 32 | ||
33 | #define TEST_CMOV 0 | 33 | #define TEST_CMOV 0 |
34 | #define TEST_FCOMI 0 | 34 | #define TEST_FCOMI 0 |
35 | +#define TEST_VM86 | ||
35 | //#define LINUX_VM86_IOPL_FIX | 36 | //#define LINUX_VM86_IOPL_FIX |
36 | //#define TEST_P4_FLAGS | 37 | //#define TEST_P4_FLAGS |
37 | 38 | ||
@@ -372,7 +373,7 @@ void test_imulw2(int op0, int op1) | @@ -372,7 +373,7 @@ void test_imulw2(int op0, int op1) | ||
372 | s1 = op1; | 373 | s1 = op1; |
373 | res = s0; | 374 | res = s0; |
374 | flags = 0; | 375 | flags = 0; |
375 | - asm ("push %4\n\t" | 376 | + asm volatile ("push %4\n\t" |
376 | "popf\n\t" | 377 | "popf\n\t" |
377 | "imulw %w2, %w0\n\t" | 378 | "imulw %w2, %w0\n\t" |
378 | "pushf\n\t" | 379 | "pushf\n\t" |
@@ -390,7 +391,7 @@ void test_imull2(int op0, int op1) | @@ -390,7 +391,7 @@ void test_imull2(int op0, int op1) | ||
390 | s1 = op1; | 391 | s1 = op1; |
391 | res = s0; | 392 | res = s0; |
392 | flags = 0; | 393 | flags = 0; |
393 | - asm ("push %4\n\t" | 394 | + asm volatile ("push %4\n\t" |
394 | "popf\n\t" | 395 | "popf\n\t" |
395 | "imull %2, %0\n\t" | 396 | "imull %2, %0\n\t" |
396 | "pushf\n\t" | 397 | "pushf\n\t" |
@@ -406,7 +407,7 @@ void test_imull2(int op0, int op1) | @@ -406,7 +407,7 @@ void test_imull2(int op0, int op1) | ||
406 | int res, flags;\ | 407 | int res, flags;\ |
407 | flags = 0;\ | 408 | flags = 0;\ |
408 | res = 0;\ | 409 | res = 0;\ |
409 | - asm ("push %3\n\t"\ | 410 | + asm volatile ("push %3\n\t"\ |
410 | "popf\n\t"\ | 411 | "popf\n\t"\ |
411 | "imul" size " $" #op0 ", %" size1 "2, %" size1 "0\n\t" \ | 412 | "imul" size " $" #op0 ", %" size1 "2, %" size1 "0\n\t" \ |
412 | "pushf\n\t"\ | 413 | "pushf\n\t"\ |
@@ -414,7 +415,7 @@ void test_imull2(int op0, int op1) | @@ -414,7 +415,7 @@ void test_imull2(int op0, int op1) | ||
414 | : "=r" (res), "=g" (flags)\ | 415 | : "=r" (res), "=g" (flags)\ |
415 | : "r" (op1), "1" (flags), "0" (res));\ | 416 | : "r" (op1), "1" (flags), "0" (res));\ |
416 | printf("%-10s A=%08x B=%08x R=%08x CC=%04x\n",\ | 417 | printf("%-10s A=%08x B=%08x R=%08x CC=%04x\n",\ |
417 | - "imul" size, op0, op1, res, flags & CC_MASK);\ | 418 | + "imul" size " im", op0, op1, res, flags & CC_MASK);\ |
418 | } | 419 | } |
419 | 420 | ||
420 | 421 | ||
@@ -1673,7 +1674,6 @@ static void test_enter(void) | @@ -1673,7 +1674,6 @@ static void test_enter(void) | ||
1673 | TEST_ENTER("w", uint16_t, 31); | 1674 | TEST_ENTER("w", uint16_t, 31); |
1674 | } | 1675 | } |
1675 | 1676 | ||
1676 | - | ||
1677 | static void *call_end __init_call = NULL; | 1677 | static void *call_end __init_call = NULL; |
1678 | 1678 | ||
1679 | int main(int argc, char **argv) | 1679 | int main(int argc, char **argv) |
@@ -1697,7 +1697,9 @@ int main(int argc, char **argv) | @@ -1697,7 +1697,9 @@ int main(int argc, char **argv) | ||
1697 | test_lea(); | 1697 | test_lea(); |
1698 | test_segs(); | 1698 | test_segs(); |
1699 | test_code16(); | 1699 | test_code16(); |
1700 | +#ifdef TEST_VM86 | ||
1700 | test_vm86(); | 1701 | test_vm86(); |
1702 | +#endif | ||
1701 | test_exceptions(); | 1703 | test_exceptions(); |
1702 | test_self_modifying_code(); | 1704 | test_self_modifying_code(); |
1703 | test_single_step(); | 1705 | test_single_step(); |