From patchwork Sun Mar 29 20:47:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 5887 Received: (qmail 62367 invoked by alias); 29 Mar 2015 20:47:12 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 62252 invoked by uid 89); 29 Mar 2015 20:47:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 29 Mar 2015 20:47:10 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 76BA6340AE3 for ; Sun, 29 Mar 2015 20:47:08 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 2/2] sim: microblaze: start a testsuite Date: Sun, 29 Mar 2015 16:47:06 -0400 Message-Id: <1427662026-27856-2-git-send-email-vapier@gentoo.org> In-Reply-To: <1427662026-27856-1-git-send-email-vapier@gentoo.org> References: <1427662026-27856-1-git-send-email-vapier@gentoo.org> X-IsSubscribed: yes Since the sim doesn't have any debug support in it, we can only exit cleanly. But this is still better than nothing. Change the default microblaze sim to not dump the debug load output when running. No other does this, and it breaks the testsuite. Committed. --- sim/microblaze/ChangeLog | 4 ++++ sim/microblaze/interp.c | 2 +- sim/testsuite/sim/microblaze/ChangeLog | 3 +++ sim/testsuite/sim/microblaze/allinsn.exp | 15 +++++++++++++++ sim/testsuite/sim/microblaze/pass.s | 8 ++++++++ sim/testsuite/sim/microblaze/testutils.inc | 29 +++++++++++++++++++++++++++++ 6 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 sim/testsuite/sim/microblaze/ChangeLog create mode 100644 sim/testsuite/sim/microblaze/allinsn.exp create mode 100644 sim/testsuite/sim/microblaze/pass.s create mode 100644 sim/testsuite/sim/microblaze/testutils.inc diff --git a/sim/microblaze/ChangeLog b/sim/microblaze/ChangeLog index 7ee66c5..b2a5150 100644 --- a/sim/microblaze/ChangeLog +++ b/sim/microblaze/ChangeLog @@ -1,5 +1,9 @@ 2015-03-29 Mike Frysinger + * interp.c (sim_load): Set verbose to 0 when calling sim_load_file. + +2015-03-29 Mike Frysinger + * configure.ac: Call SIM_AC_OPTION_ENDIAN, SIM_AC_OPTION_ALIGNMENT, SIM_AC_OPTION_HOSTENDIAN, SIM_AC_OPTION_ENVIRONMENT, and SIM_AC_OPTION_INLINE. diff --git a/sim/microblaze/interp.c b/sim/microblaze/interp.c index ad6faaa..4e64932 100644 --- a/sim/microblaze/interp.c +++ b/sim/microblaze/interp.c @@ -820,7 +820,7 @@ sim_load (SIM_DESC sd, const char *prog, bfd *abfd, int from_tty) /* from sh -- dac */ prog_bfd = sim_load_file (sd, myname, callback, prog, abfd, /* sim_kind == SIM_OPEN_DEBUG, */ - 1, + 0, 0, sim_write); if (prog_bfd == NULL) return SIM_RC_FAIL; diff --git a/sim/testsuite/sim/microblaze/ChangeLog b/sim/testsuite/sim/microblaze/ChangeLog new file mode 100644 index 0000000..2aa1f2c --- /dev/null +++ b/sim/testsuite/sim/microblaze/ChangeLog @@ -0,0 +1,3 @@ +2015-03-29 Mike Frysinger + + * pass.s, allinsn.exp, testutils.inc: New files. diff --git a/sim/testsuite/sim/microblaze/allinsn.exp b/sim/testsuite/sim/microblaze/allinsn.exp new file mode 100644 index 0000000..f756914 --- /dev/null +++ b/sim/testsuite/sim/microblaze/allinsn.exp @@ -0,0 +1,15 @@ +# microblaze simulator testsuite + +if [istarget microblaze-*] { + # all machines + set all_machs "microblaze" + + foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.s]] { + # If we're only testing specific files and this isn't one of them, + # skip it. + if ![runtest_file_p $runtests $src] { + continue + } + run_sim_test $src $all_machs + } +} diff --git a/sim/testsuite/sim/microblaze/pass.s b/sim/testsuite/sim/microblaze/pass.s new file mode 100644 index 0000000..93ed924 --- /dev/null +++ b/sim/testsuite/sim/microblaze/pass.s @@ -0,0 +1,8 @@ +# check that the sim doesn't die immediately. +# mach: microblaze +# output: + +.include "testutils.inc" + + start + pass diff --git a/sim/testsuite/sim/microblaze/testutils.inc b/sim/testsuite/sim/microblaze/testutils.inc new file mode 100644 index 0000000..158a3c5 --- /dev/null +++ b/sim/testsuite/sim/microblaze/testutils.inc @@ -0,0 +1,29 @@ +# MACRO: exit + .macro exit nr + addi r3, r0, \nr; + bri 0; + .endm + +# MACRO: pass +# Write 'pass' to stdout and quit + .macro pass + exit 0 + .data + 1: .asciz "pass\n" + .endm + +# MACRO: fail +# Write 'fail' to stdout and quit + .macro fail + exit 1 + .data + 1: .asciz "fail\n" + .endm + +# MACRO: start +# All assembler tests should start with a call to "start" + .macro start + .text +.global _start +_start: + .endm