modula2: Tidyup gm2-compiler/M2MetaError.mod
[official-gcc.git] / gcc / testsuite / g++.dg / lto / 20080908-1_0.C
blob92dec575f9b1de525a18e0ff3639a5411be75264
1 /* { dg-lto-do run }  */
2 extern "C" { extern void *memcpy (void *, const void *, __SIZE_TYPE__); }
4 typedef int int32_t __attribute__((mode (__SI__)));
6 inline int32_t
7 bci (const float &source)
9  int32_t dest;
10  memcpy (&dest, &source, sizeof (dest));
11  return dest;
14 inline float
15 bcf (const int32_t &source)
17  float dest;
18  memcpy (&dest, &source, sizeof (dest));
19  return dest;
22 float
23 Foo ()
25  const int32_t foo = bci (0.0f);
26  int32_t bar = foo;
27  const int32_t baz = foo & 1;
28  if (!baz && (foo & 2))
29    bar = 0;
30  return bcf (bar);
33 int main ()
35   if (sizeof (int32_t) == sizeof (float))
36     {
37       if (Foo () != 0.0)
38         return 1;
39     }
40   return 0;