From patchwork Mon Jul 16 20:11:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Patulea X-Patchwork-Id: 171244 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D0E862C0120 for ; Tue, 17 Jul 2012 06:12:12 +1000 (EST) Received: from localhost ([::1]:34471 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqreM-0000Nh-Nq for incoming@patchwork.ozlabs.org; Mon, 16 Jul 2012 16:12:10 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqreE-0000NO-Qm for qemu-devel@nongnu.org; Mon, 16 Jul 2012 16:12:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SqreD-0000aW-5G for qemu-devel@nongnu.org; Mon, 16 Jul 2012 16:12:02 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:62206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqreC-0000aG-V7 for qemu-devel@nongnu.org; Mon, 16 Jul 2012 16:12:01 -0400 Received: by yhpp34 with SMTP id p34so3925557yhp.4 for ; Mon, 16 Jul 2012 13:12:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=70WErmN5pHaeanHytU/wvuBhqBgVKDxDGR1qo1EzHXY=; b=Qsw4FVkuSXWhu/0QUDjRbtm1pcdbMQt/6uFrIkprkAy3EHtKgGwUzsg6a/JhElqNCt Sp0zy80r9O60kFIgswW6y5jy8l7xS8Tgiq4cqJGWsm+kUPjSybeajhWz8cVXsWBiX2Ar QqjQ0E+5dYhwtJBFXT1oEYQ9O27vEe4PZHtK29+dc00P/j0StLpItmgr4cQZ4vA8W3iU ux9nggXO6PPCKVe19b+oZuDqGxqaxUU43JWhsY+KcxjgBCar00/X/c3pt1TcjmuQG5MR ulUW4ddBHkMKuOGF15UHcTYKDUdYNk/fkbHTBI4hi98qggxx4liWysiASoEnQwHlvgBx 7cdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=70WErmN5pHaeanHytU/wvuBhqBgVKDxDGR1qo1EzHXY=; b=j2nQvU+avPk16yXgcLJQ+6+/bk+jeDVyZWNHisUr4SWqXke+BJQWnv+1OR7+i6UORR d7ulRhCOGTUjlD/8oA1NCmA8dJVdI/vlK9kcO8RlphAVQ7rrKiRWnAOjdwmAFIsxWFpg KszmdTBPGqO5ukTfqsmjvraPJ3aobiOWfWMUyCFdZQgPvnnSgwesiL6r48ivBcvsgU01 7NX9L9vDeoqwV26/MaTOOb3fHz2wA3gQQKQdW+8SiM4FymioIz7yiVrIzKHxEy44ByM8 xcosp7jifg7Ag/kFh3r9Jm6zekwgLFX56wsM5CSi6rxxFrM7gkFfzGU9JghVI2avFMLD uJNA== Received: by 10.50.156.194 with SMTP id wg2mr6223105igb.46.1342469519842; Mon, 16 Jul 2012 13:11:59 -0700 (PDT) Received: by 10.50.156.194 with SMTP id wg2mr6223087igb.46.1342469519665; Mon, 16 Jul 2012 13:11:59 -0700 (PDT) Received: from gibson.mon.corp.google.com (gibson.mon.corp.google.com [172.29.33.50]) by mx.google.com with ESMTPS id rd8sm20389259igb.3.2012.07.16.13.11.57 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Jul 2012 13:11:58 -0700 (PDT) From: Catalin Patulea To: qemu-devel@nongnu.org Date: Mon, 16 Jul 2012 16:11:47 -0400 Message-Id: <1342469507-13064-1-git-send-email-catalinp@google.com> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: References: X-Gm-Message-State: ALoCoQkY3aQlFCpSf/jSOMrVkkl/jLLubKpn7OLH49xUo+iJV9kPY70fpN/pquIG778JrPCh+BnhzYI5QHGae16oh2ZDTQyg0YQKqsbx3PSwAOzPKGxcCsZhVe+dXH8VQiFauWEJ3fsZ9zvYOVVNCgRve94jT0cwZRm9bgRpyE+r5+Kzv+BKQRkEh5IUgIGs5AYycySt8iUQMsVbiQ81klB5RUYZRZqzXw== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.213.45 Cc: Peter Maydell , Anthony Liguori , chenwj@iis.sinica.edu.tw, Catalin Patulea Subject: [Qemu-devel] [PATCH v2] Get tests/tcg building and fix an unused variable warning due to wrong extended asm operands. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org To build/run the tests: $ cd $BUILD_PATH/tests/tcg $ SRC_PATH=path/to/qemu make Signed-off-by: Catalin Patulea Reviewed-by: Peter Maydell --- This should also fix the lock nop error. I just peeked at what bytes my gcc (4.4.3) generates. tests/tcg/Makefile | 16 ++++++++++------ tests/tcg/test-i386.c | 5 +++-- tests/tcg/test_path.c | 13 +++++++------ 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile index 15e36a2..9ff47b8 100644 --- a/tests/tcg/Makefile +++ b/tests/tcg/Makefile @@ -1,13 +1,13 @@ --include ../config-host.mak +-include ../../config-host.mak -include $(SRC_PATH)/rules.mak -$(call set-vpath, $(SRC_PATH)/tests) +$(call set-vpath, $(SRC_PATH)/tests/tcg) -QEMU=../i386-linux-user/qemu-i386 -QEMU_X86_64=../x86_64-linux-user/qemu-x86_64 +QEMU=../../i386-linux-user/qemu-i386 +QEMU_X86_64=../../x86_64-linux-user/qemu-x86_64 CC_X86_64=$(CC_I386) -m64 -QEMU_INCLUDES += -I.. +QEMU_INCLUDES += -I../.. CFLAGS=-Wall -O2 -g -fno-strict-aliasing #CFLAGS+=-msse2 LDFLAGS= @@ -36,6 +36,7 @@ TESTS += $(I386_TESTS) endif all: $(patsubst %,run-%,$(TESTS)) +test: all # rules to run tests @@ -74,7 +75,10 @@ run-test_path: test_path # rules to compile tests test_path: test_path.o + $(CC_I386) $(LDFLAGS) -o $@ $^ $(LIBS) + test_path.o: test_path.c + $(CC_I386) $(QEMU_INCLUDES) $(GLIB_CFLAGS) $(CFLAGS) -c -o $@ $^ hello-i386: hello-i386.c $(CC_I386) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $< @@ -86,7 +90,7 @@ testthread: testthread.c # i386/x86_64 emulation test (test various opcodes) */ test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \ test-i386.h test-i386-shift.h test-i386-muldiv.h - $(CC_I386) $(CFLAGS) $(LDFLAGS) -o $@ \ + $(CC_I386) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@ \ $(. */ #define _GNU_SOURCE +#include "compiler.h" #include #include #include @@ -784,7 +785,7 @@ void fpu_clear_exceptions(void) long double fpregs[8]; } float_env32; - asm volatile ("fnstenv %0\n" : : "m" (float_env32)); + asm volatile ("fnstenv %0\n" : "=m" (float_env32)); float_env32.fpus &= ~0x7f; asm volatile ("fldenv %0\n" : : "m" (float_env32)); } @@ -1827,7 +1828,7 @@ void test_exceptions(void) printf("lock nop exception:\n"); if (setjmp(jmp_env) == 0) { /* now execute an invalid instruction */ - asm volatile("lock nop"); + asm volatile(".byte 0xf0, 0x90"); /* lock nop */ } printf("INT exception:\n"); diff --git a/tests/tcg/test_path.c b/tests/tcg/test_path.c index 7265a94..a064eea 100644 --- a/tests/tcg/test_path.c +++ b/tests/tcg/test_path.c @@ -1,11 +1,12 @@ /* Test path override code */ -#include "../config-host.h" -#include "../qemu-malloc.c" -#include "../cutils.c" -#include "../path.c" -#include "../trace.c" +#define _GNU_SOURCE +#include "config-host.h" +#include "iov.c" +#include "cutils.c" +#include "path.c" +#include "trace.c" #ifdef CONFIG_TRACE_SIMPLE -#include "../simpletrace.c" +#include "../trace/simple.c" #endif #include