regress: fix warning on compilation on eflags_noset.c. see #764

This commit is contained in:
Nguyen Anh Quynh 2017-02-25 11:20:26 +08:00
parent b12ce92468
commit a40e5aae09

View File

@ -25,9 +25,10 @@ typedef uint64_t puint;
uint32_t realEflags()
{
puint val = 0;
puint i = 0xFFFFFEFF; //attempt to set ALL bits except trap flag.
#if defined(__i386__)
puint i = 0xFFFFFEFF; //attempt to set ALL bits except trap flag.
__asm__("pushf\n\t"
"push %0\n\t"
"popf\n\t"
@ -38,6 +39,8 @@ uint32_t realEflags()
: "r"(i)
: "%0");
#elif defined(__x86_64__)
puint i = 0xFFFFFEFF; //attempt to set ALL bits except trap flag.
__asm__("pushfq\n\t"
"pushq %0\n\t"
"popfq\n\t"
@ -56,7 +59,7 @@ uint32_t realEflags()
static void VM_exec()
{
#if defined(__i386__) || defined(__x86_64__)
uc_engine *uc;
uc_err err;
unsigned int r_eax, eflags, r_esp, realflags = 0;
@ -115,6 +118,7 @@ static void VM_exec()
realflags = realEflags();
assert(r_eax == realflags);
#endif
}
int main(int argc, char *argv[])