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] - Rev 320
Go to most recent revision | Compare with Previous | Blame | View Log
/* { dg-do compile } */
#include <stdio.h>
#include <string.h>
inline int
bci (const float &source)
{
int dest;
memcpy (&dest, &source, sizeof (dest));
return dest;
}
inline float
bcf (const int &source)
{
float dest;
memcpy (&dest, &source, sizeof (dest));
return dest;
}
float
Foo ()
{
const int foo = bci (0.0f);
int bar = foo;
const int baz = foo & 1;
if (!baz && (foo & 2))
bar = 0;
return bcf (bar);
}
int
main ()
{
printf ("Foo() = %f\n", Foo());
return 0;
}
Go to most recent revision | Compare with Previous | Blame | View Log