From: Wu Zhou <woodzltc@cn.ibm.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC] Add code to support evaluating Fortran exponentiation expression
Date: Mon, 20 Jun 2005 04:00:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.63.0506201118390.3771@wks190384wss.cn.ibm.com> (raw)
In-Reply-To: <20050617134139.GC23901@nevyn.them.org>
On Fri, 17 Jun 2005, Daniel Jacobowitz wrote:
> On Fri, Jun 17, 2005 at 01:22:26PM +0800, Wu Zhou wrote:
> > 2005-06-17 Wu Zhou <woodzltc@cn.ibm.com>
> >
> > * f-exp.y (yyparse): Add code to support exponentiation expression.
> > (yylex): Add code to scan exponentiation operator.
> > * eval.c (evaluate_subexp_standard): Add support for BINOP_EXP.
> > * valarith.c (value_binop): Reset errno to 0 before calling pow
> > to do exponentiation operation.
>
> This will need a testcase, in addition to documentation. Doing those
> separately is fine. The only other problem is that f-exp.y needs a
> copyright year update: the last listed year is 2001, but I see it has
> been modified in 2002, 2003, and 2004. So please add all of those
> years (plus 2005).
OK. I add five tests in gdb.fortran/exprs.exp (patch is included below).
Without the above patch, all the five tests fail; with it, all pass. OK
to commit? Thanks.
2005-06-20 Wu Zhou <woodzltc@cn.ibm.com>
* gdb.fortran/exprs.exp (test_arithmetic_expressions): Add five
tests to evaluate exponentiation expression.
Index: gdb.fortran/exprs.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.fortran/exprs.exp,v
retrieving revision 1.3
diff -c -p -r1.3 exprs.exp
*** gdb.fortran/exprs.exp 16 Dec 2002 19:33:53 -0000 1.3
--- gdb.fortran/exprs.exp 20 Jun 2005 03:25:02 -0000
*************** proc test_arithmetic_expressions {} {
*** 250,255 ****
--- 250,263 ----
# Test modulo with various operands
+ # Test exponentiation with various operands
+
+ gdb_test "p 2 ** 3" " = 8" "int powered by int"
+ gdb_test "p 2 ** 2 ** 3" " = 256" "combined exponentiation expression"
+ gdb_test "p (2 ** 2) ** 3" " = 64" "combined exponentiation expression in specified order"
+ gdb_test "p 4 ** 0.5" " = 2" "int powered by real"
+ gdb_test "p 4.0 ** 0.5" " = 2" "real powered by real"
+
}
# Start with a fresh gdb.
Cheers
- Wu Zhou
next prev parent reply other threads:[~2005-06-20 4:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-17 7:36 Wu Zhou
2005-06-17 10:17 ` Eli Zaretskii
2005-06-20 3:47 ` Wu Zhou
2005-06-20 19:08 ` Eli Zaretskii
2005-06-21 14:32 ` Wu Zhou
2005-06-21 19:41 ` Eli Zaretskii
2005-06-17 13:41 ` Daniel Jacobowitz
2005-06-20 4:00 ` Wu Zhou [this message]
2005-07-03 17:07 ` Daniel Jacobowitz
2005-07-06 8:55 ` Wu Zhou
2005-06-20 4:14 ` Wu Zhou
2005-07-03 17:05 ` Daniel Jacobowitz
2005-07-06 8:36 ` 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.0506201118390.3771@wks190384wss.cn.ibm.com \
--to=woodzltc@cn.ibm.com \
--cc=drow@false.org \
--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