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/] [g++.dg/] [torture/] [pr37421.C] - Blame information for rev 320

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

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

powered by: WebSVN 2.1.0

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