1// { dg-do compile }
2// { dg-additional-options "-fPIC -fstack-protector-strong" { target fpic } }
3// { dg-require-effective-target fstack_protector }
4
5struct struct0
6{
7  struct0 (void(*)());
8};
9
10int func5 (int* ptr);
11void func3 (int*, struct0*);
12
13inline void
14func4 (int* a, void (*b)())
15{
16  if (func5 (a) != 2)
17  {
18    struct0 f (b);
19    func3(a, &f);
20  }
21}
22
23struct struct1
24{
25  const void* val0;
26  const void* val1;
27};
28
29void* func3 (const void*);
30
31static const void* gvar1 = 0;
32static const void* gvar2 = 0;
33static int gvar0 = 0;
34
35void
36func0 (void)
37{
38  gvar2 = func3 (gvar1);
39}
40
41inline void
42func1 (void)
43{
44  func4 (&gvar0, &func0);
45}
46
47struct1 func2 (void)
48{
49  func1 ();
50  struct1 s;
51  s.val0 = gvar1;
52  s.val1 = gvar2;
53  return s;
54}
55