OSDN Git Service

cp:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.brendan / union1.C
1 // { dg-do run  }
2 // GROUPS passed unions
3 // This is fixed by finish_anon_union doing a string_cst_equal check on
4 // the DECL_SIZE of the decls, instead of comparing the DECL_SIZE nodes.
5
6 // The compiler currently fails to allocate space for the static union.
7
8      unsigned
9      hash(const double d)
10      {
11         static union {
12            unsigned asint[2];
13            double asdouble;
14         };
15         asdouble = d;
16         return asint[0] ^ asint[1];
17      }
18
19 int main ()
20 {
21   hash (3.1415);
22 }