From a40e5aae092781b6ddba003e8ac7ef29152f39cf Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Sat, 25 Feb 2017 11:20:26 +0800 Subject: [PATCH] regress: fix warning on compilation on eflags_noset.c. see #764 --- tests/regress/eflags_noset.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/regress/eflags_noset.c b/tests/regress/eflags_noset.c index 8cc15d6..187484b 100644 --- a/tests/regress/eflags_noset.c +++ b/tests/regress/eflags_noset.c @@ -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[])