From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/g++.dg/other/pr50464.C | 170 +++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 gcc/testsuite/g++.dg/other/pr50464.C (limited to 'gcc/testsuite/g++.dg/other/pr50464.C') diff --git a/gcc/testsuite/g++.dg/other/pr50464.C b/gcc/testsuite/g++.dg/other/pr50464.C new file mode 100644 index 000000000..8c6721373 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr50464.C @@ -0,0 +1,170 @@ +// { dg-do compile { target i?86-*-* x86_64-*-* } } +// { dg-options "-O3 -mxop" } + +typedef long unsigned int size_t; +typedef unsigned long ulong_t; +typedef signed long slong_t; + + template + struct iterator_traits + { + typedef typename _Iterator::reference reference; + }; + + template + struct iterator_traits<_Tp*> + { + typedef _Tp& reference; + }; + + template + class __normal_iterator + { + protected: + _Iterator _M_current; + typedef iterator_traits<_Iterator> __traits_type; + + public: + typedef typename __traits_type::reference reference; + + explicit + __normal_iterator(const _Iterator& __i) : _M_current(__i) { } + + reference + operator*() const + { return *_M_current; } + + __normal_iterator& + operator++() + { + ++_M_current; + return *this; + } + + const _Iterator& + base() const + { return _M_current; } + }; + + template + inline bool + operator!=(const __normal_iterator<_Iterator, _Container>& __lhs, + const __normal_iterator<_Iterator, _Container>& __rhs) + { return __lhs.base() != __rhs.base(); } + + template + class allocator + { + public: + typedef _Tp* pointer; + typedef _Tp value_type; + + template + struct rebind + { typedef allocator<_Tp1> other; }; + + pointer allocate(size_t __n, const void* = 0) + { + return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp))); + } + }; + + template + struct _Vector_base + { + typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type; + + struct _Vector_impl + : public _Tp_alloc_type + { + typename _Tp_alloc_type::pointer _M_start; + typename _Tp_alloc_type::pointer _M_finish; + typename _Tp_alloc_type::pointer _M_end_of_storage; + + _Vector_impl(_Tp_alloc_type const& __a) { } + }; + + public: + typedef _Alloc allocator_type; + + _Vector_base(size_t __n, const allocator_type& __a) + : _M_impl(__a) + { + this->_M_impl._M_start = this->_M_allocate(__n); + this->_M_impl._M_finish = this->_M_impl._M_start; + this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n; + } + + public: + _Vector_impl _M_impl; + + typename _Tp_alloc_type::pointer + _M_allocate(size_t __n) + { return __n != 0 ? _M_impl.allocate(__n) : 0; } + + }; + + template > + 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::pointer pointer; + typedef __normal_iterator iterator; + typedef _Alloc allocator_type; + + protected: + using _Base::_M_allocate; + using _Base::_M_impl; + + public: + + explicit + vector(size_t __n, const value_type& __value = value_type(), + const allocator_type& __a = allocator_type()) + : _Base(__n, __a) + { _M_fill_initialize(__n, __value); } + + iterator begin() + { return iterator(this->_M_impl._M_start); } + + iterator end() + { return iterator(this->_M_impl._M_finish); } + + protected: + void + _M_fill_initialize(size_t __n, const value_type& __value) + { + this->_M_impl._M_finish = this->_M_impl._M_end_of_storage; + } + }; + + template + _OutputIterator + replace_copy(_InputIterator __first, _InputIterator __last, + _OutputIterator __result, + const _Tp& __old_value, const _Tp& __new_value) + { + ; + for (; __first != __last; ++__first, ++__result) + if (*__first == __old_value) + *__result = __new_value; + else + *__result = *__first; + return __result; + } + +extern size_t shape_rank; + +void createDataspaceIdentifier() +{ + vector< ulong_t > dataspaceDims( shape_rank ); + vector< ulong_t > maxDataspaceDims( shape_rank ); + + replace_copy( + dataspaceDims.begin(), dataspaceDims.end(), + maxDataspaceDims.begin(), ulong_t( 0 ), ((ulong_t)(slong_t)(-1)) ); +} -- cgit v1.2.3