From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14610 invoked by alias); 20 Jun 2005 04:00:01 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 14537 invoked by uid 22791); 20 Jun 2005 03:59:58 -0000 Received: from ausmtp02.au.ibm.com (HELO ausmtp02.au.ibm.com) (202.81.18.187) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 20 Jun 2005 03:59:58 +0000 Received: from sd0208e0.au.ibm.com (d23rh904.au.ibm.com [202.81.18.202]) by ausmtp02.au.ibm.com (8.12.10/8.12.10) with ESMTP id j5K3tNHP093562 for ; Mon, 20 Jun 2005 13:55:24 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.250.237]) by sd0208e0.au.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j5K42fxI109662 for ; Mon, 20 Jun 2005 14:02:41 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.12.11/8.13.3) with ESMTP id j5K3xl4V012558 for ; Mon, 20 Jun 2005 13:59:47 +1000 Received: from wks190384wss.cn.ibm.com (wks190384wss.cn.ibm.com [9.181.134.93]) by d23av04.au.ibm.com (8.12.11/8.12.11) with ESMTP id j5K3xiPH012406; Mon, 20 Jun 2005 13:59:45 +1000 Date: Mon, 20 Jun 2005 04:00:00 -0000 From: Wu Zhou To: Daniel Jacobowitz cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] Add code to support evaluating Fortran exponentiation expression In-Reply-To: <20050617134139.GC23901@nevyn.them.org> Message-ID: References: <20050617134139.GC23901@nevyn.them.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2005-06/txt/msg00313.txt.bz2 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 > > > > * 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 * 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