[testsuite] [i386] require fpic for pr111497.C
[official-gcc.git] / gcc / testsuite / g++.target / i386 / pr111497.C
blob30e2e0409ad0e9068f8c97f7325610090006bb65
1 // { dg-do compile { target ia32 } }
2 // { dg-options "-march=i686 -mtune=generic -fPIC -O2 -g" }
3 // { dg-require-effective-target fpic }
5 class A;
6 struct B { const char *b1; int b2; };
7 struct C : B { C (const char *x, int y) { b1 = x; b2 = y; } };
8 struct D : C { D (B x) : C (x.b1, x.b2) {} };
9 struct E { E (A *); };
10 struct F : E { D f1, f2, f3, f4, f5, f6; F (A *, const B &, const B &, const B &); };
11 struct G : F { G (A *, const B &, const B &, const B &); };
12 struct H { int h; };
13 struct I { H i; };
14 struct J { I *j; };
15 struct A : J {};
16 inline F::F (A *x, const B &y, const B &z, const B &w)
17   : E(x), f1(y), f2(z), f3(w), f4(y), f5(z), f6(w) {}
18 G::G (A *x, const B &y, const B &z, const B &w) : F(x, y, z, w)
20   H *h = &x->j->i;
21   if (h)
22     h->h++;