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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.brendan/] [union1.C] - Diff between revs 305 and 338

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 305 Rev 338
// { dg-do run  }
// { dg-do run  }
// GROUPS passed unions
// GROUPS passed unions
// This is fixed by finish_anon_union doing a string_cst_equal check on
// This is fixed by finish_anon_union doing a string_cst_equal check on
// the DECL_SIZE of the decls, instead of comparing the DECL_SIZE nodes.
// the DECL_SIZE of the decls, instead of comparing the DECL_SIZE nodes.
// The compiler currently fails to allocate space for the static union.
// The compiler currently fails to allocate space for the static union.
     unsigned
     unsigned
     hash(const double d)
     hash(const double d)
     {
     {
        static union {
        static union {
           unsigned asint[2];
           unsigned asint[2];
           double asdouble;
           double asdouble;
        };
        };
        asdouble = d;
        asdouble = d;
        return asint[0] ^ asint[1];
        return asint[0] ^ asint[1];
     }
     }
int main ()
int main ()
{
{
  hash (3.1415);
  hash (3.1415);
}
}
 
 

powered by: WebSVN 2.1.0

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