Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / API / lang / c / anonymous / main.c
blob990d79b23b5dd808993f1505221a4db0542e5a36
1 struct anonymous_nest {
2 struct {
3 struct {
4 int a;
5 int b;
6 }; // anonymous
7 struct {
8 int c;
9 int d;
10 } foo;
11 }; // anonymous
14 struct anonymous_child {
15 struct {
16 struct {
17 int a;
18 int b;
19 } grandchild;
20 struct {
21 int c;
22 int d;
23 } foo;
24 }; // anonymous
27 struct anonymous_grandchild {
28 struct {
29 struct {
30 int a;
31 int b;
32 }; // anonymous
33 struct {
34 int c;
35 int d;
36 } foo;
37 } child;
40 int processor_nest (struct anonymous_nest *n)
42 return n->foo.d + n->b; // Set breakpoint 0 here.
45 int processor_child (struct anonymous_child *c)
47 return c->foo.d + c->grandchild.b; // Set breakpoint 1 here.
50 int processor_grandchild (struct anonymous_grandchild *g)
52 return g->child.foo.d + g->child.b;
57 typedef struct {
58 int dummy;
59 } type_y;
61 typedef struct {
62 type_y y;
63 } type_z;
67 int main()
69 struct anonymous_nest n = { 0, 2, 0, 4 };
70 struct anonymous_child c = { 0, 2, 0, 4 };
71 struct anonymous_grandchild g = { 0, 2, 0, 4 };
72 type_z *pz = 0;
73 type_z z = {{2}};
75 processor_nest(&n);
76 processor_child(&c);
77 processor_grandchild(&g); // Set breakpoint 2 here.
79 return 0;