* g++.dg/opt/pr48549.C (long): Replace by long by __PTRDIFF_TYPE__
derived pdiff_t type.
* g++.dg/torture/pr49720.C: Likewise
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184490
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-02-22 Kai Tietz <ktietz@redhat.com>
+
+ * g++.dg/opt/devirt2.C: Add rule for *-*-mingw* target.
+ * g++.dg/opt/pr48549.C (long): Replace by long by __PTRDIFF_TYPE__
+ derived pdiff_t type.
+ * g++.dg/torture/pr49720.C: Likewise
+
2012-02-22 Uros Bizjak <ubizjak@gmail.com>
PR target/52330
// { 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* } } }
// { 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;
/* { 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);
}