1 // PR rtl-optimization/36419
2 // { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } }
3 // { dg-require-effective-target fpic }
4 // { dg-options "-Os -fasynchronous-unwind-tables -fpic -fno-inline" }
8 extern "C" void abort ();
12 struct R { int r1; unsigned short r2[1]; };
13 int bar1 (unsigned short *, int, short) throw ();
14 void bar2 (R *) throw ();
15 void bar3 (R **, const unsigned short *, int) throw ();
16 void bar4 (R **, const char *) throw ();
17 void bar5 (void *, const char *, ...);
24 S (R *x, T *) { s = x; }
26 S &operator= (const S &x);
27 S &operator+= (const S &x);
28 S sfn1 (const S &x) const;
29 friend S operator+ (const S &x1, const S &x2);
34 bar3 (&p, q, bar1 (q, i, 10));
35 return S (p, (T *) 0);
37 static S sfn3 (const char *x)
41 return S (p, (T *) 0);
46 template <class C> unsigned char operator >>= (const U &, C &);
52 unsigned char is () const;
55 template <class T> struct X : public W
60 T *operator -> () const;
66 E (const S &, const X <V> &);
69 E &operator = (E const &);
74 virtual void release () throw ();
77 template <class T> X <T>::~X ()
85 virtual U yfn1 (const S &);
90 X <V> baz1 (const S &)
91 #if __cplusplus <= 201402L
92 throw (E) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } }
95 X <Z> baz2 (const X <Z> &)
96 #if __cplusplus <= 201402L
97 throw (E) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } }
101 template <typename T> X<T>::X ()
106 template <typename T> X<T>::X (W const &)
111 U Y::yfn1 (const S &)
118 template <typename T> T *X<T>::operator -> () const
123 X <V> baz1 (const S &)
124 #if __cplusplus <= 201402L
125 throw (E) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } }
139 X <Z> baz2 (const X <Z> &)
140 #if __cplusplus <= 201402L
141 throw (E) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } }
147 int bar1 (unsigned short *, int, short) throw ()
149 asm volatile ("" : : : "memory");
153 void bar2 (R *) throw ()
155 asm volatile ("" : : : "memory");
158 void bar3 (R **, const unsigned short *, int) throw ()
160 asm volatile ("" : : : "memory");
163 void bar4 (R **, const char *) throw ()
165 asm volatile ("" : : : "memory");
171 void bar5 (void *p, const char *s, ...)
180 if (events[0] != va_arg (ap, int))
187 if (events[1] != va_arg (ap, int))
191 sp = va_arg (ap, void *);
192 else if (sp != va_arg (ap, void *))
198 unsigned char W::is () const
203 S &S::operator += (const S &)
208 template <class C> unsigned char operator >>= (const U &, C &)
215 template unsigned char operator >>= (const U &, X<Z> &);
216 template X<Y>::X (W const &);
218 template Y *X<Y>::operator-> () const;
220 X <Z> foo () throw ()
226 b = X <Y> (baz1 (S::sfn3 ("defg")));
233 for (int n = 0; n < 10; n++)
235 S c = S::sfn3 ("abcd");
240 bar5 ((void *) 0, "trying %d\n", n);
241 if ((b->yfn1 (c) >>= d))
244 bar5 ((void *) 0, "failure1 on %d\n", n);
249 bar5 ((void *) 0, "failure2 on %d\n", n);
254 asm volatile ("movl %%esp, %0" : "=r" (p));
255 bar5 ((void *) 0, "caught %d %p\n", n, p);
266 if (events[0] != 10 || events[1] != 10)