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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [testsuite/] [gdb.c++/] [anon-union.cc] - Blame information for rev 107

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

Line No. Rev Author Line
1 106 markom
 
2
struct Foo {
3
  union {
4
    int zero;
5
    unsigned int one;
6
  } num1;
7
  struct X {
8
      int rock;
9
      unsigned int rock2;
10
  };
11
  union {
12
    int pebble;
13
    X x;
14
    union {
15
      int qux;
16
      unsigned int mux;
17
    };
18
    unsigned int boulder;
19
  };
20
  union {
21
    int paper;
22
    unsigned int cloth;
23
  };
24
  union {
25
    int two;
26
    unsigned int three;
27
  } num2;
28
};
29
 
30
union Bar {
31
  int x;
32
  unsigned int y;
33
};
34
 
35
 
36
int main()
37
{
38
  Foo foo = {0, 0};
39
 
40
  foo.paper = 33;
41
  foo.pebble = 44;
42
  foo.mux = 55;
43
 
44
  Bar bar = {0};
45
 
46
  union {
47
    int z;
48
    unsigned int w;
49
  }; w = 0;
50
 
51
  bar.x = 33;
52
 
53
  w = 45;
54
 
55
}

powered by: WebSVN 2.1.0

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