OSDN Git Service

* decl.c (start_preparsed_function): Set
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / opt / crossjump1.C
1 // PR middle-end/21492
2 // { dg-do compile }
3 // { dg-options "-Os" }
4 // { dg-options "-Os -fPIC" { target fpic } }
5
6 extern char *bar (const char *, const char *);
7 extern char *baz (char *, const char *);
8 extern unsigned int fn (const char *);
9 static const struct C { int i; } k = { 0};
10
11 struct A
12 {
13   ~A ();
14 };
15
16 char *
17 foo (char *x, const char *y)
18 {
19   A a;
20   char *c = x;
21
22   if (bar (y, "foo"))
23     {
24       baz (c, "foo");
25       c += fn ("foo");
26     }
27   else if (bar (y, "bar"))
28     {
29       baz (c, "bar");
30       c += fn ("bar");
31     }
32
33   return x;
34 }