From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8DyfMY0V9F/uNAAAWB0awg (envelope-from ) for ; Tue, 05 Jan 2021 02:30:21 -0500 Received: by simark.ca (Postfix, from userid 112) id BDA091F0AA; Tue, 5 Jan 2021 02:30:21 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 297811E965 for ; Tue, 5 Jan 2021 02:30:18 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9F986381DC6B; Tue, 5 Jan 2021 07:30:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F986381DC6B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1609831817; bh=Br4HRcU7WvTphQg6XSid5sLwhbPUYxTiZ7Ja//T8C+Q=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=tlA+/GICIuwJCPwlj5oxajk3JPxEFsDk7P9bbeQVIy5ciRJb1KRfYiYg5R8uJChQG ZCtwbEEWqTDjfhRGiGfgKz8Jg9wr/8J/brwlKlHqty2ZF5gLrFVHEU/ZHVwFnr1Phd O1G/iwQl7BbMkV61pWF6pjulMTwZFuQX+dBasPQs= Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 52884393BC0A for ; Tue, 5 Jan 2021 07:30:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 52884393BC0A Received: from vapier.lan (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 8263E340A5C for ; Tue, 5 Jan 2021 07:30:12 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH] sim: frv: clean up redundant test coverage Date: Tue, 5 Jan 2021 02:30:11 -0500 Message-Id: <20210105073011.7778-1-vapier@gentoo.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210105065548.9260-1-vapier@gentoo.org> References: <20210105065548.9260-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" 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. --- sim/testsuite/ChangeLog | 6 + sim/testsuite/configure | 5 - sim/testsuite/configure.ac | 3 - sim/testsuite/frv-elf/ChangeLog | 48 - sim/testsuite/frv-elf/Makefile.in | 158 - sim/testsuite/frv-elf/configure | 2984 ----------------- sim/testsuite/frv-elf/configure.ac | 18 - sim/testsuite/frv-elf/loop.s | 2 - sim/testsuite/sim/frv/ChangeLog | 6 + .../{frv-elf/cache.s => sim/frv/cache.ms} | 6 +- .../{frv-elf/exit47.s => sim/frv/exit47.ms} | 6 + .../{frv-elf/grloop.s => sim/frv/grloop.ms} | 3 + .../{frv-elf/hello.s => sim/frv/hello.ms} | 3 + sim/testsuite/sim/frv/misc.exp | 19 + 14 files changed, 48 insertions(+), 3219 deletions(-) delete mode 100644 sim/testsuite/frv-elf/ChangeLog delete mode 100644 sim/testsuite/frv-elf/Makefile.in delete mode 100755 sim/testsuite/frv-elf/configure delete mode 100644 sim/testsuite/frv-elf/configure.ac delete mode 100644 sim/testsuite/frv-elf/loop.s rename sim/testsuite/{frv-elf/cache.s => sim/frv/cache.ms} (95%) rename sim/testsuite/{frv-elf/exit47.s => sim/frv/exit47.ms} (50%) rename sim/testsuite/{frv-elf/grloop.s => sim/frv/grloop.ms} (86%) rename sim/testsuite/{frv-elf/hello.s => sim/frv/hello.ms} (86%) create mode 100644 sim/testsuite/sim/frv/misc.exp diff --git a/sim/testsuite/ChangeLog b/sim/testsuite/ChangeLog index 0f122037fb5c..a5ca8f4665f8 100644 --- a/sim/testsuite/ChangeLog +++ b/sim/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2021-01-05 Mike Frysinger + + * configure.ac (target): Delete frv-*-elf case. + * configure: Regenerate. + * frv-elf/: Delete directory. + 2021-01-05 Mike Frysinger * configure.ac (target): Delete m32r-*-elf case. diff --git a/sim/testsuite/configure.ac b/sim/testsuite/configure.ac index 962c0930d63b..71a16c9bd5c3 100644 --- a/sim/testsuite/configure.ac +++ b/sim/testsuite/configure.ac @@ -16,9 +16,6 @@ case ${target} in d10v-*-elf ) AC_CONFIG_SUBDIRS(d10v-elf) ;; - frv-*-elf ) - AC_CONFIG_SUBDIRS(frv-elf) - ;; mips64el-*-elf ) AC_CONFIG_SUBDIRS(mips64el-elf) ;; diff --git a/sim/testsuite/frv-elf/ChangeLog b/sim/testsuite/frv-elf/ChangeLog deleted file mode 100644 index 904de02b9983..000000000000 --- a/sim/testsuite/frv-elf/ChangeLog +++ /dev/null diff --git a/sim/testsuite/frv-elf/Makefile.in b/sim/testsuite/frv-elf/Makefile.in deleted file mode 100644 index dd9bc94fb718..000000000000 --- a/sim/testsuite/frv-elf/Makefile.in +++ /dev/null @@ -1,158 +0,0 @@ -# Makefile for regression testing the frv simulator. -# Copyright (C) 1998-2021 Free Software Foundation, Inc. - -# This file is part of GDB. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -VPATH = @srcdir@ -srcdir = @srcdir@ -srcroot = $(srcdir)/../../.. - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -host_alias = @host_alias@ -target_alias = @target_alias@ -program_transform_name = @program_transform_name@ -build_canonical = @build@ -host_canonical = @host@ -target_canonical = @target@ -target_cpu = @target_cpu@ - - -SHELL = @SHELL@ -SUBDIRS = @subdirs@ -RPATH_ENVVAR = @RPATH_ENVVAR@ - -EXPECT = `if [ -f ../../../expect/expect ] ; then \ - echo ../../../expect/expect ; \ - else echo expect ; fi` - -RUNTEST = $(RUNTEST_FOR_TARGET) - -RUNTESTFLAGS = - -RUNTEST_FOR_TARGET = `\ - if [ -f $${srcroot}/dejagnu/runtest ]; then \ - echo $${srcroot}/dejagnu/runtest; \ - else \ - if [ "$(host_canonical)" = "$(target_canonical)" ]; then \ - echo runtest; \ - else \ - t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \ - fi; \ - fi` - - -AS_FOR_TARGET = `\ - if [ -x ../../../gas/as-new ]; then \ - echo ../../../gas/as-new ; \ - else \ - echo $(target_alias)-as ; \ - fi` - -LD_FOR_TARGET = `\ - if [ -x ../../../ld/ld-new ]; then \ - echo ../../../ld/ld-new ; \ - else \ - echo $(target_alias)-ld ; \ - fi` - -RUN_FOR_TARGET = `\ - if [ -x ../../../sim/${target_cpu}/run ]; then \ - echo ../../../sim/${target_cpu}/run ; \ - else \ - echo $(target_alias)-run ; \ - fi` - -TESTS = \ - exit47.ko \ - grloop.ok \ - hello.ok - - -check: sanity $(TESTS) -sanity: - @eval echo AS_FOR_TARGET = $(AS_FOR_TARGET) - @eval echo LD_FOR_TARGET = $(LD_FOR_TARGET) - @eval echo RUN_FOR_TARGET = $(RUN_FOR_TARGET) - - - -# Rules for running all the tests, put into three types -# exit success, exit fail, print "Hello World" - -.u.log: - uudecode $*.u - $(RUN_FOR_TARGET) $* > $*.log - - -# Rules for running the tests - -.SUFFIXES: .u .ok .run .hi .ko -.run.ok: - rm -f tmp-$* $*.hi - ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$* - mv tmp-$* $*.ok -.run.hi: - rm -f tmp-$* $*.hi diff-$* - ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$* - echo "Hello World" | diff - tmp-$* > diff-$* - cat tmp-$* diff-$* > $*.hi -.run.ko: - rm -f tmp-$* $*.ko - set +e ; \ - ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$* ; \ - if [ $$? -eq 47 ] ; then \ - exit 0 ; \ - else \ - exit 1 ; \ - fi - mv tmp-$* $*.ko - - -# Rules for building all the tests and packing them into -# uuencoded files. - -uuencode: em-pstr.u em-e0.u em-e47.u em-pchr.u - -.SUFFIXES: .u .s .run -.s.u: - rm -f $*.o $*.run - $(AS_FOR_TARGET) $(srcdir)/$*.s -o $*.o - $(LD_FOR_TARGET) -o $* $*.o - uuencode < $* $* > $*.u - rm -f $*.o $* -.s.run: - rm -f $*.o $*.run - $(AS_FOR_TARGET) $(srcdir)/$*.s -o $*.o - $(LD_FOR_TARGET) -o $*.run $*.o - rm -f $*.o $* - - -clean mostlyclean: - rm -f *~ core *.o a.out - rm -f $(TESTS) - -distclean maintainer-clean realclean: clean - rm -f *~ core - rm -f Makefile config.status *-init.exp - rm -fr *.log summary detail *.plog *.sum *.psum site.* - -Makefile : Makefile.in config.status - $(SHELL) config.status - -config.status: configure - $(SHELL) config.status --recheck diff --git a/sim/testsuite/frv-elf/configure b/sim/testsuite/frv-elf/configure deleted file mode 100755 index 5686b7e4eb2c..000000000000 --- a/sim/testsuite/frv-elf/configure +++ /dev/null diff --git a/sim/testsuite/frv-elf/configure.ac b/sim/testsuite/frv-elf/configure.ac deleted file mode 100644 index 278d84d0e825..000000000000 --- a/sim/testsuite/frv-elf/configure.ac +++ /dev/null @@ -1,18 +0,0 @@ -dnl Process this file file with autoconf to produce a configure script. -dnl This file is a shell script fragment that supplies the information -dnl necessary to tailor a template configure script into the configure -dnl script appropriate for this directory. For more information, check -dnl any existing configure script. - -dnl FIXME - think of a truly uniq file to this directory -AC_INIT(Makefile.in) - -CC=${CC-cc} -AC_SUBST(CC) -AC_CONFIG_AUX_DIR(../../..) -AC_CANONICAL_SYSTEM - -AC_SUBST(target_cpu) - - -AC_OUTPUT(Makefile) diff --git a/sim/testsuite/frv-elf/loop.s b/sim/testsuite/frv-elf/loop.s deleted file mode 100644 index 8489c13c5697..000000000000 --- a/sim/testsuite/frv-elf/loop.s +++ /dev/null @@ -1,2 +0,0 @@ - .global _start -_start: bra icc0,0,_start diff --git a/sim/testsuite/sim/frv/ChangeLog b/sim/testsuite/sim/frv/ChangeLog index 75b7b545ca0c..37839fd42919 100644 --- a/sim/testsuite/sim/frv/ChangeLog +++ b/sim/testsuite/sim/frv/ChangeLog @@ -1,3 +1,9 @@ +2021-01-05 Mike Frysinger + + * cache.ms: New testcase from ../../frv-elf/. + * exit47.ms, grloop.ms, hello.ms: Likewise. + * misc.exp: New file. + 2004-03-01 Richard Sandiford * allinsn.exp (all_machs): Add fr405 and fr450. diff --git a/sim/testsuite/frv-elf/cache.s b/sim/testsuite/sim/frv/cache.ms similarity index 95% rename from sim/testsuite/frv-elf/cache.s rename to sim/testsuite/sim/frv/cache.ms index 2ed0e1e35a94..5b93f0100024 100644 --- a/sim/testsuite/frv-elf/cache.s +++ b/sim/testsuite/sim/frv/cache.ms @@ -1,5 +1,9 @@ -# run with --memory-region 0xff000000,4 --memory-region 0xfe000000,00404000 +# mach: frv fr500 fr550 +# sim: --memory-region 0xff000000,4 --memory-region 0xfe000000,00404000 +# xfail: "crashes with bad write" frv-* + ; Exit with return code + .macro exit rc setlos.p #1,gr7 setlos \rc,gr8 diff --git a/sim/testsuite/frv-elf/exit47.s b/sim/testsuite/sim/frv/exit47.ms similarity index 50% rename from sim/testsuite/frv-elf/exit47.s rename to sim/testsuite/sim/frv/exit47.ms index 70e56b3c4ab3..53306e5a871f 100644 --- a/sim/testsuite/frv-elf/exit47.s +++ b/sim/testsuite/sim/frv/exit47.ms @@ -1,3 +1,9 @@ +# mach: all +# status: 47 +# output: + + ;; Return with exit code 47. + .global _start _start: setlos #47,gr8 diff --git a/sim/testsuite/frv-elf/grloop.s b/sim/testsuite/sim/frv/grloop.ms similarity index 86% rename from sim/testsuite/frv-elf/grloop.s rename to sim/testsuite/sim/frv/grloop.ms index 844ad1d2941e..00609637a17a 100644 --- a/sim/testsuite/frv-elf/grloop.s +++ b/sim/testsuite/sim/frv/grloop.ms @@ -1,3 +1,6 @@ +# mach: all +# output: + .global _start _start: setlo 0x0400,gr10 diff --git a/sim/testsuite/frv-elf/hello.s b/sim/testsuite/sim/frv/hello.ms similarity index 86% rename from sim/testsuite/frv-elf/hello.s rename to sim/testsuite/sim/frv/hello.ms index 0151febc02f2..117e4a6be83b 100644 --- a/sim/testsuite/frv-elf/hello.s +++ b/sim/testsuite/sim/frv/hello.ms @@ -1,3 +1,6 @@ +# mach: all +# output: Hello World!\n + .global _start _start: diff --git a/sim/testsuite/sim/frv/misc.exp b/sim/testsuite/sim/frv/misc.exp new file mode 100644 index 000000000000..4245a81cb60a --- /dev/null +++ b/sim/testsuite/sim/frv/misc.exp @@ -0,0 +1,19 @@ +# Miscellaneous FRV simulator testcases. + +if [istarget frv*-*] { + # load support procs (none yet) + # load_lib cgen.exp + # all machines + set all_machs "frv fr500 fr550 fr400 fr405 fr450" + set cpu_option -mcpu + + # The .ms suffix is for "miscellaneous .s". + foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.ms]] { + # 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 + } +} -- 2.28.0