summaryrefslogtreecommitdiffstats
path: root/tests/tcg
Commit message (Collapse)AuthorAgeFilesLines
* tests: Avoid non-portable 'echo -ARG'Eric Blake2017-07-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | POSIX says that backslashes in the arguments to 'echo', as well as any use of 'echo -n' and 'echo -e', are non-portable; it recommends people should favor 'printf' instead. This is definitely true where we do not control which shell is running (such as in makefile snippets or in documentation examples). But even for scripts where we require bash (and therefore, where echo does what we want by default), it is still possible to use 'shopt -s xpg_echo' to change bash's behavior of echo. And setting a good example never hurts when we are not sure if a snippet will be copied from a bash-only script to a general shell script (although I don't change the use of non-portable \e for ESC when we know the running shell is bash). Replace 'echo -n "..."' with 'printf %s "..."', and 'echo -e "..."' with 'printf %b "...\n"', with the optimization that the %s/%b argument can be omitted if the string being printed is a strict literal with no '%', '$', or '`' (we could technically also make this optimization when there are $ or `` substitutions but where we can prove their results will not be problematic, but proving that such substitutions are safe makes the patch less trivial compared to just being consistent). In the qemu-iotests check script, fix unusual shell quoting that would result in word-splitting if 'date' outputs a space. In test 051, take an opportunity to shorten the line. In test 068, get rid of a pointless second invocation of bash. CC: qemu-trivial@nongnu.org Signed-off-by: Eric Blake <eblake@redhat.com> Message-id: 20170703180950.9895-1-eblake@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* target/openrisc: Rename the cpu from or32 to or1kRichard Henderson2017-02-131-2/+2
| | | | | | This is in keeping with the toolchain and or1ksim. Signed-off-by: Richard Henderson <rth@twiddle.net>
* target/xtensa: tests: clean up interrupt testsMax Filippov2017-01-151-7/+20
| | | | | | | Don't use hardcoded software interrupt masks, use XCHAL macros. Mask off timer interrupt bits that are not checked for. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* target/xtensa: tests: add memctl testMax Filippov2017-01-151-0/+1
| | | | Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* target/xtensa: tests: add ccount write testsMax Filippov2017-01-151-0/+34
| | | | | | | Check that CCOUNT SR is writable and that CCOMPARE timers are updated when CCOUNT is written to. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* target/xtensa: tests: replace hardcoded interrupt masksMax Filippov2017-01-151-5/+5
| | | | Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* target/xtensa: tests: fix timer testsMax Filippov2017-01-151-28/+33
| | | | | | | | Don't expect that CCOUNT increments are equal to the number of executed instructions. Verify that timer interrupt does not fire before the programmed CCOMPARE value and does fire after. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* target/xtensa: tests: run tests with icountMax Filippov2017-01-151-1/+1
| | | | | | | Timer tests expect certain determinism in CCOUNT updates and timer interrupts firing. Run QEMU with -icount to get deterministic results. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* Move target-* CPU file into a target/ folderThomas Huth2016-12-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | We've currently got 18 architectures in QEMU, and thus 18 target-xxx folders in the root folder of the QEMU source tree. More architectures (e.g. RISC-V, AVR) are likely to be included soon, too, so the main folder of the QEMU sources slowly gets quite overcrowded with the target-xxx folders. To disburden the main folder a little bit, let's move the target-xxx folders into a dedicated target/ folder, so that target-xxx/ simply becomes target/xxx/ instead. Acked-by: Laurent Vivier <laurent@vivier.eu> [m68k part] Acked-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> [tricore part] Acked-by: Michael Walle <michael@walle.cc> [lm32 part] Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> [s390x part] Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> [s390x part] Acked-by: Eduardo Habkost <ehabkost@redhat.com> [i386 part] Acked-by: Artyom Tarasenko <atar4qemu@gmail.com> [sparc part] Acked-by: Richard Henderson <rth@twiddle.net> [alpha part] Acked-by: Max Filippov <jcmvbkbc@gmail.com> [xtensa part] Reviewed-by: David Gibson <david@gibson.dropbear.id.au> [ppc part] Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> [cris&microblaze part] Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn> [unicore32 part] Signed-off-by: Thomas Huth <thuth@redhat.com>
* test-i386: fix bitrot for 64-bitPaolo Bonzini2016-10-241-2/+2
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-tech: move TCG test documentation to tests/tcg/READMEPaolo Bonzini2016-10-071-0/+76
| | | | | Reviewed-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* tests: cris: add v17 ADDC testRabin Vincent2016-09-282-2/+82
| | | | | | | | | Add a test for the newly implemented ADDC instruction in the v17 CRIS CPU. Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Rabin Vincent <rabinv@axis.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
* tests: cris: remove check_time1Rabin Vincent2016-09-282-47/+0Star
| | | | | | | | | | This test, borrowed from the GDB simulator test suite, checks that every syscall increments the time returned by gettimeofday() by exactly 1 ms. This is not guaranteed or even desirable on QEMU so remove this test. Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Rabin Vincent <rabinv@axis.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
* tests: cris: remove openpf4 testRabin Vincent2016-09-282-6/+0Star
| | | | | | | | | | | This test, borrowed from the GDB simulator test suite, is meant to test the GDB simulator's --sysroot feature and always fails in QEMU. Remove it. openpf3 tests the same sequence of system calls (without assuming the precence of --sysroot). Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Rabin Vincent <rabinv@axis.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
* tests: cris: fix syscall inline asmRabin Vincent2016-09-281-9/+17
| | | | | | | | | | | | Add the appropriate register constraints for the inline asm for the write and exit system calls. Without the correct constraints for the write() function, correct failure messages are not printed succesfully on newer version of GCC. Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Rabin Vincent <rabinv@axis.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
* tests: cris: force inliningRabin Vincent2016-09-2810-26/+28
| | | | | | | | | | | | | | | | | The CRIS tests expect that functions marked inline are always inline. With newer versions of GCC, building them results warnings like the following and spurious failures when they are run. In file included from tests/tcg/cris/check_moveq.c:5:0: tests/tcg/cris/crisutils.h:66:20: warning: inlining failed in call to 'cris_tst_cc.constprop.0': call is unlikely and code size would grow [-Winline] tests/tcg/cris/check_moveq.c:28:13: warning: called from here [-Winline] Use the always_inline attribute when building them to fix this. Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Rabin Vincent <rabinv@axis.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
* Use #include "..." for our own headers, <...> for othersMarkus Armbruster2016-07-121-1/+1
| | | | | | | | | | | | Tracked down with an ugly, brittle and probably buggy Perl script. Also move includes converted to <...> up so they get included before ours where that's obviously okay. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Tested-by: Eric Blake <eblake@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
* Fix some typos found by codespellStefan Weil2016-05-181-7/+7
| | | | | | Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* util: move declarations out of qemu-common.hVeronia Bahaa2016-03-221-0/+1
| | | | | | | | | | Move declarations out of qemu-common.h for functions declared in utils/ files: e.g. include/qemu/path.h for utils/path.c. Move inline functions out of qemu-common.h and into new files (e.g. include/qemu/bcd.h) Signed-off-by: Veronia Bahaa <veroniabahaa@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Clean up includes some moreMarkus Armbruster2016-03-221-3/+1Star
| | | | | | | | | Manually drop redundant includes that scripts/clean-includes misses, e.g. because they're hidden in generator programs, or they use the wrong kind of delimiter. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* maint: remove unused include for signal.hDaniel P. Berrange2015-09-111-1/+0Star
| | | | | | | | | A number of files were including signal.h but not using any of the functions it provides Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* target-xtensa: test cross-page opcodeMax Filippov2014-12-171-13/+13
| | | | | | Alter cross-page TB test to also test cross-page opcode. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* target-xtensa: add entry overflow testMax Filippov2014-11-101-0/+51
| | | | | | | Check that entry instruction raises window overflow exception when PS.CALLINC points to live registers. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* target-xtensa: tests: pre-process tests linker scriptMax Filippov2014-11-023-115/+137
| | | | | | | | | | | | Xtensa cores have configurable interrupt vectors and endiannes. This information is needed to link executable images correctly for a specific core configuration. Instead of hard-coding dc232 defaults pull endianness, number of high-priority interrupts and location of vectors from the core configuration and pass it through the C preprocessor. While at it clean up tabs and align the initial stack on 16 bytes. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* Merge remote-tracking branch 'remotes/xtensa/tags/20140526-xtensa' into stagingPeter Maydell2014-05-281-7/+239
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Xtensa fixes queue 2014-05-26: - fix cross-page jumps/calls at the end of TB; - add tests for TBs and instructions crossing page boundary. # gpg: Signature made Mon 26 May 2014 09:37:39 BST using RSA key ID F83FA044 # gpg: Can't check signature: public key not found * remotes/xtensa/tags/20140526-xtensa: target-xtensa: add tests for cross-page TB target-xtensa: completely clean TLB between MMU tests target-xtensa: fix cross-page jumps/calls at the end of TB Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * target-xtensa: add tests for cross-page TBMax Filippov2014-05-261-0/+220
| | | | | | | | Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
| * target-xtensa: completely clean TLB between MMU testsMax Filippov2014-05-261-7/+19
| | | | | | | | Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* | test: lm32: use semihosting for testingMichael Walle2014-05-245-22/+103
| | | | | | | | | | | | | | Instead of the lm32-sys device, use semihosting to print to the host console and exit the test. Signed-off-by: Michael Walle <michael@walle.cc>
* | test: lm32: make test cases independentMichael Walle2014-05-248-0/+25
|/ | | | | | | | Make test cases independent from from each other. Eg. if a test case needs a specific value in register A, don't rely on the fact that it is already set by the preceding test case. Signed-off-by: Michael Walle <michael@walle.cc>
* tests/tcg: Fix compilation of test_pathPeter Maydell2014-05-072-9/+0Star
| | | | | | | | | | | | | | | | The test_path binary is (unlike the other test binaries in tests/tcg) actually intended to be compiled with the same compiler used to build the main QEMU executables. It actually #includes a number of the QEMU source files in an attempt to unit-test the util/path.c functions, and so if it is not compiled with the same compiler used by configure to set CONFIG_ settings then it is liable to fail to build. Fix the makefile to build it with the default C compiler rules, not CC_I386, and fix the test itself not to include a lot of unnecessary trace related source files which cause the build to fail if the trace backend is anything other than 'simple'. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* tests: Fix 'make test' for i686 hosts (build regression)Stefan Weil2014-03-151-5/+8
| | | | | | | | | | | | | | 'make test' is broken at least since commit baacf04799ace72a9c735dd9306a1ceaf305e7cf. Several source files were moved to util/, and some of them there split, so add the missing prefix and new files to fix the compiler and linker errors. There remain more issues, but these changes allow running the test on a Linux i686 host. Cc: qemu-stable@nongnu.org Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* target-xtensa: add basic tests for cache opcodesMax Filippov2014-02-242-0/+98
| | | | | | | Test that non-locking prefetch operations don't cause exceptions on missing TLB and that other 'hit' cache operations do. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* target-xtensa: allow using core configuration in testsMax Filippov2014-02-2430-32/+37
| | | | | | | Add path to the core configuration directory to test build command and replace .include asm directive with #include to enable preprocessing. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* target-xtensa: add overridable test_init macroMax Filippov2014-02-242-2/+6
| | | | | | | Some test suites, like MMU, need per-test initialization. Don't make them redefine test macro, add test_init for that purpose. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* tests: lm32: new rule for single test casesMichael Walle2014-02-041-4/+4
| | | | | | | | Introduce new target "check_%" to run individual test caes, eg. make check_mmu Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
* target-openrisc: Correct carry flag check of l.addc and l.addic test casesSebastian Macke2013-11-202-7/+11
| | | | | | | | The test cases did not correctly test for the carry flag. Signed-off-by: Sebastian Macke <sebastian@macke.de> Reviewed-by: Jia Liu <proljc@gmail.com> Signed-off-by: Jia Liu <proljc@gmail.com>
* Merge remote-tracking branch 'filippov/tags/20130729-xtensa' into stagingAnthony Liguori2013-08-052-9/+38
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | xtensa queue 2013-07-29 * filippov/tags/20130729-xtensa: target-xtensa: check register window inline target-xtensa: don't generate dead code to access invalid SRs tests/tcg/xtensa: Fix out-of-tree build target-xtensa: avoid double-stopping at breakpoints target-xtensa: add fallthrough markers target-xtensa: add extui unit test Conflicts: configure Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * tests/tcg/xtensa: Fix out-of-tree buildAndreas Färber2013-07-291-9/+11
| | | | | | | | | | Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
| * target-xtensa: add extui unit testMax Filippov2013-07-292-0/+27
| | | | | | | | Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* | target-mips: correct the values in the DSP testsPetar Jovanovic2013-07-305-33/+37
|/ | | | | | | | | Five tests files for DSP instructions had wrong expected values in the tests. This change fixes this, and this has been cross-checked by running the same test binaries on Malta 74K board. Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-mips: fix mipsdsp_mul_q31_q31Petar Jovanovic2013-07-292-10/+58
| | | | | | | | | | | Multiplication of two fractional word elements is not correct when sign extension/promotion is needed. This change fixes it by adding correct casts from unsigned to signed values. In addition, the tests (dpaq_sa_l_w.c and dpsq_sa_l_w.c) have been extended to trigger the current issue. Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-mips: fix mipsdsp_trunc16_sat16_roundPetar Jovanovic2013-07-291-4/+20
| | | | | | | | | This change corrects rounding and saturation of Q31 fractional value in mipsdsp_trunc16_sat16_round(). Overflow detection was incorrect for the corner case for PRECRQ_RS.PH, and this test case is also part of the change. Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-mips: fix multiplication in mipsdsp_rndq15_mul_q15_q15Petar Jovanovic2013-07-281-1/+18
| | | | | | | | | | | | | | Multiplication of Q15 fractional halfword vectors was incorrect in the previous implementation of mipsdsp_rndq15_mul_q15_q15. It failed to take element signs into account. This change fixes it, and it adds a test case for it. The change also removes unnecessary cast in the function mipsdsp_mul_q15_q15_overflowflag21(). Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Merge remote-tracking branch 'mjt/trivial-patches' into stagingAnthony Liguori2013-05-221-1/+0Star
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | # By Christophe Lyon (1) and others # Via Michael Tokarev * mjt/trivial-patches: target-moxie: replace target_phys_addr_t with hwaddr Rename hexdump to avoid FreeBSD libutil conflict remove some double-includes translate: remove redundantly included qemu/timer.h Remove twice include of qemu-common.h fix /proc/self/maps output Message-id: 51977B44.1000302@msgid.tls.msk.ru Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * remove some double-includesMichael Tokarev2013-05-181-1/+0Star
| | | | | | | | | | | | | | | | Some source files #include the same header more than once for no good reason. Remove second #includes in such cases. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* | target-mips: fix EXTPDP and setting up pos field in the DSPControl regPetar Jovanovic2013-05-191-0/+18
|/ | | | | | | | | | | | This change makes sure that modifications of pos field in the DSPControl register do not trash other bits in the register. This bug can be triggered with the additional test case in mips32-dsp/extpdp.c in this commit. In addition to this, this change corrects incorrect calculation of the mask for EXTPDP. Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-mips: fix incorrect behaviour for EXTPPetar Jovanovic2013-05-171-0/+18
| | | | | | | | | | | The mask for EXTP instruction when size=31 has not been correctly calculated. The test (mips32-dsp/extp.c) has been extended to include the case that triggers the issue. Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-mips: fix incorrect behaviour for INSVPetar Jovanovic2013-05-081-0/+13
| | | | | | | | | | | | Corner case for INSV instruction when size=32 has not been correctly implemented. The mask for size should be one bit wider, and preparing the filter variable should be aware of this case too. The test for INSV has been extended to include the case that triggers the bug. Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-mips: fix calculation of overflow for SHLL.PH and SHLL.QBPetar Jovanovic2013-05-032-3/+53
| | | | | | | | | | | | This change corrects and simplifies how discard is calculated for shift left logical vector instructions. It is used to detect overflow and set bit 22 in the DSPControl register. The existing tests (shll_ph.c, shll_qb.c) are extended with the corner cases that expose incorrectness in the previous implementation. Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-mips: fix mipsdsp_mul_q15_q15 and tests for MAQ_SA_W_PHL/PHRPetar Jovanovic2013-04-152-18/+18
| | | | | | | | | | | | | The operands for MAQ_SA_W.PHL/MAQ_SA_W.PHR must in specified format. Otherwise, the results are unpredictable. Once the operands were corrected in the tests (part of this change), a bug in mipsdsp_mul_q15_q15 became visible. This change corrects the tests for MAQ_SA_W.PHL/MAQ_SA_W.PHR and fixes sign-related issue in mipsdsp_mul_q15_q15. It also removes unnecessary comment. Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>