===================================================================
@@ -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* } } }
===================================================================
@@ -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;
===================================================================
@@ -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);
}