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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [ext/] [alias-canon2.C] - Blame information for rev 801

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
// PR c++/37553
3
typedef unsigned int ui32;
4
__extension__ typedef unsigned long long int ui64;
5
 
6
typedef ui32 __attribute__ ((__may_alias__)) ui32a;
7
typedef ui64 __attribute__ ((__may_alias__)) ui64a;
8
 
9
union u_u32
10
{
11
  ui32a v;
12
} __attribute__ ((__may_alias__));
13
 
14
union u_u64
15
{
16
  ui64a v;
17
  struct
18
  {
19
    union u_u32 lo32, hi32;
20
  } u;
21
} __attribute__ ((__may_alias__));
22
 
23
void
24
out_long (ui64 longVal)
25
{
26
  if ((*(union u_u64 *) &longVal).u.lo32.v < 0x10000000ul)
27
    {
28
      if ((ui32) ((*(union u_u64 *) &longVal).u.lo32.v) < 0x4000u)
29
        {
30
          /* do something useful */
31
        }
32
    }
33
}
34
 
35
void f(ui32 *) { }
36
void f(ui32a *) { }

powered by: WebSVN 2.1.0

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