Be careful about comdat boundary in ICF (PR ipa/82352).
[official-gcc.git] / gcc / testsuite / g++.dg / opt / pr48967.C
blobdb2ea5474e41df7a9d11c6d85379c0132793bd03
1 // PR debug/48967
2 // { dg-do compile }
3 // { dg-options "-g -O2" }
5 template <typename> struct A;
6 template <typename T> struct A <T *>
8   typedef T ref;
9 };
10 template <typename T, typename> struct B
12   typedef A <T> t;
13   typedef typename t::ref ref;
14   ref operator * () { return ref (); }
16 template <typename T> struct I
18   typedef T *cp;
19   template <typename T1> struct J
20   {
21     typedef I <T1> other;
22   };
24 template <typename T> struct S : public I <T>
27 template <typename T, typename _A> struct E
29   typedef typename _A::template J <T>::other at;
31 template <typename T, typename _A = S <T> > struct D
33   typedef E <T, _A> _Base;
34   typedef typename _Base::at at;
35   typedef typename at::cp cp;
36   typedef B <cp, D> H;
38 template <class T> struct F
40   T *operator -> () { return __null; }
42 template <typename T> long
43 lfloor (T x)
45   return static_cast <long>(x) - (x && x != static_cast <long>(x));
47 template <typename T> long
48 lround (T x)
50   return lfloor (x - 0.5) + 1;
52 class M;
53 template <typename> class P;
54 typedef P <M> Q;
55 template <typename> struct P
57   float x ();
59 struct CV
61   Q c;
63 struct C
65   void foo (const CV &) const;
66   class O;
67   typedef D <F <O> > R;
68   R n;
70 struct S3
72   S3 (int, int);
74 struct S2
76   S3 sx, sy;
77   S2 (int x = 0, int y = 0, int s = 0, int t = 0) : sx (x, y), sy (s, t) {}
79 template <typename> struct N
81   int bar ();
83 struct C::O
85   N <float> o;
86   void foo (CV r, int)
87   {
88     Q c = r.c;
89     float t = 0.5 * (o.bar ());
90     S2 (lround (c.x ()), t);
91   }
93 void
94 C::foo (const CV &w) const
96   R::H m;
97   (*m)->foo (w, 8);