From patchwork Wed Apr 11 14:25:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 26683 Received: (qmail 52834 invoked by alias); 11 Apr 2018 14:26:01 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 52524 invoked by uid 89); 11 Apr 2018 14:26:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Four X-HELO: gateway21.websitewelcome.com Received: from gateway21.websitewelcome.com (HELO gateway21.websitewelcome.com) (192.185.45.91) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Apr 2018 14:25:59 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway21.websitewelcome.com (Postfix) with ESMTP id DFC64400C80D3 for ; Wed, 11 Apr 2018 09:25:57 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 6GhBfhMnG9sXi6GhBfh4C9; Wed, 11 Apr 2018 09:25:57 -0500 Received: from 75-166-37-45.hlrn.qwest.net ([75.166.37.45]:52762 helo=pokyo.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1f6GhB-000suZ-KU; Wed, 11 Apr 2018 09:25:57 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [FYI] Add Rust test case for ".." struct initializer Date: Wed, 11 Apr 2018 08:25:50 -0600 Message-Id: <20180411142550.22928-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1f6GhB-000suZ-KU X-Source-Sender: 75-166-37-45.hlrn.qwest.net (pokyo.Home) [75.166.37.45]:52762 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes Building with --coverage pointed out that there was no Rust test for initializing a structure using the ".." initializer. This patch adds such a test. Regression tested on x86-64 Fedora 26. 2018-04-11 Tom Tromey * gdb.rust/simple.exp: Add test for ".." struct initializer. --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.rust/simple.exp | 3 +++ 2 files changed, 7 insertions(+) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 5dd055385d..d7571985dc 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-04-11 Tom Tromey + + * gdb.rust/simple.exp: Add test for ".." struct initializer. + 2018-04-10 Pedro Alves * gdb.base/fork-running-state.c (fork_child): Don't exit if parent diff --git a/gdb/testsuite/gdb.rust/simple.exp b/gdb/testsuite/gdb.rust/simple.exp index 2db596b932..846abe11a4 100644 --- a/gdb/testsuite/gdb.rust/simple.exp +++ b/gdb/testsuite/gdb.rust/simple.exp @@ -169,6 +169,9 @@ gdb_test "print nosuchsymbol" \ gdb_test "print simple::HiBob{field1, field2}" \ " = simple::HiBob \\{field1: 77, field2: 88\\}" +gdb_test "print simple::HiBob{field1: 99, .. y}" \ + " = simple::HiBob \\{field1: 99, field2: 8\\}" + gdb_test "print e" " = simple::MoreComplicated::Two\\(73\\)" gdb_test "print e2" \ " = simple::MoreComplicated::Four\\{this: true, is: 8, a: 109 'm', struct_: 100, variant: 10\\}"