From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78545 invoked by alias); 23 Nov 2016 20:46:15 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 78516 invoked by uid 89); 23 Nov 2016 20:46:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 Nov 2016 20:46:11 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5912CC05490A for ; Wed, 23 Nov 2016 20:46:09 +0000 (UTC) Received: from vpn-226-148.phx2.redhat.com (vpn-226-148.phx2.redhat.com [10.3.226.148]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uANKk8PN024545; Wed, 23 Nov 2016 15:46:08 -0500 Message-ID: <1479933967.7673.90.camel@redhat.com> Subject: Re: [PATCH 8/9] Introduce class function_reader (v4) From: David Malcolm To: Bernd Schmidt , gcc-patches@gcc.gnu.org Date: Wed, 23 Nov 2016 20:46:00 -0000 In-Reply-To: <39c650c5-0d7d-803c-32a1-c4eba64a47fd@redhat.com> References: <1478898935-46932-1-git-send-email-dmalcolm@redhat.com> <1478898935-46932-9-git-send-email-dmalcolm@redhat.com> <39c650c5-0d7d-803c-32a1-c4eba64a47fd@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg02451.txt.bz2 On Wed, 2016-11-23 at 21:15 +0100, Bernd Schmidt wrote: > On 11/11/2016 10:15 PM, David Malcolm wrote: > > > +static void > > +aarch64_test_loading_full_dump () > > +{ > > + rtl_dump_test t (SELFTEST_LOCATION, locate_file ("aarch64/times > > -two.rtl")); > > + > > + ASSERT_STREQ ("times_two", IDENTIFIER_POINTER (DECL_NAME (cfun > > ->decl))); > > + > > + rtx_insn *insn_1 = get_insn_by_uid (1); > > + ASSERT_EQ (NOTE, GET_CODE (insn_1)); > > + > > + rtx_insn *insn_15 = get_insn_by_uid (15); > > + ASSERT_EQ (INSN, GET_CODE (insn_15)); > > + ASSERT_EQ (USE, GET_CODE (PATTERN (insn_15))); > > + > > + /* Verify crtl->return_rtx. */ > > + ASSERT_EQ (REG, GET_CODE (crtl->return_rtx)); > > + ASSERT_EQ (0, REGNO (crtl->return_rtx)); > > + ASSERT_EQ (SImode, GET_MODE (crtl->return_rtx)); > > +} > > The problem I'm having with this patch, and why I've not really > commented on the latter parts of the series, is that I was hoping the > tests would be more self-contained. The tests in this patch (8/9) are more about verifying that the loader is sane: they load a dump, and then assert various properties of it, to ensure that we're loading things correctly. I moved the example dumps out of the .c files (using locate_file) to avoid having to embed them in the .c file and escape things (which people objected to in an earlier version of the kit). > For transformations I had mentioned > the idea of having both before and after dumps. > > Having a few test files with C code to verify them is probably not a > big > deal, but I wonder whether this is going to be the norm rather than > the > exception, and whether there are better ways of doing it. These will be the exception; they're really just about verifying that the loader is working correctly. In a previous version of the kit there were indeed selftests that loaded a dump and attempted to run parts of a pass on it. I've deleted all of those style of selftest. > Maybe there > needs to be a way of annotating the input RTL to tell the compiler > what > kinds of tests to run on it. The "real" tests are in patch 9 of 9, and use DejaGnu directives (scanning dumps, and "dg-do run" to actually run the generated code).