devirt2.C: Add rule for *-*-mingw* target.

* 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

From-SVN: r184490
This commit is contained in:
Kai Tietz 2012-02-22 20:38:30 +01:00 committed by Kai Tietz
parent 9517e33332
commit b1c982db4b
4 changed files with 17 additions and 3 deletions

View File

@ -1,3 +1,10 @@
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

View File

@ -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* } } }

View File

@ -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;

View File

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