OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.ext/] [namedret2.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do assemble { target alpha*-*-* } }
2
// { dg-options "-Wno-deprecated" }
3
 
4
// This test verifies that return type promotion is working correctly.
5
// The Alpha ABI specifies that 32-bit return values have bit 31 propagated,
6
// i.e. the value is sign-extended even if the unpromoted type is unsigned.
7
 
8
unsigned int f(unsigned int x) return y(x) { } // { dg-error "" }
9
 
10
extern "C" void abort ();
11
 
12
int main()
13
{
14
  typedef long (*long_func)(long);
15
  long_func g = reinterpret_cast(f);
16
 
17
  if (g(-1L) != -1L)
18
    abort ();
19
  return 0;
20
}

powered by: WebSVN 2.1.0

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