From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4888 invoked by alias); 16 Jun 2014 18:41:22 -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 4877 invoked by uid 89); 16 Jun 2014 18:41:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS,UNSUBSCRIBE_BODY autolearn=no version=3.3.2 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; Mon, 16 Jun 2014 18:41:20 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5GIfFqI016019 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Jun 2014 14:41:15 -0400 Received: from host2.jankratochvil.net (ovpn-116-65.ams2.redhat.com [10.36.116.65]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5GIfCcK021662 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Mon, 16 Jun 2014 14:41:14 -0400 Date: Mon, 16 Jun 2014 18:41:00 -0000 From: Jan Kratochvil To: Keven Boell Cc: gdb-patches@sourceware.org, sanimir.agovic@intel.com Subject: Re: [PATCH 20/23] test: dynamic string evaluations. Message-ID: <20140616184111.GA20288@host2.jankratochvil.net> References: <1401861266-6240-1-git-send-email-keven.boell@intel.com> <1401861266-6240-21-git-send-email-keven.boell@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1401861266-6240-21-git-send-email-keven.boell@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00564.txt.bz2 On Wed, 04 Jun 2014 07:54:23 +0200, Keven Boell wrote: > --- /dev/null > +++ b/gdb/testsuite/gdb.fortran/vla-strings.f90 > @@ -0,0 +1,38 @@ > +! 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 2 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, write to the Free Software > +! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. > + > +program vla_strings > + character(len=:), target, allocatable :: var_char > + character(len=:), pointer :: var_char_p > + logical :: l > + > + allocate(character(len=10) :: var_char) > + l = allocated(var_char) ! var_char-allocated-1 > + var_char = 'foo' > + deallocate(var_char) ! var_char-filled-1 > + l = allocated(var_char) ! var_char-deallocated > + allocate(character(len=42) :: var_char) > + l = allocated(var_char) > + var_char = 'foobar' > + var_char = '' ! var_char-filled-2 > + allocate(character(len=21) :: var_char) ! var_char-empty On Fedora Rawhide x86_64 (gcc-4.9.0-8.fc21.x86_64) I get: $ ./gdb.fortran/vla-strings At line 31 of file ./gdb.fortran/vla-strings.f90 Fortran runtime error: Attempting to allocate already allocated variable 'var_char' This also causes: Running ./gdb.fortran/vla-strings.exp ... FAIL: gdb.fortran/vla-strings.exp: continue to breakpoint: var_char-allocated-3 (the program exited) FAIL: gdb.fortran/vla-strings.exp: print var_char after allocated third time FAIL: gdb.fortran/vla-strings.exp: whatis var_char after allocated third time FAIL: gdb.fortran/vla-strings.exp: ptype var_char after allocated third time FAIL: gdb.fortran/vla-strings.exp: continue to breakpoint: var_char_p-associated (the program is no longer running) FAIL: gdb.fortran/vla-strings.exp: print var_char_p after associated FAIL: gdb.fortran/vla-strings.exp: print *var_char_ after associated FAIL: gdb.fortran/vla-strings.exp: whatis var_char_p after associated FAIL: gdb.fortran/vla-strings.exp: ptype var_char_p after associated > + l = allocated(var_char) ! var_char-allocated-3 > + var_char = 'johndoe' > + var_char_p => var_char > + l = associated(var_char_p) ! var_char_p-associated > + var_char_p => null() > + l = associated(var_char_p) ! var_char_p-not-associated > +end program vla_strings > -- > 1.7.9.5 Thanks, Jan