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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [struct-ret-2.c] - Diff between revs 297 and 338

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

Rev 297 Rev 338
typedef struct
typedef struct
{
{
  unsigned char a __attribute__ ((packed));
  unsigned char a __attribute__ ((packed));
  unsigned short b __attribute__ ((packed));
  unsigned short b __attribute__ ((packed));
} three_byte_t;
} three_byte_t;
 
 
unsigned char
unsigned char
f (void)
f (void)
{
{
  return 0xab;
  return 0xab;
}
}
 
 
unsigned short
unsigned short
g (void)
g (void)
{
{
  return 0x1234;
  return 0x1234;
}
}
 
 
main ()
main ()
{
{
  three_byte_t three_byte;
  three_byte_t three_byte;
 
 
  three_byte.a = f ();
  three_byte.a = f ();
  three_byte.b = g ();
  three_byte.b = g ();
  if (three_byte.a != 0xab || three_byte.b != 0x1234)
  if (three_byte.a != 0xab || three_byte.b != 0x1234)
    abort ();
    abort ();
  exit (0);
  exit (0);
}
}
 
 
 
 

powered by: WebSVN 2.1.0

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