aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite
AgeCommit message (Collapse)AuthorFilesLines
2021-11-15sim: cris: make error message test a little more flexibleMike Frysinger1-1/+1
The point of this test is to just make sure the usage text is shown, not the exact details of the usage text. So shorten the output test to match the beginning. This fixes breakage when the output changed slightly to include [--].
2021-11-15sim: cris: replace custom "dest" test field with new --argv0Mike Frysinger4-8/+5
The #dest field used in the cris testsuite is a bit of hack to set the argv[0] for the tests to read out later on. Now that the sim has an option to set argv[0] explicitly, we don't need this custom field, so let's drop it to harmonize the testsuites a little.
2021-11-15sim: bfin: fix mach/xfail usage in testsMike Frysinger4-6/+6
Set the mach to the right value all the time, and update xfail to say the test fails on all targets. WIth multitarget testing, the idea of target here doesn't make much sense.
2021-11-11sim: testsuite: drop sim_compile cover functionMike Frysinger2-14/+1
Most code isn't using this, and the only call site (in one cris file) can use target_compile directly. So switch it over to simplify.
2021-11-11sim: cris: stop testing a.out explicitly [ld/13900]Mike Frysinger1-14/+0
Since gcc dropped support for a.out starting with 4.4.0 in 2009, it's been impossible to verify this code actually still works. Since it crashes in ld, and it uses a config option that no other tests uses and we want to remove, drop the test to avoid all the trouble.
2021-11-10sim: testsuite: delete unused arm remote host logicMike Frysinger3-24/+0
There's no need to sync testutils.inc with remote hosts. The one we have in the source tree is all we need and only thing we test. Delete it to simplify.
2021-11-10sim: synacor: simplify test generationMike Frysinger2-7/+4
Objcopy was used to create a binary file of just the executable code since the environment requires code to based at address 0. We can accomplish the same thing with the -Ttext=0 flag, so switch to that to get rid of custom logic.
2021-11-09sim: sh: simplify testsuite a bitMike Frysinger8-82/+12
Switch from the centralized list in the exp file to each test declaring its own requirements which they're already (mostly) doing. This will increase coverage slightly by running more tests in more configurations since the hardcoded exp list was a little out of date. We have to mark the psh* tests as shdsp only (to match what the exp file was doing), mark the fsca & fsrra tests as failing (since they weren't even being run by the exp file), and to fix the expected output & status of the fail test.
2021-08-17sim: rename ChangeLog files to ChangeLog-2021Mike Frysinger29-0/+0
Now that ChangeLog entries are no longer used for sim patches, this commit renames all relevant sim ChangeLog to ChangeLog-2021, similar to what we would do in the context of the "Start of New Year" procedure. The purpose of this change is to avoid people merging ChangeLog entries by mistake when applying existing commits that they are currently working on. Also throw in a .gitignore entry to keep people from adding new ChangeLog files anywhere in the sim tree.
2021-07-01sim: m32r: fix virtual environment with Linux targetsMike Frysinger3-0/+7
We don't want to handle Linux syscalls when in the virtual environment, just the user environment, so adjust the Linux traps logic to check for that specifically (instead of just skipping the operating environment). Also tweak some testcases to explicitly specify the environment they run under rather than relying on the default matching their needs. This gets the tests passing for all m32r targets.
2021-06-14sim: enable silent rules in common buildsMike Frysinger2-12/+17
We only do the common code as automake simplifies the logic.
2021-05-28sim: h8300 add special case test.Yoshinori Sato10-16/+520
* addb.s: Add special case reg,<@reg+ / @reg- / @+reg / @-reg>. * andb.s: Likewise. * cmpb.s: Likewise. * orb.s: Likewise. * subb.s: Likewise. * xorb.s: Likewise. * movb.s: Add special case reg,<@reg+ / @reg- / @+reg / @-reg> @reg+,@reg+ / @-reg,@-reg. * movw.s: Likewise. * movl.s: Likewise.
2021-05-07sim: Add bfd include path for common testsuite toolsDimitar Dimitrov2-1/+6
On a host without installed libbfd, this patch fixes the following "make check-sim" errors for both pru cross target, and native x86_64: In file included from ../../../binutils/sim/common/sim-basics.h:131, from testsuite/common/bits32m0.c:13:../../../binutils/sim/../include/gdb/callback.h:55:10: fatal error: bfd.h: No such file or directory 55 | #include "bfd.h" | ^~~~~~~ Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2021-05-06sim: h8300 special case testYoshinori Sato4-2/+37
In "mov. [bwl] reg, @ -reg", added a special case test using the same register.
2021-05-04sim: microblaze: hook up libgloss syscallsMike Frysinger4-2/+36
When in the virtual environment, have brki 8 trigger libgloss syscalls like other ports. This also matches the ABI that Linux uses for its syscalls (ignoring the syscall table differences).
2021-04-18sim: syscall: add getpid supportMike Frysinger2-0/+22
Hoist the Blackfin implementation up to the common one.
2021-04-08sim: testsuite: support exit 77 for unsupported testsMike Frysinger2-1/+8
Exit status 77 is common (including the autotools world) to indicate "skip this test". Add support for mapping that to "unsupported" as that's the closest in the dejagnu world.
2021-04-08sim: testsuite: skip tests when the port is disabledMike Frysinger2-0/+10
If the port hasn't been enabled, don't try to run its tests. Making this dynamic simplifies the test harnesses and avoids duplicating a bunch of target tuple checks.
2021-04-08sim: testsuite: calculate $arch from $subdirMike Frysinger72-180/+142
Since we require ports to use a matching subdir name in the testsuite tree, we can use that to calculate the $arch value.
2021-04-03sim: example-synacor: a simple implementation for referenceMike Frysinger20-0/+429
Provide a simple example simulator for people porting to new targets to use as a reference. This one has the advantage of being used by people and having a fun program available for it. It doesn't require a special target -- the example simulators can be built for any existing port.
2021-04-03sim: testsuite: integrate common tests into buildMike Frysinger4-53/+92
Now that we have the common automake build with support for build-time programs working, we can integrate the common tests into the default `make check` flow.
2021-03-07sim: testsuite: merge into toplevel automakeMike Frysinger4-179/+41
This allows us to delete most of our custom test logic, and avoids a recursive make for minor speed up.
2021-02-13sim: testsuite: push $arch out to targetsMike Frysinger70-42/+269
This is needed to move to automake & its dejagnu-provided logic, and eventually by the unified sim logic. The $arch is used only to figure out which `run` program to use when running tests, and as we move to a single top-level build, we can delete this and use sim/run directly.
2021-02-04sim: riscv: new portMike Frysinger5-0/+81
This is a hand-written implementation that should have fairly complete coverage for the base integer instruction set ("i"), and for the atomic ("a") and integer multiplication+division ("m") extensions. It also covers 32-bit & 64-bit targets. The unittest coverage is a bit weak atm, but should get better.
2021-01-18sim: bfin: delete accidental ADI copyrightMike Frysinger2-1/+4
This wasn't supposed to be in here when it was first merged as we had specifically disabled it for all the tests (and ADI has papers in place w/the FSF). Clean up this one.
2021-01-15sim: testsuite: flatten treeMike Frysinger2860-1/+5
Now that all port tests live under testsuite/sim/*/, and none live in testsuite/ directly, flatten the structure by moving all of the dirs under testsuite/sim/ to testsuite/ directly. We need to stop passing --tool to dejagnu so that it searches all dirs and not just ones that start with "sim". Since we have no other dirs in this tree, and no plans to add any, should be fine.
2021-01-15sim: testsuite: delete configure scriptMike Frysinger4-3112/+9
Now that we've moved all ports to dejagnu & testsuite/sim/, the only thing the testsuite/configure script has been doing is filling in the sim_arch field in the testsuite/Makefile. We can simply let the top sim/configure script do that for us now. This simplifies & speeds up the build a bit by killing an entire configure script.
2021-01-15sim: d10v: relocate tests & clean up test harnessMike Frysinger58-3434/+300
This is the only target using a dir directly under testsuite/. All others use sim/<arch>/ instead. Relocate it so all targets look the same, and so we can leverage the common test harness. We drop loop.s in the process because it was never referenced and was just 2 lines of code. All other test files are moved & have directives added to the top so that the test harness can invoke them correctly.
2021-01-15sim: mips: delete empty stub test dirMike Frysinger7-3200/+7
No tests were ever added in here in the ~22 years since it was first created. Seems unlikely any tests will be added at this rate, and the sim/mips/ testdir already has some (light) coverage for this target. So punt the tree.
2021-01-15sim: frv: clean up redundant test coverageMike Frysinger14-3219/+48
The frv-elf subdir contained five tests: * cache: A cache test of some sort. * exit47: A program to test exit status of 47 from sim. * grloop: Some basic limited loop test program. * hello: Standard "hello world" output program. * loop: An infinite loop program. The loop.s test is never referenced anywhere, and is all of 2 lines. Anyone who really needs a while(1); test case and re-implement it themselves locally. The cache.s code isn't referenced anywhere because it requires some custom args to the run program, and when this testcase was added, we didn't have any support for that. We do now, so we can add a header to enable that. Turns out the code crashes even with those, so turn around and mark it xfail. Maybe someone someday will care. That leaves the small exit47, grloop, and hello tests. Now that the sim test harness supports testing for custom exit status, we can move them all to sim/frv/ to maintain test coverage. The remaining differences between frv-elf & sim/frv are: * frv-elf/ runs for frv-*-elf while sim/frv/ runs for frv*-*-*. * frv-elf/ runs "*.s" files while sim/frv/ only has .cgs and such. On closer inspection, these are also meaningless distinctions: * There is nothing specific to the tests that require an *-elf target. Normally that would mean newlib+libgloss type stuff, but there's no such requirement in frv-elf/. * The ".s" suffix is the standard "this is an assembly file" suffix. Since FRV is a CGEN target, we can reuse the existing convention of ".ms" to mean "miscellaneous .s" as in "this is an assembly file, and run/bucket its test results in the miscellaneous category". So moving frv-elf/{cache,exit47,grloop,hello}.s to sim/frv/*.ms makes sense and simplifies things quite a bit for the target while also slightly increasing the coverage for some tuples.
2021-01-15sim: m32r: clean up redundant test coverageMike Frysinger11-3203/+14
The m32r-elf subdir contained three tests: * exit47: A program to test exit status of 47 from sim. * hello: Standard "hello world" output program. * loop: An infinite loop program. There's already a sim/m32r/hello.ms test that does exactly the same thing as m32r-elf/hello.s, so we can delete that. The loop.s test is never referenced anywhere, and is all of 2 lines. Anyone who really needs a while(1); test case and re-implement it themselves locally. That leaves the single exit47 test. Now that the sim test harness supports testing for custom exit status, we can easily move that to sim/m32r/exit47.ms to maintain test coverage. The remaining differences between m32r-elf & sim/m32r are: * m32r-elf/ runs for m32r-*-elf while sim/m32r/ runs for m32r*-*-*. * m32r-elf/ runs "*.s" files while sim/m32r/ runs "*.ms" files. On closer inspection, these are also meaningless distinctions: * There is nothing specific to the tests that require an *-elf target. Normally that would mean newlib+libgloss type stuff, but there's no such requirement in m32r-elf/. * The ".s" suffix is the standard "this is an assembly file" suffix. Turns out ".ms" is just how sim/m32r/ (and a few other CGEN based targets) categorize/bucket test cases. It simply means "miscellaneous .s" as in "this is an assembly file, and run/bucket its test results in the miscellaneous category". So moving m32r-elf/exit47.s to sim/m32r/exit47.ms makes sense and simplifies things quite a bit for the target while also slightly increasing the coverage for some tuples.
2021-01-15sim: testsuite: allow tests to declare expected exit statusMike Frysinger5-13/+32
Some tests want to verify they can control the exit status, and allowing any non-zero value would allow tests to silently fail: if it crashed & exited 1, or forced all non-zero to 1, then we wouldn't be able to differentiate with a test exiting with a status like 47. Extend the test harness to allow tests to declare their expected exit status that would be defined as a "pass". This requires a small tweak to the sim_run API to return the status directly, but that shouldn't be a big deal as it's only used by sim code.
2021-01-11sim: tests: get common tests working againMike Frysinger4-41/+46
These were written with 32-bit host assumptions baked into it. Simplify the printf formats to use ll length modifier as it's in C11 rather than trying to manually break it up into two, and cleanup some of the casts to stop assuming sizeof(long) is the same as sizeof(int). We also have to add a few more includes for the various funcs used in here. The tests aren't compiled automatically still. We can figure that out later with more work.
2021-01-09sim: replace rindex with strrchrMike Frysinger2-2/+6
2021-01-09sim: sh64: delete portMike Frysinger392-13498/+5
Support for sh64 was dropped from bfd et al in 2018. Without that, the sim port is useless. So clean up this code too.
2021-01-07sim: ChangeLog: move arch-specific entries into the arch dirMike Frysinger2-17/+21
We don't want arch-specific entries in the common ChangeLog files. Most arches do this already, so clean up the recent additions, and move some older entries down to help avoid confusing newcomers.
2021-01-07sim: cris: disable test that crashes the linkerMike Frysinger2-1/+10
PR ld/13900 Linking this test crashes the linker, so disable it. The crash was reported about 9 years ago but haven't made progress, so lets avoid the failures in test runs.
2021-01-07sim: cris: use -sim with C tests for cris-elf targetsMike Frysinger2-0/+8
Building the C tests with a cris-elf toolchain (gcc-10.2 & newlib-4.1.0) currently fail due to warnings it emits: cris-elf-ld: libc.a(lib_a-closer.o): in function `_close_r': newlib/libc/reent/closer.c:47: warning: _close is not implemented and will always fail This is because the default target for cris-elf is bare metal, not the simulator. For that, we need -sim. So add it for elf targets. We don't add it for all targets as the simulator (and testsuite) run both libgloss programs as well as Linux userspace programs.
2021-01-07fix paths in ChangeLogMike Frysinger1-5/+5
2021-01-07sim: cris: fix C tests with newer toolchainsMike Frysinger11-2/+21
Make sure we include unistd.h for getpid prototypes to fix build warnings/errors with newer compilers & C libraries. Doing that for close in openpf highlights these were using the wrong function -- need to use fclose on FILE*, not close. These tests pass again with a cris-elf toolchain.
2021-01-05sim: fr30: delete unused testsuiteMike Frysinger108-7226/+4
Looking through the history, it doesn't seem like the fr30 port was ever merged. There used to be a testsuite/fr30-elf/ dir, but that was punted back in 2005 as being dead too. Since there's no refs and the dir hasn't been touched since 1999, lets assume no one will ever notice or care.
2021-01-05sim: testsuite: delete unused Make-common.in fileMike Frysinger2-90/+4
This seems like it was meant to unify arch test Makefiles, but that never happened, and we've instead unified using dejagnu.
2021-01-05sim: h8300: fix test mach markersMike Frysinger10-9/+15
These tests all fail to assemble when targeting the h8300 or h8300h cpu variants with errors like: rotl.s:242: Warning: Opcode `rotl.b' with these operand types not available in H8/300H mode rotl.s:242: Error: invalid operands It's been this way for years and no one seems to care, so disable them for those targets since the assembler thinks it's impossible.
2021-01-05sim: h8300: simplify testsuite runnerMike Frysinger2-61/+15
We don't need to manually enumerate every test. Use a glob function like every other port and rely on the (already existing) #mach headers in each file to filter out targets we don't care about.
2021-01-04sim: stdlib.h for abs()Mike Frysinger2-0/+5
Make sure the files using abs() include stdlib.h for its prototype. These files were relying on it being included implicitly by others which isn't guaranteed, and newer toolchains produce warnings.
2021-01-04sim: update bug URI to https://Mike Frysinger1-0/+4
2021-01-01Update copyright year range in all GDB filesJoel Brobecker61-61/+61
This commits the result of running gdb/copyright.py as per our Start of New Year procedure... gdb/ChangeLog Update copyright year range in copyright header of all GDB files.
2020-11-12sim: pru: Add support for LMBD instructionDimitar Dimitrov2-0/+65
Binutils support for LMBD instruction was merged [1]. So add it also to simulator. LMBD instruction does left-most-bit-detection. It returns 32 if the given bit value is not found in the provided word value. [1] https://sourceware.org/pipermail/binutils/2020-October/113901.html sim/pru/ChangeLog: * pru.h (RS1SEL): New macro. (RS1_WIDTH): New macro. * pru.isa: Describe the LMBD instruction. sim/testsuite/sim/pru/ChangeLog: * lmbd.s: New test.
2020-10-06sim: Fix autoreconf errors in sim/ directoryAndrew Burgess15-15/+40
Run autoreconf in sim/ directory and you'll see some errors. The problem is that autoreconf (a perl script) does not evaluate the value passed as an argument to AC_CONFIG_AUX_DIR, so something like: AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..) does not do the right thing inside autoreconf, my understanding is that changing to something like this is fine: AC_CONFIG_AUX_DIR(../..) the generated configure seems to check the value passed, and the value passed relative to the source directory, so I think we get basically the same behaviour as before. sim/testsuite/ChangeLog: * configure: Regnerate. * configure.ac (AC_CONFIG_AUX_DIR): Update. sim/testsuite/d10v-elf/ChangeLog: * configure: Regnerate. * configure.ac (AC_CONFIG_AUX_DIR): Update. sim/testsuite/frv-elf/ChangeLog: * configure: Regnerate. * configure.ac (AC_CONFIG_AUX_DIR): Update. sim/testsuite/m32r-elf/ChangeLog: * configure: Regnerate. * configure.ac (AC_CONFIG_AUX_DIR): Update. sim/testsuite/mips64el-elf/ChangeLog: * configure: Regnerate. * configure.ac (AC_CONFIG_AUX_DIR): Update.
2020-09-08bpf: simulator: correct div, mod insn semanticsDavid Faust3-17/+45
The div and mod eBPF instructions are unsigned, but the semantic specification for the simulator incorrectly used signed operators. Correct them to unsigned versions, and correct the ALU tests in the simulator (which incorrectly assumed signed semantics). Tested in bpf-unknown-none. cpu/ChangeLog: 2020-09-08 David Faust <david.faust@oracle.com> * bpf.cpu (define-alu-instructions): Correct semantic operators for div, mod to unsigned versions. sim/ChangeLog: 2020-09-08 David Faust <david.faust@oracle.com> * bpf/sem-be.c: Regenerate. * bpf/sem-le.c: Likewise. sim/testsuite/ChangeLog: 2020-09-08 David Faust <david.faust@oracle.com> * sim/bpf/alu.s: Correct div and mod tests. * sim/bpf/alu32.s: Likewise.