aboutsummaryrefslogtreecommitdiff
path: root/tests/libcxx/include
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libcxx/include')
-rw-r--r--tests/libcxx/include/__bit_reference1225
-rw-r--r--tests/libcxx/include/__config263
-rw-r--r--tests/libcxx/include/__functional_032128
-rw-r--r--tests/libcxx/include/__functional_base534
-rw-r--r--tests/libcxx/include/__functional_base_031087
-rw-r--r--tests/libcxx/include/__hash_table1819
-rw-r--r--tests/libcxx/include/__locale1376
-rw-r--r--tests/libcxx/include/__mutex_base437
-rw-r--r--tests/libcxx/include/__split_buffer617
-rw-r--r--tests/libcxx/include/__sso_allocator75
-rw-r--r--tests/libcxx/include/__std_stream313
-rw-r--r--tests/libcxx/include/__tree2238
-rw-r--r--tests/libcxx/include/__tuple267
-rw-r--r--tests/libcxx/include/__tuple_0325
-rw-r--r--tests/libcxx/include/algorithm5331
-rw-r--r--tests/libcxx/include/array313
-rw-r--r--tests/libcxx/include/atomic1507
-rw-r--r--tests/libcxx/include/bitset1029
-rw-r--r--tests/libcxx/include/cassert23
-rw-r--r--tests/libcxx/include/ccomplex27
-rw-r--r--tests/libcxx/include/cctype159
-rw-r--r--tests/libcxx/include/cerrno57
-rw-r--r--tests/libcxx/include/cfenv80
-rw-r--r--tests/libcxx/include/cfloat76
-rw-r--r--tests/libcxx/include/chrono871
-rw-r--r--tests/libcxx/include/cinttypes257
-rw-r--r--tests/libcxx/include/ciso64623
-rw-r--r--tests/libcxx/include/climits46
-rw-r--r--tests/libcxx/include/clocale51
-rw-r--r--tests/libcxx/include/cmath1584
-rw-r--r--tests/libcxx/include/codecvt545
-rw-r--r--tests/libcxx/include/complex1514
-rw-r--r--tests/libcxx/include/complex.h33
-rw-r--r--tests/libcxx/include/condition_variable254
-rw-r--r--tests/libcxx/include/csetjmp50
-rw-r--r--tests/libcxx/include/csignal56
-rw-r--r--tests/libcxx/include/cstdarg46
-rw-r--r--tests/libcxx/include/cstdbool30
-rw-r--r--tests/libcxx/include/cstddef95
-rw-r--r--tests/libcxx/include/cstdint189
-rw-r--r--tests/libcxx/include/cstdio159
-rw-r--r--tests/libcxx/include/cstdlib138
-rw-r--r--tests/libcxx/include/cstring109
-rw-r--r--tests/libcxx/include/ctgmath27
-rw-r--r--tests/libcxx/include/ctime70
-rw-r--r--tests/libcxx/include/cwchar195
-rw-r--r--tests/libcxx/include/cwctype211
-rw-r--r--tests/libcxx/include/deque2774
-rw-r--r--tests/libcxx/include/exception246
-rw-r--r--tests/libcxx/include/ext/.svn/all-wcprops17
-rw-r--r--tests/libcxx/include/ext/.svn/entries96
-rw-r--r--tests/libcxx/include/ext/.svn/text-base/hash_map.svn-base986
-rw-r--r--tests/libcxx/include/ext/.svn/text-base/hash_set.svn-base650
-rw-r--r--tests/libcxx/include/ext/hash_map986
-rw-r--r--tests/libcxx/include/ext/hash_set650
-rw-r--r--tests/libcxx/include/forward_list1526
-rw-r--r--tests/libcxx/include/fstream1394
-rw-r--r--tests/libcxx/include/functional1946
-rw-r--r--tests/libcxx/include/future2313
-rw-r--r--tests/libcxx/include/initializer_list99
-rw-r--r--tests/libcxx/include/iomanip502
-rw-r--r--tests/libcxx/include/ios985
-rw-r--r--tests/libcxx/include/iosfwd191
-rw-r--r--tests/libcxx/include/iostream58
-rw-r--r--tests/libcxx/include/istream1735
-rw-r--r--tests/libcxx/include/iterator1707
-rw-r--r--tests/libcxx/include/limits613
-rw-r--r--tests/libcxx/include/list1605
-rw-r--r--tests/libcxx/include/locale4302
-rw-r--r--tests/libcxx/include/map1830
-rw-r--r--tests/libcxx/include/memory3854
-rw-r--r--tests/libcxx/include/mutex523
-rw-r--r--tests/libcxx/include/new108
-rw-r--r--tests/libcxx/include/numeric195
-rw-r--r--tests/libcxx/include/ostream1291
-rw-r--r--tests/libcxx/include/queue662
-rw-r--r--tests/libcxx/include/random6564
-rw-r--r--tests/libcxx/include/ratio441
-rw-r--r--tests/libcxx/include/regex6358
-rw-r--r--tests/libcxx/include/scoped_allocator573
-rw-r--r--tests/libcxx/include/set942
-rw-r--r--tests/libcxx/include/sstream884
-rw-r--r--tests/libcxx/include/stack259
-rw-r--r--tests/libcxx/include/stdexcept160
-rw-r--r--tests/libcxx/include/streambuf562
-rw-r--r--tests/libcxx/include/string3781
-rw-r--r--tests/libcxx/include/strstream359
-rw-r--r--tests/libcxx/include/system_error633
-rw-r--r--tests/libcxx/include/tgmath.h27
-rw-r--r--tests/libcxx/include/thread422
-rw-r--r--tests/libcxx/include/tuple906
-rw-r--r--tests/libcxx/include/type_traits2318
-rw-r--r--tests/libcxx/include/typeindex94
-rw-r--r--tests/libcxx/include/typeinfo122
-rw-r--r--tests/libcxx/include/unordered_map1678
-rw-r--r--tests/libcxx/include/unordered_set1046
-rw-r--r--tests/libcxx/include/utility505
-rw-r--r--tests/libcxx/include/valarray4742
-rw-r--r--tests/libcxx/include/vector2786
99 files changed, 97565 insertions, 0 deletions
diff --git a/tests/libcxx/include/__bit_reference b/tests/libcxx/include/__bit_reference
new file mode 100644
index 00000000..bef27625
--- /dev/null
+++ b/tests/libcxx/include/__bit_reference
@@ -0,0 +1,1225 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___BIT_REFERENCE
+#define _LIBCPP___BIT_REFERENCE
+
+#include <__config>
+#include <algorithm>
+
+#pragma GCC system_header
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _C, bool _IsConst> class __bit_iterator;
+template <class _C> class __bit_const_reference;
+
+template <class _C>
+class __bit_reference
+{
+ typedef typename _C::__storage_type __storage_type;
+ typedef typename _C::__storage_pointer __storage_pointer;
+
+ __storage_pointer __seg_;
+ __storage_type __mask_;
+
+#if defined(__clang__)
+ friend typename _C::__self;
+#else
+ friend class _C::__self;
+#endif
+ friend class __bit_const_reference<_C>;
+ friend class __bit_iterator<_C, false>;
+public:
+ _LIBCPP_INLINE_VISIBILITY operator bool() const {return static_cast<bool>(*__seg_ & __mask_);}
+ _LIBCPP_INLINE_VISIBILITY bool operator ~() const {return !static_cast<bool>(*this);}
+
+ _LIBCPP_INLINE_VISIBILITY
+ __bit_reference& operator=(bool __x)
+ {
+ if (__x)
+ *__seg_ |= __mask_;
+ else
+ *__seg_ &= ~__mask_;
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __bit_reference& operator=(const __bit_reference& __x) {return operator=(static_cast<bool>(__x));}
+
+ _LIBCPP_INLINE_VISIBILITY void flip() {*__seg_ ^= __mask_;}
+ _LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, false> operator&() const
+ {return __bit_iterator<_C, false>(__seg_, static_cast<unsigned>(__ctz(__mask_)));}
+private:
+ _LIBCPP_INLINE_VISIBILITY
+ __bit_reference(__storage_pointer __s, __storage_type __m) : __seg_(__s), __mask_(__m) {}
+};
+
+template <class _C, class _D>
+_LIBCPP_INLINE_VISIBILITY inline
+void
+swap(__bit_reference<_C> __x, __bit_reference<_D> __y)
+{
+ bool __t = __x;
+ __x = __y;
+ __y = __t;
+}
+
+template <class _C>
+_LIBCPP_INLINE_VISIBILITY inline
+void
+swap(__bit_reference<_C> __x, bool& __y)
+{
+ bool __t = __x;
+ __x = __y;
+ __y = __t;
+}
+
+template <class _C>
+_LIBCPP_INLINE_VISIBILITY inline
+void
+swap(bool& __x, __bit_reference<_C> __y)
+{
+ bool __t = __x;
+ __x = __y;
+ __y = __t;
+}
+
+template <class _C>
+class __bit_const_reference
+{
+ typedef typename _C::__storage_type __storage_type;
+ typedef typename _C::__const_storage_pointer __storage_pointer;
+
+ __storage_pointer __seg_;
+ __storage_type __mask_;
+
+#if defined(__clang__)
+ friend typename _C::__self;
+#else
+ friend class _C::__self;
+#endif
+ friend class __bit_iterator<_C, true>;
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ __bit_const_reference(const __bit_reference<_C>& __x)
+ : __seg_(__x.__seg_), __mask_(__x.__mask_) {}
+
+ _LIBCPP_INLINE_VISIBILITY operator bool() const {return static_cast<bool>(*__seg_ & __mask_);}
+
+ _LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, true> operator&() const
+ {return __bit_iterator<_C, true>(__seg_, static_cast<unsigned>(__ctz(__mask_)));}
+private:
+ _LIBCPP_INLINE_VISIBILITY
+ __bit_const_reference(__storage_pointer __s, __storage_type __m) : __seg_(__s), __mask_(__m) {}
+
+ __bit_const_reference& operator=(const __bit_const_reference& __x);
+};
+
+// find
+
+template <class _C>
+__bit_iterator<_C, false>
+__find_bool_true(__bit_iterator<_C, false> __first, typename _C::size_type __n)
+{
+ typedef __bit_iterator<_C, false> _It;
+ typedef typename _It::__storage_type __storage_type;
+ static const unsigned __bits_per_word = _It::__bits_per_word;
+ // do first partial word
+ if (__first.__ctz_ != 0)
+ {
+ __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
+ __storage_type __dn = _STD::min(__clz_f, __n);
+ __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
+ __storage_type __b = *__first.__seg_ & __m;
+ if (__b)
+ return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
+ __n -= __dn;
+ ++__first.__seg_;
+ }
+ // do middle whole words
+ for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
+ if (*__first.__seg_)
+ return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(*__first.__seg_)));
+ // do last partial word
+ if (__n > 0)
+ {
+ __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
+ __storage_type __b = *__first.__seg_ & __m;
+ if (__b)
+ return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
+ }
+ return _It(__first.__seg_, static_cast<unsigned>(__n));
+}
+
+template <class _C>
+__bit_iterator<_C, false>
+__find_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n)
+{
+ typedef __bit_iterator<_C, false> _It;
+ typedef typename _It::__storage_type __storage_type;
+ static const unsigned __bits_per_word = _It::__bits_per_word;
+ // do first partial word
+ if (__first.__ctz_ != 0)
+ {
+ __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
+ __storage_type __dn = _STD::min(__clz_f, __n);
+ __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
+ __storage_type __b = ~(*__first.__seg_ & __m);
+ if (__b)
+ return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
+ __n -= __dn;
+ ++__first.__seg_;
+ }
+ // do middle whole words
+ for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
+ {
+ __storage_type __b = ~*__first.__seg_;
+ if (__b)
+ return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
+ }
+ // do last partial word
+ if (__n > 0)
+ {
+ __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
+ __storage_type __b = ~(*__first.__seg_ & __m);
+ if (__b)
+ return _It(__first.__seg_, static_cast<unsigned>(_STD::__ctz(__b)));
+ }
+ return _It(__first.__seg_, static_cast<unsigned>(__n));
+}
+
+template <class _C, class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+__bit_iterator<_C, false>
+find(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __last, const _Tp& __value)
+{
+ if (static_cast<bool>(__value))
+ return __find_bool_true(__first, static_cast<typename _C::size_type>(__last - __first));
+ return __find_bool_false(__first, static_cast<typename _C::size_type>(__last - __first));
+}
+
+// count
+
+template <class _C>
+typename __bit_iterator<_C, false>::difference_type
+__count_bool_true(__bit_iterator<_C, false> __first, typename _C::size_type __n)
+{
+ typedef __bit_iterator<_C, false> _It;
+ typedef typename _It::__storage_type __storage_type;
+ typedef typename _It::difference_type difference_type;
+ static const unsigned __bits_per_word = _It::__bits_per_word;
+ difference_type __r = 0;
+ // do first partial word
+ if (__first.__ctz_ != 0)
+ {
+ __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
+ __storage_type __dn = _STD::min(__clz_f, __n);
+ __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
+ __r = _STD::__pop_count(*__first.__seg_ & __m);
+ __n -= __dn;
+ ++__first.__seg_;
+ }
+ // do middle whole words
+ for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
+ __r += _STD::__pop_count(*__first.__seg_);
+ // do last partial word
+ if (__n > 0)
+ {
+ __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
+ __r += _STD::__pop_count(*__first.__seg_ & __m);
+ }
+ return __r;
+}
+
+template <class _C>
+typename __bit_iterator<_C, false>::difference_type
+__count_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n)
+{
+ typedef __bit_iterator<_C, false> _It;
+ typedef typename _It::__storage_type __storage_type;
+ typedef typename _It::difference_type difference_type;
+ static const unsigned __bits_per_word = _It::__bits_per_word;
+ difference_type __r = 0;
+ // do first partial word
+ if (__first.__ctz_ != 0)
+ {
+ __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
+ __storage_type __dn = _STD::min(__clz_f, __n);
+ __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
+ __r = _STD::__pop_count(~(*__first.__seg_ & __m));
+ __n -= __dn;
+ ++__first.__seg_;
+ }
+ // do middle whole words
+ for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
+ __r += _STD::__pop_count(~*__first.__seg_);
+ // do last partial word
+ if (__n > 0)
+ {
+ __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
+ __r += _STD::__pop_count(~(*__first.__seg_ & __m));
+ }
+ return __r;
+}
+
+template <class _C, class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+typename __bit_iterator<_C, false>::difference_type
+count(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __last, const _Tp& __value)
+{
+ if (static_cast<bool>(__value))
+ return __count_bool_true(__first, static_cast<typename _C::size_type>(__last - __first));
+ return __count_bool_false(__first, static_cast<typename _C::size_type>(__last - __first));
+}
+
+// fill_n
+
+template <class _C>
+void
+__fill_n_false(__bit_iterator<_C, false> __first, typename _C::size_type __n)
+{
+ typedef __bit_iterator<_C, false> _It;
+ typedef typename _It::__storage_type __storage_type;
+ static const unsigned __bits_per_word = _It::__bits_per_word;
+ // do first partial word
+ if (__first.__ctz_ != 0)
+ {
+ __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
+ __storage_type __dn = _STD::min(__clz_f, __n);
+ __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
+ *__first.__seg_ &= ~__m;
+ __n -= __dn;
+ ++__first.__seg_;
+ }
+ // do middle whole words
+ __storage_type __nw = __n / __bits_per_word;
+ _STD::memset(__first.__seg_, 0, __nw * sizeof(__storage_type));
+ __n -= __nw * __bits_per_word;
+ // do last partial word
+ if (__n > 0)
+ {
+ __first.__seg_ += __nw;
+ __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
+ *__first.__seg_ &= ~__m;