OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.ext/] [namedret2.C] - Diff between revs 305 and 338

Only display areas with differences | Details | Blame | View Log

Rev 305 Rev 338
// { dg-do assemble { target alpha*-*-* } }
// { dg-do assemble { target alpha*-*-* } }
// { dg-options "-Wno-deprecated" }
// { dg-options "-Wno-deprecated" }
// This test verifies that return type promotion is working correctly.
// This test verifies that return type promotion is working correctly.
// The Alpha ABI specifies that 32-bit return values have bit 31 propagated,
// The Alpha ABI specifies that 32-bit return values have bit 31 propagated,
// i.e. the value is sign-extended even if the unpromoted type is unsigned.
// i.e. the value is sign-extended even if the unpromoted type is unsigned.
unsigned int f(unsigned int x) return y(x) { } // { dg-error "" }
unsigned int f(unsigned int x) return y(x) { } // { dg-error "" }
extern "C" void abort ();
extern "C" void abort ();
int main()
int main()
{
{
  typedef long (*long_func)(long);
  typedef long (*long_func)(long);
  long_func g = reinterpret_cast(f);
  long_func g = reinterpret_cast(f);
  if (g(-1L) != -1L)
  if (g(-1L) != -1L)
    abort ();
    abort ();
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.