Skip to content

Commit 06fd869

Browse files
committed
Merge branch 'pharo-vm-unicorn2' of github.com:pharo-project/unicorn into fix-tests-m1
2 parents 4f29a97 + addf437 commit 06fd869

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

tests/unit/test_x86.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,23 +1024,6 @@ static void test_x86_correct_address_in_small_jump_hook(void)
10241024
OK(uc_close(uc));
10251025
}
10261026

1027-
static void test_x86_cpuid_1()
1028-
{
1029-
uc_engine *uc;
1030-
char code[] = "\xB8\x01\x00\x00\x00\x0F\xA2"; // MOV EAX,1; CPUID
1031-
int reg;
1032-
1033-
uc_common_setup(&uc, UC_ARCH_X86, UC_MODE_32, code, sizeof(code) - 1);
1034-
1035-
OK(uc_emu_start(uc, code_start, code_start + sizeof(code) - 1, 0, 0));
1036-
1037-
OK(uc_reg_read(uc, UC_X86_REG_EDX, &reg));
1038-
1039-
TEST_CHECK(reg == 0x7088100);
1040-
1041-
OK(uc_close(uc));
1042-
}
1043-
10441027
static bool test_x86_correct_address_in_long_jump_hook_callback(uc_engine *uc, int type, uint64_t address, int size, int64_t value, void *user_data)
10451028
{
10461029
// Check registers
@@ -1085,6 +1068,23 @@ static void test_x86_correct_address_in_long_jump_hook(void)
10851068
}
10861069

10871070

1071+
static void test_x86_cpuid_1()
1072+
{
1073+
uc_engine *uc;
1074+
char code[] = "\xB8\x01\x00\x00\x00\x0F\xA2"; // MOV EAX,1; CPUID
1075+
int reg;
1076+
1077+
uc_common_setup(&uc, UC_ARCH_X86, UC_MODE_32, code, sizeof(code) - 1);
1078+
1079+
OK(uc_emu_start(uc, code_start, code_start + sizeof(code) - 1, 0, 0));
1080+
1081+
OK(uc_reg_read(uc, UC_X86_REG_EDX, &reg));
1082+
1083+
TEST_CHECK(reg == 0x7088100);
1084+
1085+
OK(uc_close(uc));
1086+
}
1087+
10881088
TEST_LIST = {
10891089
{"test_x86_in", test_x86_in},
10901090
{"test_x86_out", test_x86_out},

0 commit comments

Comments
 (0)