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 {
98 static _CharT_alloc_type c;
102 template<typename _CharT, typename _Traits, typename _Alloc>
103 __sso_string_base<_CharT, _Traits, _Alloc>:: __sso_string_base(const __sso_string_base& __rcs)
104 : _M_dataplus(__rcs._M_get_allocator(), _M_local_data) {
105 _M_construct(__rcs._M_data(), __rcs._M_data() + __rcs._M_length());
107 template<typename _CharT, typename _Traits, typename _Alloc, template <typename, typename, typename> class _Base>
109 : private _Base<_CharT, _Traits, _Alloc> {
112 template<typename _CharT, typename _Traits = std::char_traits<_CharT>, typename _Alloc = std::allocator<_CharT> >
114 : public __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc> {
116 typedef basic_string<char> string;
117 namespace std __attribute__ ((__visibility__ ("default"))) {
118 template<typename _Alloc, typename _Tp>
119 class __alloctr_rebind_helper {
121 static const bool __value = true;
123 template<typename _Alloc, typename _Tp, bool = __alloctr_rebind_helper<_Alloc, _Tp>::__value>
124 struct __alloctr_rebind;
125 template<typename _Alloc, typename _Tp> struct __alloctr_rebind<_Alloc, _Tp, true>
127 typedef typename _Alloc::template rebind<_Tp>::other __type;
129 template<typename _Alloc>
130 struct allocator_traits {
132 template<typename _Tp>
133 static typename _Tp::pointer _S_pointer_helper(_Tp*);
134 typedef decltype(_S_pointer_helper((_Alloc*)0)) __pointer;
136 typedef __pointer pointer;
137 template<typename _Tp>
138 using rebind_alloc = typename __alloctr_rebind<_Alloc, _Tp>::__type;
141 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
142 template<typename _Alloc> struct __alloc_traits
143 : std::allocator_traits<_Alloc>
145 typedef std::allocator_traits<_Alloc> _Base_type;
146 template<typename _Tp>
148 typedef typename _Base_type::template rebind_alloc<_Tp>
153 namespace std __attribute__ ((__visibility__ ("default"))) {
154 template<typename _T1, typename... _Args>
155 inline void _Construct(_T1* __p, _Args&&... __args) {
156 ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...);
158 template<typename _Tp, typename _Alloc>
159 struct _Vector_base {
160 typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template rebind<_Tp>::other _Tp_alloc_type;
161 typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>::pointer pointer;
163 : public _Tp_alloc_type {
168 _Vector_impl _M_impl;
170 template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
172 : protected _Vector_base<_Tp, _Alloc> {
173 typedef _Vector_base<_Tp, _Alloc> _Base;
175 typedef _Tp value_type;
176 typedef typename _Base::pointer pointer;
177 typedef size_t size_type;
178 size_type size() const;
179 void push_back(const value_type& __x) {
180 _M_emplace_back_aux(__x);
182 template<typename... _Args>
183 void _M_emplace_back_aux(_Args&&... __args);
184 size_type _M_check_len();
186 template<typename _Tp, typename _Alloc> template<typename... _Args>
187 void vector<_Tp, _Alloc>:: _M_emplace_back_aux(_Args&&... __args) {
188 const size_type __len = _M_check_len();
189 pointer __new_start(static_cast<pointer>(::operator new(__len * sizeof(_Tp))));
190 pointer __new_temp(__new_start + size());
191 ::new((void *)__new_temp) _Tp(std::forward<_Args>(__args)...);
192 pointer __cur = __new_start;
193 pointer __first = this->_M_impl._M_start;
194 pointer __last = this->_M_impl._M_finish;
197 ++__first, ++__cur) std::_Construct(std::__addressof(*__cur), *__first);
218 void CollectChunk(const DL::ChunkInfo& chunk, const int& location);
222 DL::ChunkInfo chunk_info;
224 vector<ChunkData> chunk_data_;
226 void FDB::CollectChunk(const DL::ChunkInfo& chunk, const int& location) {
227 ChunkData chunk_data;
228 chunk_data_.push_back( chunk_data);