This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] New testcase for PR c/7128
- From: Roger Sayle <roger at eyesopen dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Cc: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Thu, 7 Nov 2002 22:11:06 -0700 (MST)
- Subject: [PATCH] New testcase for PR c/7128
On Mon, 4 Nov 2002, Joseph S. Myers wrote:
> > 2002-11-03 Roger Sayle <roger@eyesopen.com>
> >
> > PR c/7128
> > * c-typeck.c (c_expand_asm_operands): Defend against
> > error_mark_nodes in argument "output" to avoid ICE.
>
> Testcase for testsuite?
Sorry for the delay (Rosemary Elizabeth Sayle was born 2:08pm
on Tuesday November 5th, 6lbs 15oz :>).
The following patch adds a testcase for the recently fixed GNATS
PR c/7128. I've tested that this PASSes with current mainline
on i686-pc-linux-gnu but FAILs without my recent patch. Interestingly
this is only the second testcase to check for an undeclared identifier.
I've also checked that the __asm__ is portable by failing to compile
on alpha/Tru64, sparc/Solaris and parisc/HPUX.
Ok for mainline?
2002-11-07 Roger Sayle <roger@eyesopen.com>
* gcc.dg/20021107-1.c: New testcase for PR c/7128.
*** /dev/null Thu Aug 30 14:30:55 2001
--- gcc.dg/20021107-1.c Mon Nov 4 14:15:06 2002
***************
*** 0 ****
--- 1,15 ----
+ /* Copyright (C) 2002 Free Software Foundation.
+
+ Test for PR c/7128, ICE on invalid code in c_expand_asm_operands.
+
+ Extracted from GNAT PR by Roger Sayle, 4th November 2002. */
+
+ /* { dg-do compile } */
+
+ void foo ()
+ {
+ __asm__ ("foo %0" : "=r" (r));
+ /* { dg-error "undeclared" "undeclared" { target *-*-* } { 11 } } */
+ /* { dg-error "each function it appears" "" { target *-*-* } { 11 } } */
+ }
+
Roger
--
Roger Sayle, E-mail: roger@eyesopen.com
OpenEye Scientific Software, WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road, Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507. Fax: (+1) 505-473-0833