Patchwork [testsuite] : Adjust some tests for mingw targets

login
register
mail settings
Submitter Kai Tietz
Date March 1, 2012, 2:11 p.m.
Message ID <CAEwic4bv4qQhjefun4yAbbiruSPkc6nP6KwujR6L7RciG0+wCA@mail.gmail.com>
Download mbox | patch
Permalink /patch/144019/
State New
Headers show

Comments

Kai Tietz - March 1, 2012, 2:11 p.m.
So updated patch (sorry the gmail-mailer breaks lines up here, and I
can't configure it for not doing so.  So I attached patch, too).

2012-03-01  Kai Tietz  <ktietz@redhat.com>

	* gcc.dg/torture/pr47917.c: Make test using POSIX-printf
	routines on mingw targets.
	* gcc.dg/vect/pr46126.c (size_t): Add support for
	LLP64 target.

Ok for apply?

Regards,
Kai
2012-03-01  Kai Tietz  <ktietz@redhat.com>

	* gcc.dg/torture/pr47917.c: Make test using POSIX-printf
	routines on mingw targets.
	* gcc.dg/vect/pr46126.c (size_t): Add support for
	LLP64 target.

Index: gcc.dg/torture/pr47917.c
===================================================================
--- gcc.dg/torture/pr47917.c	(revision 184742)
+++ gcc.dg/torture/pr47917.c	(working copy)
@@ -3,6 +3,7 @@
 /* { dg-options "-std=c99 -D_ISO_C_SOURCE=19990L" { target alpha*-dec-osf5* } } */
 /* { dg-options "-std=c99 -D_XOPEN_SOURCE=500" { target mips-sgi-irix6.5 *-*-solaris2.[89] } } */
 /* { dg-options "-std=gnu99" { target *-*-hpux* } } */
+/* { dg-additional-options "-D__USE_MINGW_ANSI_STDIO=1" { target *-*-mingw* } } */
 /* { dg-xfail-if "no C99 snprintf function" { *-*-hpux10* } } */
 /* { dg-xfail-run-if "non-conforming C99 snprintf" { *-*-hpux11.[012]* } } */
 
Index: gcc.dg/vect/pr46126.c
===================================================================
--- gcc.dg/vect/pr46126.c	(revision 184742)
+++ gcc.dg/vect/pr46126.c	(working copy)
@@ -1,5 +1,7 @@
 /* { dg-do compile } */
 
+__extension__ typedef __UINTPTR_TYPE__ uintptr_t;
+
 typedef struct TypHeader {
      struct TypHeader * * ptr;
      unsigned char type;
@@ -11,13 +13,13 @@
      TypHandle * ptApp;
      long lp;
      long lc;
-     hdApp = ((long)(((TypHandle*)((hdCall)->ptr))[1])&1 ?
+     hdApp = ((uintptr_t)(((TypHandle*)((hdCall)->ptr))[1])&1 ?
 (((TypHandle*)((hdCall)->ptr))[1]) : (*
-EvTab[(((long)(((TypHandle*)((hdCall)->ptr))[1]) & 1) ? 1 :
+EvTab[(((uintptr_t)(((TypHandle*)((hdCall)->ptr))[1]) & 1) ? 1 :
 ((((TypHandle*)((hdCall)->ptr))[1])->type))])((((TypHandle*)((hdCall)->ptr))[1])));
      ptApp = ((TypHandle*)((hdApp)->ptr));
-     ptApp[1] = ((TypHandle) (((long)(lp) << 2) + 1));
-     ptApp[2] = ((TypHandle) (((long)(lc) << 2) + 1));
+     ptApp[1] = ((TypHandle) (uintptr_t) (((long)(lp) << 2) + 1));
+     ptApp[2] = ((TypHandle) (uintptr_t) (((long)(lc) << 2) + 1));
  }
 
 /* { dg-final { cleanup-tree-dump "vect" } } */
Rainer Orth - March 1, 2012, 5:52 p.m.
Kai Tietz <ktietz70@googlemail.com> writes:

> So updated patch (sorry the gmail-mailer breaks lines up here, and I
> can't configure it for not doing so.  So I attached patch, too).

Ok.  In the future, please indicate on which platforms and how you
tested the patch.  mingw and x86_64-linux, I assume?

> 2012-03-01  Kai Tietz  <ktietz@redhat.com>
>
> 	* gcc.dg/torture/pr47917.c: Make test using POSIX-printf
> 	routines on mingw targets.
> 	* gcc.dg/vect/pr46126.c (size_t): Add support for

Please update for the uintptr_t change.

> 	LLP64 target.
>
> Ok for apply?

Ok with that change, provided appropriate testing.

Thanks.
	Rainer
Kai Tietz - March 1, 2012, 6:12 p.m.
2012/3/1 Rainer Orth <ro@cebitec.uni-bielefeld.de>:
> Kai Tietz <ktietz70@googlemail.com> writes:
>
>> So updated patch (sorry the gmail-mailer breaks lines up here, and I
>> can't configure it for not doing so.  So I attached patch, too).
>
> Ok.  In the future, please indicate on which platforms and how you
> tested the patch.  mingw and x86_64-linux, I assume?
>
>> 2012-03-01  Kai Tietz  <ktietz@redhat.com>
>>
>>       * gcc.dg/torture/pr47917.c: Make test using POSIX-printf
>>       routines on mingw targets.
>>       * gcc.dg/vect/pr46126.c (size_t): Add support for
>
> Please update for the uintptr_t change.
>
>>       LLP64 target.
>>
>> Ok for apply?
>
> Ok with that change, provided appropriate testing.
>
> Thanks.
>        Rainer

Of course I tested changes.  I actual did it for i686-w64-mingw32,
x86_64-w64-mingw32, and also for x86_64-unknown-linux-gnu.

Thanks,
Kai
Rainer Orth - March 1, 2012, 6:37 p.m.
Kai Tietz <ktietz70@googlemail.com> writes:

>>> 2012-03-01  Kai Tietz  <ktietz@redhat.com>
>>>
>>>       * gcc.dg/torture/pr47917.c: Make test using POSIX-printf
>>>       routines on mingw targets.
>>>       * gcc.dg/vect/pr46126.c (size_t): Add support for
>>
>> Please update for the uintptr_t change.

Would you please fix up the ChangeLog as requested?

> Of course I tested changes.  I actual did it for i686-w64-mingw32,
> x86_64-w64-mingw32, and also for x86_64-unknown-linux-gnu.

I never assumed otherwise, but you should state that in your
submissions.

	Rainer

Patch

Index: gcc.dg/torture/pr47917.c
===================================================================
--- gcc.dg/torture/pr47917.c	(revision 184742)
+++ gcc.dg/torture/pr47917.c	(working copy)
@@ -3,6 +3,7 @@ 
 /* { dg-options "-std=c99 -D_ISO_C_SOURCE=19990L" { target
alpha*-dec-osf5* } } */
 /* { dg-options "-std=c99 -D_XOPEN_SOURCE=500" { target
mips-sgi-irix6.5 *-*-solaris2.[89] } } */
 /* { dg-options "-std=gnu99" { target *-*-hpux* } } */
+/* { dg-additional-options "-D__USE_MINGW_ANSI_STDIO=1" { target
*-*-mingw* } } */
 /* { dg-xfail-if "no C99 snprintf function" { *-*-hpux10* } } */
 /* { dg-xfail-run-if "non-conforming C99 snprintf" { *-*-hpux11.[012]* } } */

Index: gcc.dg/vect/pr46126.c
===================================================================
--- gcc.dg/vect/pr46126.c	(revision 184742)
+++ gcc.dg/vect/pr46126.c	(working copy)
@@ -1,5 +1,7 @@ 
 /* { dg-do compile } */

+__extension__ typedef __UINTPTR_TYPE__ uintptr_t;
+
 typedef struct TypHeader {
      struct TypHeader * * ptr;
      unsigned char type;
@@ -11,13 +13,13 @@ 
      TypHandle * ptApp;
      long lp;
      long lc;
-     hdApp = ((long)(((TypHandle*)((hdCall)->ptr))[1])&1 ?
+     hdApp = ((uintptr_t)(((TypHandle*)((hdCall)->ptr))[1])&1 ?
 (((TypHandle*)((hdCall)->ptr))[1]) : (*
-EvTab[(((long)(((TypHandle*)((hdCall)->ptr))[1]) & 1) ? 1 :
+EvTab[(((uintptr_t)(((TypHandle*)((hdCall)->ptr))[1]) & 1) ? 1 :
 ((((TypHandle*)((hdCall)->ptr))[1])->type))])((((TypHandle*)((hdCall)->ptr))[1])));
      ptApp = ((TypHandle*)((hdApp)->ptr));
-     ptApp[1] = ((TypHandle) (((long)(lp) << 2) + 1));
-     ptApp[2] = ((TypHandle) (((long)(lc) << 2) + 1));
+     ptApp[1] = ((TypHandle) (uintptr_t) (((long)(lp) << 2) + 1));
+     ptApp[2] = ((TypHandle) (uintptr_t) (((long)(lc) << 2) + 1));
  }

 /* { dg-final { cleanup-tree-dump "vect" } } */