strub: enable conditional support
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr65249.C
blob980d506bee6d74aad7b434d9b98038132c125f3f
1 // { dg-do compile }
2 // { dg-additional-options "-fPIC -fstack-protector-strong" { target fpic } }
3 // { dg-require-effective-target fstack_protector }
5 struct struct0
7   struct0 (void(*)());
8 };
10 int func5 (int* ptr);
11 void func3 (int*, struct0*);
13 inline void
14 func4 (int* a, void (*b)())
16   if (func5 (a) != 2)
17   {
18     struct0 f (b);
19     func3(a, &f);
20   }
23 struct struct1
25   const void* val0;
26   const void* val1;
29 void* func3 (const void*);
31 static const void* gvar1 = 0;
32 static const void* gvar2 = 0;
33 static int gvar0 = 0;
35 void
36 func0 (void)
38   gvar2 = func3 (gvar1);
41 inline void
42 func1 (void)
44   func4 (&gvar0, &func0);
47 struct1 func2 (void)
49   func1 ();
50   struct1 s;
51   s.val0 = gvar1;
52   s.val1 = gvar2;
53   return s;