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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [i386/] [pr37870.c] - Blame information for rev 318

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* PR middle-end/37870 */
2
/* { dg-do run } */
3
/* { dg-options "-O2" } */
4
 
5
unsigned int
6
foo (long double x)
7
{
8
  struct { char a[8]; unsigned int b:7; } c;
9
  __builtin_memcpy (&c, &x, sizeof (c));
10
  return c.b;
11
}
12
 
13
unsigned int
14
bar (long double x)
15
{
16
  union { struct { char a[8]; unsigned int b:7; } c; long double d; } u;
17
  u.d = x;
18
  return u.c.b;
19
}
20
 
21
int
22
main (void)
23
{
24
  if (foo (1.245L) != bar (1.245L)
25
      || foo (245.67L) != bar (245.67L)
26
      || foo (0.00567L) != bar (0.00567L))
27
    __builtin_abort ();
28
  return 0;
29
}

powered by: WebSVN 2.1.0

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