From patchwork Mon Mar 17 15:51:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 123 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx22.g.dreamhost.com (caibbdcaabij.dreamhost.com [208.113.200.189]) by wilcox.dreamhost.com (Postfix) with ESMTP id 9297E3600D3 for ; Mon, 17 Mar 2014 08:51:34 -0700 (PDT) Received: by homiemail-mx22.g.dreamhost.com (Postfix, from userid 14314964) id 438C24F1962A; Mon, 17 Mar 2014 08:51:34 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx22.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx22.g.dreamhost.com (Postfix) with ESMTPS id 23D354F63C1D for ; Mon, 17 Mar 2014 08:51:34 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=WIQ01tyGnSiMzVWDuSFMsvP1YkFgwSb fRG/pmn7t2d54syK8URshVc96UHC5ProJzKLuYkUyPX+ZWojLvNfV1dJz5h28g3g HnbdkgVVX/hm9XVW7cmqCNCEWPA2VR4Fr6IOvG1iv069cwgjQDGyqOw8fU+hzC43 jBn+LE1ifwzg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=1NNkE3MMYxmjqW7Wum0pDmhqPlw=; b=hoA1/ 5nn2TzD2/AlPYkDlzLWA+SNSRvi1Ay9oa1vkO1MPy/7XzNLAVwcAm1Qy8/oCCN+U lgff62hMOJbeUm2tZVAoU/GnjHH44jP/XBWHudOfvdn0K1WlsjdX7rlPuPiVE3CU FHAZlC9Wg4xUHKj3iObgWrw3X/rFX6cN+LO6wo= Received: (qmail 4008 invoked by alias); 17 Mar 2014 15:51:26 -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 3939 invoked by uid 89); 17 Mar 2014 15:51:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 17 Mar 2014 15:51:22 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 0087D116592 for ; Mon, 17 Mar 2014 11:51:21 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id evhIwcy2iNLE for ; Mon, 17 Mar 2014 11:51:20 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id C068E1164E2 for ; Mon, 17 Mar 2014 11:51:20 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 76C7EE0968; Mon, 17 Mar 2014 08:51:20 -0700 (PDT) From: Joel Brobecker To: gdb-patches@sourceware.org Subject: pushed: [testsuite/Ada 2/2] New testcase for packed array renaming. Date: Mon, 17 Mar 2014 08:51:12 -0700 Message-Id: <1395071472-25068-3-git-send-email-brobecker@adacore.com> In-Reply-To: <1395071472-25068-1-git-send-email-brobecker@adacore.com> References: <1395071472-25068-1-git-send-email-brobecker@adacore.com> X-DH-Original-To: gdb@patchwork.siddhesh.in gdb/testsuite/ChangeLog: * gdb.ada/pckd_arr_ren: New testcase. Tested on x86_64-linux. Pushed. --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.ada/pckd_arr_ren.exp | 33 ++++++++++++++++++++++++++++++ gdb/testsuite/gdb.ada/pckd_arr_ren/foo.adb | 24 ++++++++++++++++++++++ gdb/testsuite/gdb.ada/pckd_arr_ren/pck.adb | 26 +++++++++++++++++++++++ gdb/testsuite/gdb.ada/pckd_arr_ren/pck.ads | 24 ++++++++++++++++++++++ 5 files changed, 111 insertions(+) create mode 100644 gdb/testsuite/gdb.ada/pckd_arr_ren.exp create mode 100644 gdb/testsuite/gdb.ada/pckd_arr_ren/foo.adb create mode 100644 gdb/testsuite/gdb.ada/pckd_arr_ren/pck.adb create mode 100644 gdb/testsuite/gdb.ada/pckd_arr_ren/pck.ads diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 1ebde9b..4e6e248 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2014-03-17 Joel Brobecker + + * gdb.ada/pckd_arr_ren: New testcase. + 2014-03-13 Doug Evans PR guile/16612 diff --git a/gdb/testsuite/gdb.ada/pckd_arr_ren.exp b/gdb/testsuite/gdb.ada/pckd_arr_ren.exp new file mode 100644 index 0000000..a031d3e --- /dev/null +++ b/gdb/testsuite/gdb.ada/pckd_arr_ren.exp @@ -0,0 +1,33 @@ +# Copyright 2014 Free Software Foundation, Inc. +# +# 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 . + +load_lib "ada.exp" + +if { [skip_ada_tests] } { return -1 } + +standard_ada_testfile foo + +if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} { + return -1 +} + +clean_restart ${testfile} + +set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb] +runto "foo.adb:$bp_location" + +gdb_test "print A2" \ + "= (\\s*)?\\(false, false\\)" \ + "print var" diff --git a/gdb/testsuite/gdb.ada/pckd_arr_ren/foo.adb b/gdb/testsuite/gdb.ada/pckd_arr_ren/foo.adb new file mode 100644 index 0000000..4e7f18d --- /dev/null +++ b/gdb/testsuite/gdb.ada/pckd_arr_ren/foo.adb @@ -0,0 +1,24 @@ +-- Copyright 2014 Free Software Foundation, Inc. +-- +-- 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 . + +with Pck; use Pck; + +procedure Foo is + A1 : Packed_Array := Make (1, 2); + A2 : Packed_Array renames A1; +begin + Do_Nothing (A2'Address); -- STOP +end Foo; + diff --git a/gdb/testsuite/gdb.ada/pckd_arr_ren/pck.adb b/gdb/testsuite/gdb.ada/pckd_arr_ren/pck.adb new file mode 100644 index 0000000..de0e5d0 --- /dev/null +++ b/gdb/testsuite/gdb.ada/pckd_arr_ren/pck.adb @@ -0,0 +1,26 @@ +-- Copyright 2014 Free Software Foundation, Inc. +-- +-- 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 . + +package body Pck is + function Make (H, L : Natural) return Packed_Array is + begin + return (H .. L => False); + end Make; + + procedure Do_Nothing (A : System.Address) is + begin + null; + end Do_Nothing; +end Pck; diff --git a/gdb/testsuite/gdb.ada/pckd_arr_ren/pck.ads b/gdb/testsuite/gdb.ada/pckd_arr_ren/pck.ads new file mode 100644 index 0000000..7acfb71 --- /dev/null +++ b/gdb/testsuite/gdb.ada/pckd_arr_ren/pck.ads @@ -0,0 +1,24 @@ +-- Copyright 2014 Free Software Foundation, Inc. +-- +-- 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 . + +with System; +package Pck is + type Packed_Array is array (Natural range <>) of Boolean; + pragma Pack (Packed_Array); + + function Make (H, L : Natural) return Packed_Array; + + procedure Do_Nothing (A : System.Address); +end Pck;