This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch testsuite/g++.dg]: Adjust some tests for *-*-mingw* targets


Hi,

this patch fixes some failures running the g++ testsuite for Windows
native targets.

ChangeLog

2012-02-22  Kai Tietz  <ktietz@redhat.com>

	* g++.dg/opt/devirt2.C: Add rule for *-*-mingw* target.
	* opt/pr48549.C	(long): Replace by long by __PTRDIFF_TYPE__
	derived pdiff_t type.
	* g++.dg/torture/pr49720.C: Likewise

Tested for i686-w64-mingw32, x86_64-w64-mingw32, and for
x86_64-unknown-linux-gnu.  Ok for apply?

Regards,
Kai

Index: g++.dg/opt/devirt2.C
===================================================================
--- g++.dg/opt/devirt2.C	(revision 184483)
+++ g++.dg/opt/devirt2.C	(working copy)
@@ -5,7 +5,9 @@
 // { dg-additional-options "-mshort-calls" {target epiphany-*-*} }
 // Using -mno-abicalls avoids a R_MIPS_JALR .reloc.
 // { dg-additional-options "-mno-abicalls" { target mips*-*-* } }
-// { dg-final { scan-assembler-times "xyzzy" 2 { target { ! {
alpha*-*-* hppa*-*-* ia64*-*-hpux* sparc*-*-* } } } } }
+// { dg-final { scan-assembler-times "xyzzy" 2 { target { ! {
alpha*-*-* hppa*-*-* ia64*-*-hpux* sparc*-*-* *-*-mingw* } } } } }
+// For *-*-mingw* there is additionally one .def match
+// { dg-final { scan-assembler-times "xyzzy" 3 { target *-*-mingw* } } }
 // The IA64 and HPPA compilers generate external declarations in addition
 // to the call so those scans need to be more specific.
 // { dg-final { scan-assembler-times "br\[^\n\]*xyzzy" 2 { target
ia64*-*-hpux* } } }
Index: g++.dg/opt/pr48549.C
===================================================================
--- g++.dg/opt/pr48549.C	(revision 184483)
+++ g++.dg/opt/pr48549.C	(working copy)
@@ -2,10 +2,13 @@
 // { dg-do compile }
 // { dg-options "-fcompare-debug -O2" }

+__extension__ typedef __PTRDIFF_TYPE__ pdiff_t;
+
 void
 foo (void *from, void *to)
 {
-  long offset = reinterpret_cast <long>(to) - reinterpret_cast <long>(from);
+  pdiff_t offset = reinterpret_cast <pdiff_t>(to)
+		   - reinterpret_cast <pdiff_t>(from);
   if (offset != static_cast <int>(offset))
     *(int *) 0xC0DE = 0;
   reinterpret_cast <int *>(from)[1] = offset;
Index: g++.dg/torture/pr49720.C
===================================================================
--- g++.dg/torture/pr49720.C	(revision 184483)
+++ g++.dg/torture/pr49720.C	(working copy)
@@ -1,8 +1,10 @@
 /* { dg-do compile } */

+__extension__ typedef __PTRDIFF_TYPE__ pdiff_t;
+
 extern char t_start[], t_end[], t_size[];
 bool foo (void)
 {
-  long size = reinterpret_cast<long>(t_size);
+  pdiff_t size = reinterpret_cast<pdiff_t>(t_size);
   return (size == t_end - t_start);
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]