Patchwork [testsuite] : Adjust some tests for mingw targets

login
register
mail settings
Submitter Kai Tietz
Date March 1, 2012, 12:49 p.m.
Message ID <CAEwic4Z=p_OqLqiKurgBjNhjP7x+XP00_Hdy8n47PWC1_04KLg@mail.gmail.com>
Download mbox | patch
Permalink /patch/143998/
State New
Headers show

Comments

Kai Tietz - March 1, 2012, 12:49 p.m.
Hi,

this test adjust some test for mingw targets.

ChangeLog

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.
	* gcc.dg/format/dfp-scanf-1.c: Adjust dg-skip-if rule
	for mingw targets.

Ok for apply?

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

> this test adjust some test for mingw targets.

would you please fix you mailer not to break long lines?  It makes
reviewing harder.

> Index: gcc.dg/vect/pr46126.c
> ===================================================================
> --- gcc.dg/vect/pr46126.c	(revision 184657)
> +++ gcc.dg/vect/pr46126.c	(working copy)
> @@ -1,5 +1,7 @@
>  /* { dg-do compile } */
>
> +__extension__ typedef __SIZE_TYPE__ size_t;

I think you should use __UINTPTR_TYPE__/uintptr_t instead.

> Index: gcc.dg/format/dfp-scanf-1.c
> ===================================================================
> --- gcc.dg/format/dfp-scanf-1.c	(revision 184657)
> +++ gcc.dg/format/dfp-scanf-1.c	(working copy)
> @@ -3,7 +3,7 @@
>  /* { dg-do compile } */
>  /* { dg-require-effective-target dfp } */
>  /* { dg-options "-Wformat" } */
> -/* { dg-skip-if "No scanf/printf dfp support" { *-*-mingw* } } */
> +/* { dg-skip-if "No scanf/printf dfp support" { *-*-mingw* } { "*" }
> { "" } } */


What's the point of this change?  Why are you explicitly adding the
defaults?

	Rainer
Kai Tietz - March 1, 2012, 1:32 p.m.
2012/3/1 Rainer Orth <ro@cebitec.uni-bielefeld.de>:
> Kai Tietz <ktietz70@googlemail.com> writes:
>
>> this test adjust some test for mingw targets.
>
> would you please fix you mailer not to break long lines?  It makes
> reviewing harder.
>
>> Index: gcc.dg/vect/pr46126.c
>> ===================================================================
>> --- gcc.dg/vect/pr46126.c     (revision 184657)
>> +++ gcc.dg/vect/pr46126.c     (working copy)
>> @@ -1,5 +1,7 @@
>>  /* { dg-do compile } */
>>
>> +__extension__ typedef __SIZE_TYPE__ size_t;
>
> I think you should use __UINTPTR_TYPE__/uintptr_t instead.

Ok, but in fact it makes for this testcase no difference.

>> Index: gcc.dg/format/dfp-scanf-1.c
>> ===================================================================
>> --- gcc.dg/format/dfp-scanf-1.c       (revision 184657)
>> +++ gcc.dg/format/dfp-scanf-1.c       (working copy)
>> @@ -3,7 +3,7 @@
>>  /* { dg-do compile } */
>>  /* { dg-require-effective-target dfp } */
>>  /* { dg-options "-Wformat" } */
>> -/* { dg-skip-if "No scanf/printf dfp support" { *-*-mingw* } } */
>> +/* { dg-skip-if "No scanf/printf dfp support" { *-*-mingw* } { "*" }
>> { "" } } */
>
>
> What's the point of this change?  Why are you explicitly adding the
> defaults?

I made bad expierence by omitting those defaults.  Actual a different
testcase, which also omitted those defaults, were still ran instead of
being skipped.
In most places over testsuite the defaults are specified, too.

>        Rainer

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

>>> Index: gcc.dg/vect/pr46126.c
>>> ===================================================================
>>> --- gcc.dg/vect/pr46126.c     (revision 184657)
>>> +++ gcc.dg/vect/pr46126.c     (working copy)
>>> @@ -1,5 +1,7 @@
>>>  /* { dg-do compile } */
>>>
>>> +__extension__ typedef __SIZE_TYPE__ size_t;
>>
>> I think you should use __UINTPTR_TYPE__/uintptr_t instead.
>
> Ok, but in fact it makes for this testcase no difference.

Maybe, but it's the correct thing to do IMO.

>>> Index: gcc.dg/format/dfp-scanf-1.c
>>> ===================================================================
>>> --- gcc.dg/format/dfp-scanf-1.c       (revision 184657)
>>> +++ gcc.dg/format/dfp-scanf-1.c       (working copy)
>>> @@ -3,7 +3,7 @@
>>>  /* { dg-do compile } */
>>>  /* { dg-require-effective-target dfp } */
>>>  /* { dg-options "-Wformat" } */
>>> -/* { dg-skip-if "No scanf/printf dfp support" { *-*-mingw* } } */
>>> +/* { dg-skip-if "No scanf/printf dfp support" { *-*-mingw* } { "*" }
>>> { "" } } */
>>
>>
>> What's the point of this change?  Why are you explicitly adding the
>> defaults?
>
> I made bad expierence by omitting those defaults.  Actual a different
> testcase, which also omitted those defaults, were still ran instead of
> being skipped.

Please don't make such a change willy-nilly (especially this late in the
4.7 release cycle) unless there's a concrete reason to do so, and
describe the problem/file a PR if you encounter it.

> In most places over testsuite the defaults are specified, too.

True for older testcases, before it was possible to omit the defaults.
No one went over the testsuite to clean things up so far ;-(  That's
absolutely no reason to add this now, though.

	Rainer

Patch

Index: gcc.dg/torture/pr47917.c
===================================================================
--- gcc.dg/torture/pr47917.c	(revision 184657)
+++ 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 184657)
+++ gcc.dg/vect/pr46126.c	(working copy)
@@ -1,5 +1,7 @@ 
 /* { dg-do compile } */

+__extension__ typedef __SIZE_TYPE__ size_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 = ((size_t)(((TypHandle*)((hdCall)->ptr))[1])&1 ?
 (((TypHandle*)((hdCall)->ptr))[1]) : (*
-EvTab[(((long)(((TypHandle*)((hdCall)->ptr))[1]) & 1) ? 1 :
+EvTab[(((size_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) (size_t) (((long)(lp) << 2) + 1));
+     ptApp[2] = ((TypHandle) (size_t) (((long)(lc) << 2) + 1));
  }

 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: gcc.dg/format/dfp-scanf-1.c
===================================================================
--- gcc.dg/format/dfp-scanf-1.c	(revision 184657)
+++ gcc.dg/format/dfp-scanf-1.c	(working copy)
@@ -3,7 +3,7 @@ 
 /* { dg-do compile } */
 /* { dg-require-effective-target dfp } */
 /* { dg-options "-Wformat" } */
-/* { dg-skip-if "No scanf/printf dfp support" { *-*-mingw* } } */
+/* { dg-skip-if "No scanf/printf dfp support" { *-*-mingw* } { "*" }
{ "" } } */

 #include "format.h"