From: Wu Zhou <woodzltc@cn.ibm.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA] New testcase to evaluate Fortran substring expression
Date: Wed, 22 Jun 2005 04:02:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.63.0506221044490.11343@wks190384wss.cn.ibm.com> (raw)
Sorry, I miss-typed the mail address. Original text is as follows:
---------- Forwarded message ----------
Date: Wed, 22 Jun 2005 10:39:48 +0800 (CST)
From: Wu Zhou <woodzltc@cn.ibm.com>
To: gdb-patches@cn.ibm.com
Cc: eliz@gnu.org, drow@false.org
Subject: [RFA] New testcase to evaluate Fortran substring expression
Eli/Daniel and all,
Here is my new testcase to evaluate Fortran substring expression. The
intention is to test whehter current GDB could correctly handle substring
expression evaluation of Fortran. I tested it against g77-3.2.3 and
gfortran-4.0.0. The last four tests failed for both configuration.
I am also thinking of fixing these errors. It is easy to fix str(exp:exp)
and str(:), but I am not sure how to fix str(:exp) and str(exp:) yet. Any
hints/tips on this? TIA.
2005-06-22 Wu Zhou <woodzltc@cn.ibm.com>
* gdb.fortran/substring.f: New file.
* gdb.fortran/substring.exp: New testcase.
*** /dev/null 2005-06-19 07:34:09.109204120 +0800
--- gdb.fortran/substring.f 2005-06-21 02:28:32.000000000 +0800
***************
*** 0 ****
--- 1,31 ----
+ c Copyright 2005 Free Software Foundation, Inc.
+
+ c This program is free software; you can redistribute it and/or modify
+ c it under the terms of the GNU General Public License as published by
+ c the Free Software Foundation; either version 2 of the License, or
+ c (at your option) any later version.
+ c
+ c This program is distributed in the hope that it will be useful,
+ c but WITHOUT ANY WARRANTY; without even the implied warranty of
+ c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ c GNU General Public License for more details.
+ c
+ c You should have received a copy of the GNU General Public License
+ c along with this program; if not, write to the Free Software
+ c Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ c Ihis file is the Fortran source file for substring.exp. It was written
+ c by Wu Zhou. (woodzltc@cn.ibm.com)
+
+ PROGRAM substring
+
+ character *26 str
+
+ str = 'abcdefghijklmnopqrstuvwxyz'
+
+ write (*, *) str(1:7)
+ write (*, *) str(:7)
+ write (*, *) str(20:)
+ write (*, *) str(:)
+
+ END PROGRAM
*** /dev/null 2005-06-19 07:34:09.109204120 +0800
--- gdb.fortran/substring.exp 2005-06-22 10:32:41.000000000 +0800
***************
*** 0 ****
--- 1,60 ----
+ # Copyright 2005 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.
+
+ # This file was written by Wu Zhou. (woodzltc@cn.ibm.com)
+
+ # This file is part of the gdb testsuite. It contains tests for evaluating
+ # Fortran substring expression
+
+ if $tracelevel then {
+ strace $tracelevel
+ }
+
+ set testfile "substring"
+ set srcfile ${testfile}.f
+ set binfile ${objdir}/${subdir}/${testfile}
+
+ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } {
+ untested "Couldn't compile ${srcfile}"
+ return -1
+ }
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+
+ if ![runto MAIN__] then {
+ perror "couldn't run to breakpoint sub_"
+ continue
+ }
+
+ # Try to set breakpoint at the last write statement.
+
+ set bp_location [gdb_get_line_number "str(:)"]
+ gdb_test "break $bp_location" \
+ "Breakpoint.*at.* file .*$srcfile, line $bp_location\\." \
+ "breakpoint at the last write statement"
+ gdb_test "continue" \
+ "Continuing\\..*Breakpoint.*" \
+ "continue to breakpoint"
+
+ # Test four different kinds of substring expression evaluation.
+
+ gdb_test "print str(1:7)" ".*1 = .*" "print str(1:7)"
+ gdb_test "print str(:7)" ".*2 = .*" "print str(:7)"
+ gdb_test "print str(20:)" ".*3 = .*" "print str(20:)"
+ gdb_test "print str(:)" ".*4 = .*" "print str(:)"
Cheers
- Wu Zhou
next reply other threads:[~2005-06-22 4:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-22 4:02 Wu Zhou [this message]
2005-07-03 18:57 ` Daniel Jacobowitz
2005-07-09 3:12 ` Wu Zhou
2005-07-14 23:46 ` Daniel Jacobowitz
2005-07-15 5:25 ` Wu Zhou
2005-07-15 11:49 ` Wu Zhou
2005-08-01 2:12 ` Daniel Jacobowitz
2005-08-01 4:44 ` Wu Zhou
2005-08-01 6:23 ` Mark Kettenis
2005-08-02 3:10 ` Daniel Jacobowitz
2005-08-02 10:16 ` Wu Zhou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.63.0506221044490.11343@wks190384wss.cn.ibm.com \
--to=woodzltc@cn.ibm.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox