From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120029 invoked by alias); 20 Jun 2016 19:04:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 120001 invoked by uid 89); 20 Jun 2016 19:03:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=todos 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 20 Jun 2016 19:03:48 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 762E7C049E17; Mon, 20 Jun 2016 19:03:47 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5KJ3iX8029280; Mon, 20 Jun 2016 15:03:45 -0400 Subject: Re: [PATCH v5 11/11] [PR gdb/14441] gdb: testsuite: add rvalue reference tests To: Artemiy Volkov , gdb-patches@sourceware.org References: <1458593958-25656-1-git-send-email-artemiyv@acm.org> <20160606192225.12384-1-artemiyv@acm.org> <20160606192225.12384-12-artemiyv@acm.org> Cc: keiths@redhat.com From: Pedro Alves Message-ID: <706fb65c-cca9-9da0-8609-4b9748ccda69@redhat.com> Date: Mon, 20 Jun 2016 19:04:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160606192225.12384-12-artemiyv@acm.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-06/txt/msg00337.txt.bz2 Thanks a lot for doing this. On 06/06/2016 08:22 PM, Artemiy Volkov wrote: > --- /dev/null > +++ b/gdb/testsuite/gdb.cp/rvalue-ref-casts.cc > @@ -0,0 +1,56 @@ > +#include Please add a GPLv3+ header to all new testsuite files. Some existing files don't have them, but all new files are required to. If you based the file on some pre-existing file, them we should preserve the copyright year range. If that is the case, and the file does not currently have a header, use the date the original file was first committed to the sources (git blame/log and/or grepping ChangeLog files should allow finding easily). > +main (int argc, char **argv) > +{ > + A *a = new B(42, 1729); > + B *b = (B *) a; > + A &ar = *b; > + B &br = (B&)ar; > + A &&arr = std::move(A(42)); > + B &&brr = std::move(B(42, 1729)); All new tests should follow GNU coding conventions too, unless required otherwise for the particular issue being tested (which doesn't seem to be the case here). IOW, missing spaces before parentheses, & and casts: B &br = (B &) ar; A &&arr = std::move (A (42)); B &&brr = std::move (B (42, 1729)); > +# Copyright 2016 Free Software Foundation, Inc. > + ... > + > +# C++11 rvalue reference type casting tests, based on gdb.cp/casts.exp. > +# If there's copyrightable content in the file that came from gdb.cp/casts.exp, then please preserve the copyright year range. On 06/06/2016 08:22 PM, Artemiy Volkov wrote: > +++ b/gdb/testsuite/gdb.cp/rvalue-ref-overload.exp ... > +# > +# This is hairy to begin with. It is even more hairy because of the > +# XX_* alternate patterns to catch the KFAIL and XFAIL cases. > + > +set re_class "((struct|class) foo \{${ws}public:|struct foo \{)" > +set re_fields "" > +set re_ctor "foo\\(void\\);${ws}foo\\(foo_lval_ref\\);${ws}foo\\(foo_rval_ref\\);" > +set re_dtor "~foo\\((void|)\\);" > +set XX_dtor "~foo\\(int\\);" > +set re_methods "${ws}int overload1arg\\(foo_lval_ref\\);" > +append re_methods "${ws}int overload1arg\\(foo_rval_ref\\);" > +set re_synth "foo & operator=\\(foo const ?&\\);" > + > +gdb_test_multiple "ptype foo_rr_instance1" "ptype foo_rr_instance1" { > + -re "type = $re_class${ws}$re_synth${ws}$re_dtor${ws}$re_ctor${ws}$re_methods$nl\}$nl$gdb_prompt $" { > + # gcc 2.95.3 -gstabs+, no "const" on "const char *" > + # TODO: gdb.base/constvar.exp has XFAILed this kind of problem for a > + # long time, but an XFAIL really needs an external bug report. > + # -- chastain 2003-12-31 > + # setup_xfail "*-*-*" > + # fail "ptype foo_rr_instance1" > + # TODO: this should be a KFAIL. > + pass "ptype foo_rr_instance1 (shorter match)" > + } > + -re "type = $re_class${ws}$re_synth${ws}$re_dtor${ws}$re_ctor${ws}$re_methods$nl\}$nl$gdb_prompt $" { > + # gcc 2.95.3 -gstabs+ if "const char *" ever gets fixed > + pass "ptype foo_rr_instance1" > + } > + -re "type = $re_class${ws}$re_fields${ws}$re_ctor${ws}$XX_dtor${ws}$re_methods$nl\}$nl$gdb_prompt $" { > + # gcc 3.3.2 -gdwarf-2, "~foo(int)" > + # TODO: kfail this > + # kfail "gdb/1113" "ptype foo_rr_instance1" > + pass "ptype foo_rr_instance1 (shorter match)" > + } > + -re "type = $re_class{ws}$re_ctor${ws}$re_dtor${ws}$re_methods$nl\}$nl$gdb_prompt $" { > + # gcc 3.3.2 -gdwarf-2, if the dtor bug gets fixed > + # gcc HEAD -gdwarf-2 (abi-2) > + # TODO: just pass this > + pass "ptype foo_rr_instance1 (shorter match)" > + } > + -re "type = $re_class${ws}$re_synth${ws}$re_ctor${ws}$re_dtor${ws}$re_methods$nl\}$nl$gdb_prompt $" { > + # gcc 3.3.2 -gstabs+ > + # TODO: enough with the "shorter match" > + pass "ptype foo_rr_instance1 (shorter match)" > + } > + -re "type = $re_class${ws}$re_ctor${ws}$re_dtor${ws}$re_methods${ws}$re_synth$nl\}$nl$gdb_prompt $" { > + # gcc HEAD -gstabs+ (abi-2) > + pass "ptype foo_rr_instance1 (shorter match)" > + } Several references to TODOs and kfails, etc. that are likely not really relevant here. Can we clean this up? (same comments apply to the other files). Thanks, Pedro Alves