From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22443 invoked by alias); 22 Jun 2005 01:55:39 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 21830 invoked by uid 22791); 22 Jun 2005 01:55:30 -0000 Received: from web15601.mail.cnb.yahoo.com (HELO web15601.mail.cnb.yahoo.com) (202.165.102.55) by sourceware.org (qpsmtpd/0.30-dev) with SMTP; Wed, 22 Jun 2005 01:55:30 +0000 Received: (qmail 45603 invoked by uid 60001); 22 Jun 2005 01:55:23 -0000 Message-ID: <20050622015523.45601.qmail@web15601.mail.cnb.yahoo.com> Received: from [220.192.154.41] by web15601.mail.cnb.yahoo.com via HTTP; Wed, 22 Jun 2005 09:55:23 CST Date: Wed, 22 Jun 2005 01:55:00 -0000 From: Feng Wang Subject: Re: How to write testcase with two warnings on one line? To: "Joseph S. Myers" Cc: fortran@gcc.gnu.org, gcc@gcc.gnu.org, rasky@develer.com In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: 8bit X-SW-Source: 2005-06/txt/msg00961.txt.bz2 --- "Joseph S. Myers" дµÀ: > On Tue, 21 Jun 2005, Feng Wang wrote: > > > Hi, > > > > I want to write a testcase. The compiler gives two separated warnings on > one > > statement. How to write this with Dejagnu? > > > > I tried: > > { dg-warning "Warning1" "Warning2" } > > and > > { dg-warning "Warning1" 8} > > { dg-warning "Warning2" 8} > > 8 is the line number of the statment. > > The correct way of writing warning tests with a line number is > > { dg-warning "warning" } (on original line, no number needed) > { dg-warning "warning 2" "description" { target *-*-* } 8 } (for each > other warning) > > The description is needed and needs to be nonempty and distinct for the > second and subsequent warnings on a given line, because it is used to form > the distinct test assertion names which appear after PASS or FAIL in the > .sum files - having multiple tests with the same name causes ambiguity for > regression testers. > This is ok. Thanks. And add one point, { target *-*-* } is also needed even we test on all target. If we give the line number, the target is needed. This is not mentioned in http://gcc.gnu.org/wiki/HowToPrepareATestcase . Maybe the page need updating. Best Regards, Feng Wang -- Creative Compiler Research Group, National University of Defense Technology, China. ___________________________________________________________ ÑÅ»¢Ãâ·ÑGÓÊÏ䣭ÖйúµÚÒ»¾øÎÞÀ¬»øÓʼþɧÈų¬´óÓÊÏä http://cn.mail.yahoo.com/?id=77071