3 // { dg-options "-O2 -fstack-protector" }
4 // { dg-additional-options "-fPIC" { target fpic } }
5 // { dg-require-effective-target fstack_protector }
10 A () throw () : a1 (0) {}
15 unsigned int b1 () throw ();
18 __attribute__((noinline, noclone)) unsigned int
21 asm volatile ("" : : : "memory");
28 void c2 (const A *, unsigned int);
31 __attribute__((noinline, noclone)) void
32 C::c2 (const A *, unsigned int)
34 asm volatile ("" : : : "memory");
51 virtual int f1 (const char * s, int n);
58 G & g3 (const char * ws, int len)
60 if (__builtin_expect (!g2, true)
61 && __builtin_expect (this->g1->f1 (ws, len) != len, false))
77 H () : h1 (0), h2 (0), h4 (0), h5 (0), h6 (0), h8 (false) {}
78 void h9 (const D &) __attribute__((noinline, noclone));
85 __builtin_memset (h7, 0, sizeof (h7));
86 asm volatile ("" : : : "memory");
94 const unsigned int i = b.b1 ();
95 const A **j = x.d1->c1;
109 return static_cast <const H *>(j[i]);
112 __attribute__((noinline, noclone)) int
113 bar (char *x, unsigned long v, const char *y, int z, bool w)
115 asm volatile ("" : : "r" (x), "r" (v), "r" (y) : "memory");
116 asm volatile ("" : : "r" (z), "r" (w) : "memory");
120 __attribute__((noinline, noclone)) void
121 baz (void *z, const char *g, unsigned int h, char s, E &e, char *n, char *c, int &l)
123 asm volatile ("" : : "r" (z), "r" (g), "r" (h) : "memory");
124 asm volatile ("" : : "r" (s), "r" (&e), "r" (n) : "memory");
125 asm volatile ("" : : "r" (c), "r" (&l) : "memory");
134 __attribute__((noinline, noclone)) G
135 test (void *z, G s, E &x, char, long v)
138 const H *h = foo (d);
139 const char *q = h->h7;
141 const int i = 5 * sizeof (long);
142 char *c = static_cast <char *>(__builtin_alloca (i));
143 const int b = f & 74;
144 const bool e = (b != 64 && b != 8);
145 const unsigned long u = ((v > 0 || !e) ? (unsigned long) v : -(unsigned long) v);
146 int l = bar (c + i, u, q, f, e);
150 char *c2 = static_cast <char *>(__builtin_alloca ((l + 1) * 2));
151 baz (z, h->h1, h->h2, h->h6, x, c2 + 2, c, l);
154 if (__builtin_expect (e, true))
157 else if ((f & 4096) && v)
160 const bool m = f & 176;
168 char * c3 = static_cast <char *>(__builtin_alloca (w));
186 test (0, g, e, 0, 0);