1 // PR optimization/5547
2 // This testcase caused ICE on IA-32, since DWARF-2 was unable
3 // to emit location expression for parameter a of operator+.
4 // { dg-do compile { target fpic } }
5 // { dg-options "-fpic" }
9 inline A operator+ (char a, const A &b)
19 void test1 (const A &x, int y)
21 int j = b ("012345"[y] + x);
22 for (int i = 0; i < y; i++);
25 void test2 (const A &x, int y)
27 int j = b ("012345678"[y + 2] + x);
28 for (int i = 0; i < y; i++);
31 void test3 (const A &x, int y)
33 int j = b ("012345678"[y - 6] + x);
34 for (int i = 0; i < y; i++);
37 void test4 (const A &x, int y)
39 int j = b ("012345678"[2 * y - 10] + x);
40 for (int i = 0; i < y; i++);
43 void test5 (const A &x, int y)
45 int j = b ("012345678"[4 * y] + x);
46 for (int i = 0; i < y; i++);