blob: 4c193c7739b2e86e476181e3635b23df21c3fb23 [file] [log] [blame]
Dale Johannesen7d8e08a2009-06-12 18:41:53 +00001// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep {= internal global} | count 4
2// PR 3518
3// Some of the objects were coming out as unintialized (external) before 3518
4// was fixed. Internal names are different between llvm-gcc and clang so they
5// are not tested.
6
7extern void abort (void);
8
9struct A { int i; int j; };
10struct B { struct A *a; struct A *b; };
11struct C { struct B *c; struct A *d; };
12struct C e = { &(struct B) { &(struct A) { 1, 2 }, &(struct A) { 3, 4 } }, &(struct A) { 5, 6 } };
13
14int
15main (void)
16{
17 if (e.c->a->i != 1 || e.c->a->j != 2)
18 abort ();
19 if (e.c->b->i != 3 || e.c->b->j != 4)
20 abort ();
21 if (e.d->i != 5 || e.d->j != 6)
22 abort ();
23 return 0;
24}