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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [lto/] [20080908-1_0.C] - Blame information for rev 801

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

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-lto-do run }  */
2
extern "C" { extern void *memcpy (void *, const void *, unsigned); }
3
 
4
inline int
5
bci (const float &source)
6
{
7
 int dest;
8
 memcpy (&dest, &source, sizeof (dest));
9
 return dest;
10
}
11
 
12
inline float
13
bcf (const int &source)
14
{
15
 float dest;
16
 memcpy (&dest, &source, sizeof (dest));
17
 return dest;
18
}
19
 
20
float
21
Foo ()
22
{
23
 const int foo = bci (0.0f);
24
 int bar = foo;
25
 const int baz = foo & 1;
26
 if (!baz && (foo & 2))
27
   bar = 0;
28
 return bcf (bar);
29
}
30
 
31
int main ()
32
{
33
  if (Foo () != 0.0)
34
    return 1;
35
  return 0;
36
}

powered by: WebSVN 2.1.0

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