> This patch moves gcc.c-torture/execute/pr47917.c to
> gcc.dg/torture/pr47917.c so that I can use dg-* directives in the test
> and then adds xfails for HP-UX.  On HP-UX 10.* there is no snprintf

The new gcc.dg/torture/pr47917.c lacks some code.

> Dave, can you verify this fix on HP-UX 10.*?  I don't have any HP-UX
> 10.* systems anymore.  Tested on IA64 and PA HP-UX 11.11 and 11.23.

This will take some time.  I would just go ahead without this check
if moving the test is ok.

> 2011-03-23  Steve Ellcey  <s...@cup.hp.com>
> 
>       PR target/48209
>       * gcc.c-torture/execute/pr47917.c: Move this...
>       * gcc.dg/torture/pr47917.c: to here and add xfails.
> 
> Index: gcc.c-torture/execute/pr47917.c
> ===================================================================
> --- gcc.c-torture/execute/pr47917.c   (revision 171338)
> +++ gcc.c-torture/execute/pr47917.c   (working copy)
> @@ -1,32 +0,0 @@
> -/* PR middle-end/47917 */
> -
> -extern int snprintf (char *, __SIZE_TYPE__, const char *, ...);
> -extern int memcmp (const void *, const void *, __SIZE_TYPE__);
> -extern void abort (void);
> -
> -char buf1[6], buf2[6], buf3[4], buf4[4];
> -int i;
> -
> -int
> -foo (void)
> -{
> -  int ret = snprintf (buf1, sizeof buf1, "abcde");
> -  ret += snprintf (buf2, sizeof buf2, "abcdef") * 16;
> -  ret += snprintf (buf3, sizeof buf3, "%s", i++ < 6 ? "abc" : "def") * 256;
> -  ret += snprintf (buf4, sizeof buf4, "%s", i++ > 10 ? "abcde" : "defgh") * 
> 4096;
> -  return ret;
> -}
> -
> -int
> -main (void)
> -{
> -  if (foo () != 5 + 6 * 16 + 3 * 256 + 5 * 4096)
> -    abort ();
> -  if (memcmp (buf1, "abcde", 6) != 0
> -      || memcmp (buf2, "abcde", 6) != 0
> -      || memcmp (buf3, "abc", 4) != 0
> -      || memcmp (buf4, "def", 4) != 0
> -      || i != 2)
> -    abort ();
> -  return 0;
> -}
> Index: gcc.dg/torture/pr47917.c
> ===================================================================
> --- gcc.dg/torture/pr47917.c  (revision 171278)
> +++ gcc.dg/torture/pr47917.c  (working copy)
> @@ -1,3 +1,8 @@
> +/* { dg-do run } */
> +/* { dg-options "-std=c99" } */
> +/* { dg-xfail-if "no C99 snprintf function" { *-*-hpux10* } } */
> +/* { dg-xfail-run-if "non-conforming C99 snprintf" { *-*-hpux11.[012]* } } */
> +
>  /* PR middle-end/47917 */
>  
>  extern int snprintf (char *, __SIZE_TYPE__, const char *, ...);
> 

Dave
-- 
J. David Anglin                                  dave.ang...@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

Reply via email to