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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [pr37870.c] - Rev 724

Go to most recent revision | Compare with Previous | Blame | View Log

/* PR middle-end/37870 */
/* { dg-do run } */
/* { dg-options "-O2" } */
 
unsigned int
foo (long double x)
{
  struct { char a[8]; unsigned int b:7; } c;
  __builtin_memcpy (&c, &x, sizeof (c));
  return c.b;
}
 
unsigned int
bar (long double x)
{
  union { struct { char a[8]; unsigned int b:7; } c; long double d; } u;
  u.d = x;
  return u.c.b;
}
 
int
main (void)
{
  if (foo (1.245L) != bar (1.245L)
      || foo (245.67L) != bar (245.67L)
      || foo (0.00567L) != bar (0.00567L))
    __builtin_abort ();
  return 0;
}
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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