summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/pr44357.C
blob: 3380350e81b8d836bd6cd2bf644830c9fa799704 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
/* { dg-do compile } */
extern "C"
{
  typedef long unsigned int size_t;
}
namespace llvm
{
  namespace dont_use
  {
    template < typename T > double is_class_helper (...);
  }
  template < typename T > struct is_class
  {
  public:enum
    { value = sizeof (char) == sizeof (dont_use::is_class_helper < T > (0)) };
  };
    template < typename T > struct isPodLike
  {
    static const bool value = !is_class < T >::value;
  };
}
namespace std __attribute__ ((__visibility__ ("default")))
{
  template < typename _Iterator > struct iterator_traits
  {
  };
  template < typename _Tp > struct iterator_traits <_Tp * >
  {
    typedef _Tp value_type;
  };
}

namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
{
  template < typename _Tp > class new_allocator
  {
  public:typedef size_t size_type;
    typedef const _Tp & const_reference;
  };
}

namespace std __attribute__ ((__visibility__ ("default")))
{
template < typename _Tp > class allocator:public __gnu_cxx::new_allocator <
    _Tp >
  {
  public:typedef size_t size_type;
    template < typename _Tp1 > struct rebind
    {
      typedef allocator < _Tp1 > other;
    };
  };
  template < typename _Tp, typename _Alloc > struct _Vector_base
  {
    typedef typename _Alloc::template rebind < _Tp >::other _Tp_alloc_type;
  };
template < typename _Tp, typename _Alloc = std::allocator < _Tp > >class vector:protected _Vector_base < _Tp,
    _Alloc
    >
  {
    typedef _Vector_base < _Tp, _Alloc > _Base;
    typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
  public:typedef _Tp value_type;
    typedef typename _Tp_alloc_type::const_reference const_reference;
    typedef size_t size_type;
    size_type size () const
    {
    } const_reference operator[] (size_type __n) const
    {
  }};
}

namespace llvm
{
  struct LandingPadInfo;
  class DwarfException
  {
    static bool PadLT (const LandingPadInfo * L, const LandingPadInfo * R);
    struct CallSiteEntry
    {
    };
    void EmitExceptionTable ();
  };
}
namespace std __attribute__ ((__visibility__ ("default")))
{
  template < typename _RandomAccessIterator,
    typename _Compare >
    void __unguarded_linear_insert (_RandomAccessIterator __last,
				    _Compare __comp)
  {
    typename iterator_traits < _RandomAccessIterator >::value_type __val =
      (*__last);
    _RandomAccessIterator __next = __last;
    while (__comp (__val, *__next))
      {
      }
  }
  template < typename _RandomAccessIterator,
    typename _Compare > void __insertion_sort (_RandomAccessIterator __first,
					       _RandomAccessIterator __last,
					       _Compare __comp)
  {
    for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
      {
	if (__comp (*__i, *__first))
	  {
	  }
	else
	  std::__unguarded_linear_insert (__i, __comp);
      }
  }
  enum
  { _S_threshold = 16 };
  template < typename _RandomAccessIterator,
    typename _Compare >
    void __final_insertion_sort (_RandomAccessIterator __first,
				 _RandomAccessIterator __last,
				 _Compare __comp)
  {
    if (__last - __first > int (_S_threshold))
      {
	std::__insertion_sort (__first, __first + int (_S_threshold), __comp);
      }
  }
  template < typename _RandomAccessIterator,
    typename _Compare > inline void sort (_RandomAccessIterator __first,
					  _RandomAccessIterator __last,
					  _Compare __comp)
  {
    if (__first != __last)
      {
	std::__final_insertion_sort (__first, __last, __comp);
      }
  }
}

namespace llvm
{
  class SmallVectorBase
  {
  protected:void *BeginX, *EndX, *CapacityX;
    struct U
    {
    } FirstEl;
  protected:  SmallVectorBase (size_t Size):BeginX (&FirstEl), EndX (&FirstEl),
      CapacityX ((char *) &FirstEl + Size)
    {
  }};
template < typename T > class SmallVectorTemplateCommon:public
    SmallVectorBase
  {
  public: SmallVectorTemplateCommon (size_t Size):SmallVectorBase (Size)
    {
    } typedef size_t size_type;
    typedef T *iterator;
    iterator begin ()
    {
    } iterator end ()
    {
    } size_type size () const
    {
  }};
template < typename T, bool isPodLike > class SmallVectorTemplateBase:public SmallVectorTemplateCommon <
    T >
  {
  public: SmallVectorTemplateBase (size_t Size):SmallVectorTemplateCommon < T >
      (Size)
    {
  }};
template < typename T > class SmallVectorImpl:public SmallVectorTemplateBase < T,
    isPodLike < T >::value >
  {
    typedef SmallVectorTemplateBase < T, isPodLike < T >::value > SuperClass;
  public:typedef typename SuperClass::iterator iterator;
    explicit SmallVectorImpl (unsigned N):SmallVectorTemplateBase < T,
      isPodLike < T >::value > (N * sizeof (T))
    {
    }
  };
  template < typename T,
    unsigned N > class SmallVector:public SmallVectorImpl < T >
  {
    typedef typename SmallVectorImpl < T >::U U;
    enum
    { MinUs =
	(static_cast < unsigned int >(sizeof (T)) * N + static_cast <
	 unsigned int >(sizeof (U)) - 1) /static_cast <
	unsigned int >(sizeof (U)), NumInlineEltsElts =
	MinUs > 1 ? (MinUs - 1) : 1, NumTsAvailable =
	(NumInlineEltsElts + 1) * static_cast <
	unsigned int >(sizeof (U)) / static_cast <
	unsigned int >(sizeof (T)) };
  public:  SmallVector ():SmallVectorImpl < T > (NumTsAvailable)
    {
    }
  };
  struct LandingPadInfo
  {
    std::vector < int >TypeIds;
    union
    {
    } Contents;
  };
}

using namespace llvm;
bool
DwarfException::PadLT (const LandingPadInfo * L, const LandingPadInfo * R)
{
  const std::vector < int >&LIds = L->TypeIds, &RIds = R->TypeIds;
  unsigned LSize = LIds.size (), RSize = RIds.size ();
  unsigned MinSize = LSize < RSize ? LSize : RSize;
  for (unsigned i = 0; i != MinSize; ++i)
    if (LIds[i] != RIds[i])
      return LIds[i] < RIds[i];
}

void
DwarfException::EmitExceptionTable ()
{
  SmallVector < const LandingPadInfo *, 64 > LandingPads;
  std::sort (LandingPads.begin (), LandingPads.end (), PadLT);
  SmallVector < CallSiteEntry, 64 > CallSites;
  for (unsigned i = 0, e = CallSites.size (); i < e; ++i)
    {
    }
}