1 /* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
2 // { dg-require-effective-target c++11 }
3 /* { dg-options "-O2 -fno-omit-frame-pointer -fPIC" } */
6 typedef long long int64;
7 typedef unsigned int uint32;
8 typedef unsigned long long uint64;
10 typedef __SIZE_TYPE__ size_t;
11 template<class _CharT>
13 template<typename _Tp>
14 inline _Tp* __addressof(_Tp& __r) noexcept {
15 return reinterpret_cast<_Tp*> (&const_cast<char&>(reinterpret_cast<const volatile char&>(__r)));
17 template<typename _Tp>
18 struct remove_reference {
21 template<typename _Tp>
22 constexpr _Tp&& forward(typename std::remove_reference<_Tp>::type& __t) noexcept {
23 return static_cast<_Tp&&>(__t);
26 typedef __SIZE_TYPE__ size_t;
28 inline void* operator new(std::size_t, void* __p) noexcept {
32 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
33 template<typename _Tp>
36 typedef size_t size_type;
41 template<typename _Tp>
42 using __allocator_base = __gnu_cxx::new_allocator<_Tp>;
43 template<typename _Tp>
45 : public __allocator_base<_Tp> {
47 typedef size_t size_type;
48 template<typename _Tp1>
50 typedef allocator<_Tp1> other;
54 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
55 template<typename _CharT, typename _Traits, typename _Alloc>
56 class __sso_string_base;
57 template<typename _CharT, typename _Traits = std::char_traits<_CharT>, typename _Alloc = std::allocator<_CharT>, template <typename, typename, typename> class _Base = __sso_string_base>
59 template<typename _CharT, typename _Traits, typename _Alloc>
60 struct __vstring_utility {
61 typedef typename _Alloc::template rebind<_CharT>::other _CharT_alloc_type;
62 template<typename _Alloc1>
65 _Alloc_hider(const _Alloc1& __a, _CharT* __ptr)
66 : _Alloc1(__a), _M_p(__ptr) {
71 template<typename _CharT, typename _Traits, typename _Alloc>
72 class __sso_string_base
73 : protected __vstring_utility<_CharT, _Traits, _Alloc> {
74 typedef __vstring_utility<_CharT, _Traits, _Alloc> _Util_Base;
75 typedef typename _Util_Base::_CharT_alloc_type _CharT_alloc_type;
76 typedef typename _CharT_alloc_type::size_type size_type;
78 typename _Util_Base::template _Alloc_hider<_CharT_alloc_type>
80 size_type _M_string_length;
82 _S_local_capacity = 15 };
84 _CharT _M_local_data[_S_local_capacity + 1];
86 template<typename _InIterator>
87 void _M_construct(_InIterator __beg, _InIterator __end);
89 size_type _M_max_size() const;
90 _CharT* _M_data() const {
91 return _M_dataplus._M_p;
93 size_type _M_length() const {
94 return _M_string_length;
96 __sso_string_base(const __sso_string_base& __rcs);
97 const _CharT_alloc_type& _M_get_allocator() const {
100 template<typename _CharT, typename _Traits, typename _Alloc>
101 __sso_string_base<_CharT, _Traits, _Alloc>:: __sso_string_base(const __sso_string_base& __rcs)
102 : _M_dataplus(__rcs._M_get_allocator(), _M_local_data) {
103 _M_construct(__rcs._M_data(), __rcs._M_data() + __rcs._M_length());
105 template<typename _CharT, typename _Traits, typename _Alloc, template <typename, typename, typename> class _Base>
107 : private _Base<_CharT, _Traits, _Alloc> {
110 template<typename _CharT, typename _Traits = std::char_traits<_CharT>, typename _Alloc = std::allocator<_CharT> >
112 : public __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc> {
114 typedef basic_string<char> string;
115 namespace std __attribute__ ((__visibility__ ("default"))) {
116 template<typename _Alloc, typename _Tp>
117 class __alloctr_rebind_helper {
119 static const bool __value = true;
121 template<typename _Alloc, typename _Tp, bool = __alloctr_rebind_helper<_Alloc, _Tp>::__value>
122 struct __alloctr_rebind;
123 template<typename _Alloc, typename _Tp> struct __alloctr_rebind<_Alloc, _Tp, true>
125 typedef typename _Alloc::template rebind<_Tp>::other __type;
127 template<typename _Alloc>
128 struct allocator_traits {
130 template<typename _Tp>
131 static typename _Tp::pointer _S_pointer_helper(_Tp*);
132 typedef decltype(_S_pointer_helper((_Alloc*)0)) __pointer;
134 typedef __pointer pointer;
135 template<typename _Tp>
136 using rebind_alloc = typename __alloctr_rebind<_Alloc, _Tp>::__type;
139 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
140 template<typename _Alloc> struct __alloc_traits
141 : std::allocator_traits<_Alloc>
143 typedef std::allocator_traits<_Alloc> _Base_type;
144 template<typename _Tp>
146 typedef typename _Base_type::template rebind_alloc<_Tp>
151 namespace std __attribute__ ((__visibility__ ("default"))) {
152 template<typename _T1, typename... _Args>
153 inline void _Construct(_T1* __p, _Args&&... __args) {
154 ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...);
156 template<typename _Tp, typename _Alloc>
157 struct _Vector_base {
158 typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template rebind<_Tp>::other _Tp_alloc_type;
159 typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>::pointer pointer;
161 : public _Tp_alloc_type {
166 _Vector_impl _M_impl;
168 template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
170 : protected _Vector_base<_Tp, _Alloc> {
171 typedef _Vector_base<_Tp, _Alloc> _Base;
173 typedef _Tp value_type;
174 typedef typename _Base::pointer pointer;
175 typedef size_t size_type;
176 size_type size() const;
177 void push_back(const value_type& __x) {
178 _M_emplace_back_aux(__x);
180 template<typename... _Args>
181 void _M_emplace_back_aux(_Args&&... __args);
182 size_type _M_check_len();
184 template<typename _Tp, typename _Alloc> template<typename... _Args>
185 void vector<_Tp, _Alloc>:: _M_emplace_back_aux(_Args&&... __args) {
186 const size_type __len = _M_check_len();
187 pointer __new_start(static_cast<pointer>(::operator new(__len * sizeof(_Tp))));
188 pointer __new_temp(__new_start + size());
189 ::new((void *)__new_temp) _Tp(std::forward<_Args>(__args)...);
190 pointer __cur = __new_start;
191 pointer __first = this->_M_impl._M_start;
192 pointer __last = this->_M_impl._M_finish;
195 ++__first, ++__cur) std::_Construct(std::__addressof(*__cur), *__first);
216 void CollectChunk(const DL::ChunkInfo& chunk, const int& location);
220 DL::ChunkInfo chunk_info;
222 vector<ChunkData> chunk_data_;
224 void FDB::CollectChunk(const DL::ChunkInfo& chunk, const int& location) {
225 ChunkData chunk_data;
226 chunk_data_.push_back( chunk_data);