1 /* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
2 // { dg-require-effective-target c++11 }
3 // { dg-require-effective-target fpic }
4 /* { dg-options "-O2 -fno-omit-frame-pointer -fPIC" } */
7 typedef long long int64;
8 typedef unsigned int uint32;
9 typedef unsigned long long uint64;
11 typedef __SIZE_TYPE__ size_t;
12 template<class _CharT>
14 template<typename _Tp>
15 inline _Tp* __addressof(_Tp& __r) noexcept {
16 return reinterpret_cast<_Tp*> (&const_cast<char&>(reinterpret_cast<const volatile char&>(__r)));
18 template<typename _Tp>
19 struct remove_reference {
22 template<typename _Tp>
23 constexpr _Tp&& forward(typename std::remove_reference<_Tp>::type& __t) noexcept {
24 return static_cast<_Tp&&>(__t);
27 typedef __SIZE_TYPE__ size_t;
29 inline void* operator new(std::size_t, void* __p) noexcept {
33 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
34 template<typename _Tp>
37 typedef size_t size_type;
42 template<typename _Tp>
43 using __allocator_base = __gnu_cxx::new_allocator<_Tp>;
44 template<typename _Tp>
46 : public __allocator_base<_Tp> {
48 typedef size_t size_type;
49 template<typename _Tp1>
51 typedef allocator<_Tp1> other;
55 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
56 template<typename _CharT, typename _Traits, typename _Alloc>
57 class __sso_string_base;
58 template<typename _CharT, typename _Traits = std::char_traits<_CharT>, typename _Alloc = std::allocator<_CharT>, template <typename, typename, typename> class _Base = __sso_string_base>
60 template<typename _CharT, typename _Traits, typename _Alloc>
61 struct __vstring_utility {
62 typedef typename _Alloc::template rebind<_CharT>::other _CharT_alloc_type;
63 template<typename _Alloc1>
66 _Alloc_hider(const _Alloc1& __a, _CharT* __ptr)
67 : _Alloc1(__a), _M_p(__ptr) {
72 template<typename _CharT, typename _Traits, typename _Alloc>
73 class __sso_string_base
74 : protected __vstring_utility<_CharT, _Traits, _Alloc> {
75 typedef __vstring_utility<_CharT, _Traits, _Alloc> _Util_Base;
76 typedef typename _Util_Base::_CharT_alloc_type _CharT_alloc_type;
77 typedef typename _CharT_alloc_type::size_type size_type;
79 typename _Util_Base::template _Alloc_hider<_CharT_alloc_type>
81 size_type _M_string_length;
83 _S_local_capacity = 15 };
85 _CharT _M_local_data[_S_local_capacity + 1];
87 template<typename _InIterator>
88 void _M_construct(_InIterator __beg, _InIterator __end);
90 size_type _M_max_size() const;
91 _CharT* _M_data() const {
92 return _M_dataplus._M_p;
94 size_type _M_length() const {
95 return _M_string_length;
97 __sso_string_base(const __sso_string_base& __rcs);
98 const _CharT_alloc_type& _M_get_allocator() const {
99 static _CharT_alloc_type c;
103 template<typename _CharT, typename _Traits, typename _Alloc>
104 __sso_string_base<_CharT, _Traits, _Alloc>:: __sso_string_base(const __sso_string_base& __rcs)
105 : _M_dataplus(__rcs._M_get_allocator(), _M_local_data) {
106 _M_construct(__rcs._M_data(), __rcs._M_data() + __rcs._M_length());
108 template<typename _CharT, typename _Traits, typename _Alloc, template <typename, typename, typename> class _Base>
110 : private _Base<_CharT, _Traits, _Alloc> {
113 template<typename _CharT, typename _Traits = std::char_traits<_CharT>, typename _Alloc = std::allocator<_CharT> >
115 : public __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc> {
117 typedef basic_string<char> string;
118 namespace std __attribute__ ((__visibility__ ("default"))) {
119 template<typename _Alloc, typename _Tp>
120 class __alloctr_rebind_helper {
122 static const bool __value = true;
124 template<typename _Alloc, typename _Tp, bool = __alloctr_rebind_helper<_Alloc, _Tp>::__value>
125 struct __alloctr_rebind;
126 template<typename _Alloc, typename _Tp> struct __alloctr_rebind<_Alloc, _Tp, true>
128 typedef typename _Alloc::template rebind<_Tp>::other __type;
130 template<typename _Alloc>
131 struct allocator_traits {
133 template<typename _Tp>
134 static typename _Tp::pointer _S_pointer_helper(_Tp*);
135 typedef decltype(_S_pointer_helper((_Alloc*)0)) __pointer;
137 typedef __pointer pointer;
138 template<typename _Tp>
139 using rebind_alloc = typename __alloctr_rebind<_Alloc, _Tp>::__type;
142 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
143 template<typename _Alloc> struct __alloc_traits
144 : std::allocator_traits<_Alloc>
146 typedef std::allocator_traits<_Alloc> _Base_type;
147 template<typename _Tp>
149 typedef typename _Base_type::template rebind_alloc<_Tp>
154 namespace std __attribute__ ((__visibility__ ("default"))) {
155 template<typename _T1, typename... _Args>
156 inline void _Construct(_T1* __p, _Args&&... __args) {
157 ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...);
159 template<typename _Tp, typename _Alloc>
160 struct _Vector_base {
161 typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template rebind<_Tp>::other _Tp_alloc_type;
162 typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>::pointer pointer;
164 : public _Tp_alloc_type {
169 _Vector_impl _M_impl;
171 template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
173 : protected _Vector_base<_Tp, _Alloc> {
174 typedef _Vector_base<_Tp, _Alloc> _Base;
176 typedef _Tp value_type;
177 typedef typename _Base::pointer pointer;
178 typedef size_t size_type;
179 size_type size() const;
180 void push_back(const value_type& __x) {
181 _M_emplace_back_aux(__x);
183 template<typename... _Args>
184 void _M_emplace_back_aux(_Args&&... __args);
185 size_type _M_check_len();
187 template<typename _Tp, typename _Alloc> template<typename... _Args>
188 void vector<_Tp, _Alloc>:: _M_emplace_back_aux(_Args&&... __args) {
189 const size_type __len = _M_check_len();
190 pointer __new_start(static_cast<pointer>(::operator new(__len * sizeof(_Tp))));
191 pointer __new_temp(__new_start + size());
192 ::new((void *)__new_temp) _Tp(std::forward<_Args>(__args)...);
193 pointer __cur = __new_start;
194 pointer __first = this->_M_impl._M_start;
195 pointer __last = this->_M_impl._M_finish;
198 ++__first, ++__cur) std::_Construct(std::__addressof(*__cur), *__first);
219 void CollectChunk(const DL::ChunkInfo& chunk, const int& location);
223 DL::ChunkInfo chunk_info;
225 vector<ChunkData> chunk_data_;
227 void FDB::CollectChunk(const DL::ChunkInfo& chunk, const int& location) {
228 ChunkData chunk_data;
229 chunk_data_.push_back( chunk_data);