public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH,testsuite] Mark builtin_return-1 test XFAIL on AVR target.
@ 2008-06-18  2:22 Andy H
  2008-06-18 14:11 ` Janis Johnson
  0 siblings, 1 reply; 2+ messages in thread
From: Andy H @ 2008-06-18  2:22 UTC (permalink / raw)
  To: gcc-patches, janis187

[-- Attachment #1: Type: text/plain, Size: 639 bytes --]

Test gcc.dg/builtin-return-1.c  will fail for AVRtarget.

Default implementation of untyped return is a single register. Which for 
AVR is just a byte, not int as test expects.
So high byte may get overwritten before return.

I have marked as XFAIL until either test considers return value limit 
(unlikely and awkward) - or a complete untyped return is added for AVR.

Also added missing prototype for exit() to prevent warning.

Test on i686 and AVR target.

Ok for 4.4 mainline?



2008-06-17  Andy Hutchinson   <hutchinsonandy@aim.com>

  * gcc/testsuite/gcc.dg/builtin-return-1.c: Mark as xfail on AVR 
target. Add exit  prototype.



[-- Attachment #2: return.patch --]
[-- Type: text/plain, Size: 740 bytes --]

Index: gcc/testsuite/gcc.dg/builtin-return-1.c
===================================================================
--- gcc/testsuite/gcc.dg/builtin-return-1.c	(revision 136775)
+++ gcc/testsuite/gcc.dg/builtin-return-1.c	(working copy)
@@ -1,11 +1,12 @@
 /* PR middle-end/11151 */
 /* Originator: Andrew Church <gcczilla@achurch.org> */
 /* { dg-do run } */
-
+/* { dg-xfail-run-if "avr default untyped return is char register" { "avr-*-*" } { "*" } { "" } } */
 /* This used to fail on SPARC because the (undefined) return
    value of 'bar' was overwriting that of 'foo'.  */
 
 extern void abort(void);
+extern void exit(int);
 
 int foo(int n)
 {
@@ -29,6 +30,6 @@
 
   if (bar(1) != 2)
     abort();
-
+	exit(0);
   return 0;
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH,testsuite] Mark builtin_return-1 test XFAIL on AVR  target.
  2008-06-18  2:22 [PATCH,testsuite] Mark builtin_return-1 test XFAIL on AVR target Andy H
@ 2008-06-18 14:11 ` Janis Johnson
  0 siblings, 0 replies; 2+ messages in thread
From: Janis Johnson @ 2008-06-18 14:11 UTC (permalink / raw)
  To: Andy H; +Cc: gcc-patches

On Tue, 2008-06-17 at 21:53 -0400, Andy H wrote:
> Test gcc.dg/builtin-return-1.c  will fail for AVRtarget.
> 
> Default implementation of untyped return is a single register. Which for 
> AVR is just a byte, not int as test expects.
> So high byte may get overwritten before return.
> 
> I have marked as XFAIL until either test considers return value limit 
> (unlikely and awkward) - or a complete untyped return is added for AVR.
> 
> Also added missing prototype for exit() to prevent warning.
> 
> Test on i686 and AVR target.
> 
> Ok for 4.4 mainline?
> 
> 
> 
> 2008-06-17  Andy Hutchinson   <hutchinsonandy@aim.com>
> 
>   * gcc/testsuite/gcc.dg/builtin-return-1.c: Mark as xfail on AVR 
> target. Add exit  prototype.

An XFAIL must reference a problem report.  That's not true of all
of them in the testsuite, but should be so we can keep track of
them.  Please open a PR and reference it in the test.

Janis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-06-18 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-18  2:22 [PATCH,testsuite] Mark builtin_return-1 test XFAIL on AVR target Andy H
2008-06-18 14:11 ` Janis Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).