]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: microblaze: start a testsuite
authorMike Frysinger <vapier@gentoo.org>
Sun, 29 Mar 2015 20:43:48 +0000 (16:43 -0400)
committerMike Frysinger <vapier@gentoo.org>
Sun, 29 Mar 2015 20:45:49 +0000 (16:45 -0400)
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.

sim/microblaze/ChangeLog
sim/microblaze/interp.c
sim/testsuite/sim/microblaze/ChangeLog [new file with mode: 0644]
sim/testsuite/sim/microblaze/allinsn.exp [new file with mode: 0644]
sim/testsuite/sim/microblaze/pass.s [new file with mode: 0644]
sim/testsuite/sim/microblaze/testutils.inc [new file with mode: 0644]

index 7ee66c5b0dfe51061a54b66d183f567aceaf2d50..b2a5150053a8ec54090f8a6a329f3468b6c34685 100644 (file)
@@ -1,3 +1,7 @@
+2015-03-29  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_load): Set verbose to 0 when calling sim_load_file.
+
 2015-03-29  Mike Frysinger  <vapier@gentoo.org>
 
        * configure.ac: Call SIM_AC_OPTION_ENDIAN, SIM_AC_OPTION_ALIGNMENT,
index ad6faaa9435ad211bff1b1ca4c141f672af3896a..4e64932c3bf3c842ae7deebcc41088a57a811b2b 100644 (file)
@@ -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 (file)
index 0000000..2aa1f2c
--- /dev/null
@@ -0,0 +1,3 @@
+2015-03-29  Mike Frysinger  <vapier@gentoo.org>
+
+       * 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 (file)
index 0000000..f756914
--- /dev/null
@@ -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 (file)
index 0000000..93ed924
--- /dev/null
@@ -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 (file)
index 0000000..158a3c5
--- /dev/null
@@ -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