Author: ericwf Date: Thu Apr 28 23:07:45 2016 New Revision: 267981 URL: http://llvm.org/viewvc/llvm-project?rev=267981&view=rev Log: Fix or move various non-standard tests.
This patch does the following: * Remove <__config> includes from some container tests. * Guards uses of std::launch::any in async tests because it's an extension. * Move "test/std/extensions" to "test/libcxx/extensions" * Moves various non-standard tests including those in "sequences/vector", "std/localization" and "utilities/meta". Added: libcxx/trunk/test/libcxx/containers/sequences/vector/const_value_type.pass.cpp libcxx/trunk/test/libcxx/containers/sequences/vector/db_back.pass.cpp libcxx/trunk/test/libcxx/containers/sequences/vector/db_cback.pass.cpp libcxx/trunk/test/libcxx/containers/sequences/vector/db_cfront.pass.cpp libcxx/trunk/test/libcxx/containers/sequences/vector/db_cindex.pass.cpp libcxx/trunk/test/libcxx/containers/sequences/vector/db_front.pass.cpp libcxx/trunk/test/libcxx/containers/sequences/vector/db_index.pass.cpp libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_2.pass.cpp libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_3.pass.cpp libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_4.pass.cpp libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_5.pass.cpp libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_6.pass.cpp libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_7.pass.cpp libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_8.pass.cpp libcxx/trunk/test/libcxx/extensions/ libcxx/trunk/test/libcxx/extensions/hash/ libcxx/trunk/test/libcxx/extensions/hash/specializations.fail.cpp libcxx/trunk/test/libcxx/extensions/hash/specializations.pass.cpp libcxx/trunk/test/libcxx/extensions/hash_map/ libcxx/trunk/test/libcxx/extensions/hash_map/const_iterator.fail.cpp libcxx/trunk/test/libcxx/extensions/nothing_to_do.pass.cpp libcxx/trunk/test/libcxx/localization/ libcxx/trunk/test/libcxx/localization/locale.categories/ libcxx/trunk/test/libcxx/localization/locale.categories/__scan_keyword.pass.cpp libcxx/trunk/test/libcxx/localization/locales/ libcxx/trunk/test/libcxx/localization/locales/locale/ libcxx/trunk/test/libcxx/localization/locales/locale/locale.types/ libcxx/trunk/test/libcxx/localization/locales/locale/locale.types/locale.facet/ libcxx/trunk/test/libcxx/localization/locales/locale/locale.types/locale.facet/facet.pass.cpp libcxx/trunk/test/libcxx/localization/locales/locale/locale.types/locale.id/ libcxx/trunk/test/libcxx/localization/locales/locale/locale.types/locale.id/id.pass.cpp libcxx/trunk/test/libcxx/utilities/meta/meta.unary/ libcxx/trunk/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/ libcxx/trunk/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/__has_operator_addressof.pass.cpp libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.facet/tested_elsewhere.pass.cpp libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.id/tested_elsewhere.pass.cpp Removed: libcxx/trunk/test/std/containers/sequences/vector/const_value_type.pass.cpp libcxx/trunk/test/std/containers/sequences/vector/db_back.pass.cpp libcxx/trunk/test/std/containers/sequences/vector/db_cback.pass.cpp libcxx/trunk/test/std/containers/sequences/vector/db_cfront.pass.cpp libcxx/trunk/test/std/containers/sequences/vector/db_cindex.pass.cpp libcxx/trunk/test/std/containers/sequences/vector/db_front.pass.cpp libcxx/trunk/test/std/containers/sequences/vector/db_index.pass.cpp libcxx/trunk/test/std/containers/sequences/vector/db_iterators_2.pass.cpp libcxx/trunk/test/std/containers/sequences/vector/db_iterators_3.pass.cpp libcxx/trunk/test/std/containers/sequences/vector/db_iterators_4.pass.cpp libcxx/trunk/test/std/containers/sequences/vector/db_iterators_5.pass.cpp libcxx/trunk/test/std/containers/sequences/vector/db_iterators_6.pass.cpp libcxx/trunk/test/std/containers/sequences/vector/db_iterators_7.pass.cpp libcxx/trunk/test/std/containers/sequences/vector/db_iterators_8.pass.cpp libcxx/trunk/test/std/extensions/ libcxx/trunk/test/std/localization/locale.categories/__scan_keyword.pass.cpp libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.facet/facet.pass.cpp libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.id/id.pass.cpp libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/__has_operator_addressof.pass.cpp Modified: libcxx/trunk/test/std/containers/associative/map/map.modifiers/insert_or_assign.pass.cpp libcxx/trunk/test/std/containers/associative/map/map.modifiers/try.emplace.pass.cpp libcxx/trunk/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass libcxx/trunk/test/std/strings/c.strings/cwchar.pass.cpp libcxx/trunk/test/std/thread/futures/futures.async/async.pass.cpp libcxx/trunk/test/std/thread/futures/futures.overview/launch.pass.cpp libcxx/trunk/test/support/asan_testing.h Added: libcxx/trunk/test/libcxx/containers/sequences/vector/const_value_type.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/vector/const_value_type.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/containers/sequences/vector/const_value_type.pass.cpp (added) +++ libcxx/trunk/test/libcxx/containers/sequences/vector/const_value_type.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,22 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <vector> + +// vector<const int> v; // an extension + +#include <vector> +#include <type_traits> + +int main() +{ + std::vector<const int> v = {1, 2, 3}; +} Added: libcxx/trunk/test/libcxx/containers/sequences/vector/db_back.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/vector/db_back.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/containers/sequences/vector/db_back.pass.cpp (added) +++ libcxx/trunk/test/libcxx/containers/sequences/vector/db_back.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,56 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <vector> + +// Call back() on empty container. + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include <vector> +#include <cassert> +#include <iterator> +#include <exception> +#include <cstdlib> + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::vector<T> C; + C c(1); + assert(c.back() == 0); + c.clear(); + assert(c.back() == 0); + assert(false); + } +#if __cplusplus >= 201103L + { + typedef int T; + typedef std::vector<T, min_allocator<T>> C; + C c(1); + assert(c.back() == 0); + c.clear(); + assert(c.back() == 0); + assert(false); + } +#endif +} + +#else + +int main() +{ +} + +#endif Added: libcxx/trunk/test/libcxx/containers/sequences/vector/db_cback.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/vector/db_cback.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/containers/sequences/vector/db_cback.pass.cpp (added) +++ libcxx/trunk/test/libcxx/containers/sequences/vector/db_cback.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,52 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <vector> + +// Call back() on empty const container. + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include <vector> +#include <cassert> +#include <iterator> +#include <exception> +#include <cstdlib> + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::vector<T> C; + const C c; + assert(c.back() == 0); + assert(false); + } +#if __cplusplus >= 201103L + { + typedef int T; + typedef std::vector<T, min_allocator<T>> C; + const C c; + assert(c.back() == 0); + assert(false); + } +#endif +} + +#else + +int main() +{ +} + +#endif Added: libcxx/trunk/test/libcxx/containers/sequences/vector/db_cfront.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/vector/db_cfront.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/containers/sequences/vector/db_cfront.pass.cpp (added) +++ libcxx/trunk/test/libcxx/containers/sequences/vector/db_cfront.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,52 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <vector> + +// Call front() on empty const container. + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include <vector> +#include <cassert> +#include <iterator> +#include <exception> +#include <cstdlib> + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::vector<T> C; + const C c; + assert(c.front() == 0); + assert(false); + } +#if __cplusplus >= 201103L + { + typedef int T; + typedef std::vector<T, min_allocator<T>> C; + const C c; + assert(c.front() == 0); + assert(false); + } +#endif +} + +#else + +int main() +{ +} + +#endif Added: libcxx/trunk/test/libcxx/containers/sequences/vector/db_cindex.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/vector/db_cindex.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/containers/sequences/vector/db_cindex.pass.cpp (added) +++ libcxx/trunk/test/libcxx/containers/sequences/vector/db_cindex.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,54 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <vector> + +// Index const vector out of bounds. + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include <vector> +#include <cassert> +#include <iterator> +#include <exception> +#include <cstdlib> + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::vector<T> C; + const C c(1); + assert(c[0] == 0); + assert(c[1] == 0); + assert(false); + } +#if __cplusplus >= 201103L + { + typedef int T; + typedef std::vector<T, min_allocator<T>> C; + const C c(1); + assert(c[0] == 0); + assert(c[1] == 0); + assert(false); + } +#endif +} + +#else + +int main() +{ +} + +#endif Added: libcxx/trunk/test/libcxx/containers/sequences/vector/db_front.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/vector/db_front.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/containers/sequences/vector/db_front.pass.cpp (added) +++ libcxx/trunk/test/libcxx/containers/sequences/vector/db_front.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,56 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <vector> + +// Call front() on empty container. + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include <vector> +#include <cassert> +#include <iterator> +#include <exception> +#include <cstdlib> + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::vector<T> C; + C c(1); + assert(c.front() == 0); + c.clear(); + assert(c.front() == 0); + assert(false); + } +#if __cplusplus >= 201103L + { + typedef int T; + typedef std::vector<T, min_allocator<T>> C; + C c(1); + assert(c.front() == 0); + c.clear(); + assert(c.front() == 0); + assert(false); + } +#endif +} + +#else + +int main() +{ +} + +#endif Added: libcxx/trunk/test/libcxx/containers/sequences/vector/db_index.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/vector/db_index.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/containers/sequences/vector/db_index.pass.cpp (added) +++ libcxx/trunk/test/libcxx/containers/sequences/vector/db_index.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,56 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <vector> + +// Index vector out of bounds. + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include <vector> +#include <cassert> +#include <iterator> +#include <exception> +#include <cstdlib> + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::vector<T> C; + C c(1); + assert(c[0] == 0); + c.clear(); + assert(c[0] == 0); + assert(false); + } +#if __cplusplus >= 201103L + { + typedef int T; + typedef std::vector<T, min_allocator<T>> C; + C c(1); + assert(c[0] == 0); + c.clear(); + assert(c[0] == 0); + assert(false); + } +#endif +} + +#else + +int main() +{ +} + +#endif Added: libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_2.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_2.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_2.pass.cpp (added) +++ libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_2.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,54 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <vector> + +// Compare iterators from different containers with <. + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include <vector> +#include <cassert> +#include <iterator> +#include <exception> +#include <cstdlib> + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::vector<T> C; + C c1; + C c2; + bool b = c1.begin() < c2.begin(); + assert(false); + } +#if __cplusplus >= 201103L + { + typedef int T; + typedef std::vector<T, min_allocator<T>> C; + C c1; + C c2; + bool b = c1.begin() < c2.begin(); + assert(false); + } +#endif +} + +#else + +int main() +{ +} + +#endif Added: libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_3.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_3.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_3.pass.cpp (added) +++ libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_3.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,54 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <vector> + +// Subtract iterators from different containers. + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include <vector> +#include <cassert> +#include <iterator> +#include <exception> +#include <cstdlib> + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::vector<T> C; + C c1; + C c2; + int i = c1.begin() - c2.begin(); + assert(false); + } +#if __cplusplus >= 201103L + { + typedef int T; + typedef std::vector<T, min_allocator<T>> C; + C c1; + C c2; + int i = c1.begin() - c2.begin(); + assert(false); + } +#endif +} + +#else + +int main() +{ +} + +#endif Added: libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_4.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_4.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_4.pass.cpp (added) +++ libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_4.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,56 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <vector> + +// Index iterator out of bounds. + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include <vector> +#include <cassert> +#include <iterator> +#include <exception> +#include <cstdlib> + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::vector<T> C; + C c(1); + C::iterator i = c.begin(); + assert(i[0] == 0); + assert(i[1] == 0); + assert(false); + } +#if __cplusplus >= 201103L + { + typedef int T; + typedef std::vector<T, min_allocator<T>> C; + C c(1); + C::iterator i = c.begin(); + assert(i[0] == 0); + assert(i[1] == 0); + assert(false); + } +#endif +} + +#else + +int main() +{ +} + +#endif Added: libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_5.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_5.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_5.pass.cpp (added) +++ libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_5.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,60 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <vector> + +// Add to iterator out of bounds. + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include <vector> +#include <cassert> +#include <iterator> +#include <exception> +#include <cstdlib> + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::vector<T> C; + C c(1); + C::iterator i = c.begin(); + i += 1; + assert(i == c.end()); + i = c.begin(); + i += 2; + assert(false); + } +#if __cplusplus >= 201103L + { + typedef int T; + typedef std::vector<T, min_allocator<T>> C; + C c(1); + C::iterator i = c.begin(); + i += 1; + assert(i == c.end()); + i = c.begin(); + i += 2; + assert(false); + } +#endif +} + +#else + +int main() +{ +} + +#endif Added: libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_6.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_6.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_6.pass.cpp (added) +++ libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_6.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,58 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <vector> + +// Decrement iterator prior to begin. + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include <vector> +#include <cassert> +#include <iterator> +#include <exception> +#include <cstdlib> + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::vector<T> C; + C c(1); + C::iterator i = c.end(); + --i; + assert(i == c.begin()); + --i; + assert(false); + } +#if __cplusplus >= 201103L + { + typedef int T; + typedef std::vector<T, min_allocator<T>> C; + C c(1); + C::iterator i = c.end(); + --i; + assert(i == c.begin()); + --i; + assert(false); + } +#endif +} + +#else + +int main() +{ +} + +#endif Added: libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_7.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_7.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_7.pass.cpp (added) +++ libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_7.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,58 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <vector> + +// Increment iterator past end. + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include <vector> +#include <cassert> +#include <iterator> +#include <exception> +#include <cstdlib> + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::vector<T> C; + C c(1); + C::iterator i = c.begin(); + ++i; + assert(i == c.end()); + ++i; + assert(false); + } +#if __cplusplus >= 201103L + { + typedef int T; + typedef std::vector<T, min_allocator<T>> C; + C c(1); + C::iterator i = c.begin(); + ++i; + assert(i == c.end()); + ++i; + assert(false); + } +#endif +} + +#else + +int main() +{ +} + +#endif Added: libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_8.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_8.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_8.pass.cpp (added) +++ libcxx/trunk/test/libcxx/containers/sequences/vector/db_iterators_8.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,54 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <vector> + +// Dereference non-dereferenceable iterator. + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include <vector> +#include <cassert> +#include <iterator> +#include <exception> +#include <cstdlib> + +#include "min_allocator.h" + +int main() +{ + { + typedef int T; + typedef std::vector<T> C; + C c(1); + C::iterator i = c.end(); + T j = *i; + assert(false); + } +#if __cplusplus >= 201103L + { + typedef int T; + typedef std::vector<T, min_allocator<T>> C; + C c(1); + C::iterator i = c.end(); + T j = *i; + assert(false); + } +#endif +} + +#else + +int main() +{ +} + +#endif Added: libcxx/trunk/test/libcxx/extensions/hash/specializations.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/extensions/hash/specializations.fail.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/extensions/hash/specializations.fail.cpp (added) +++ libcxx/trunk/test/libcxx/extensions/hash/specializations.fail.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,17 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +#include <assert.h> +#include <ext/hash_map> +#include <string> + +int main() +{ + assert(__gnu_cxx::hash<std::string>()(std::string()) == 0); // error +} Added: libcxx/trunk/test/libcxx/extensions/hash/specializations.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/extensions/hash/specializations.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/extensions/hash/specializations.pass.cpp (added) +++ libcxx/trunk/test/libcxx/extensions/hash/specializations.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,31 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// NOTE: Undefined __DEPRECATED to prevent this test from failing with -Werror +#undef __DEPRECATED +#include <assert.h> +#include <ext/hash_map> +#include <string> + +int main() +{ + char str[] = "test"; + assert(__gnu_cxx::hash<const char *>()("test") == + std::hash<std::string>()("test")); + assert(__gnu_cxx::hash<char *>()(str) == std::hash<std::string>()("test")); + assert(__gnu_cxx::hash<char>()(42) == 42); + assert(__gnu_cxx::hash<signed char>()(42) == 42); + assert(__gnu_cxx::hash<unsigned char>()(42) == 42); + assert(__gnu_cxx::hash<short>()(42) == 42); + assert(__gnu_cxx::hash<unsigned short>()(42) == 42); + assert(__gnu_cxx::hash<int>()(42) == 42); + assert(__gnu_cxx::hash<unsigned int>()(42) == 42); + assert(__gnu_cxx::hash<long>()(42) == 42); + assert(__gnu_cxx::hash<unsigned long>()(42) == 42); +} Added: libcxx/trunk/test/libcxx/extensions/hash_map/const_iterator.fail.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/extensions/hash_map/const_iterator.fail.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/extensions/hash_map/const_iterator.fail.cpp (added) +++ libcxx/trunk/test/libcxx/extensions/hash_map/const_iterator.fail.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,18 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +#include <ext/hash_map> + +int main() +{ + __gnu_cxx::hash_map<int, int> m; + m[1] = 1; + const __gnu_cxx::hash_map<int, int> &cm = m; + cm.find(1)->second = 2; // error +} Added: libcxx/trunk/test/libcxx/extensions/nothing_to_do.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/extensions/nothing_to_do.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/extensions/nothing_to_do.pass.cpp (added) +++ libcxx/trunk/test/libcxx/extensions/nothing_to_do.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,12 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +int main() +{ +} Added: libcxx/trunk/test/libcxx/localization/locale.categories/__scan_keyword.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/localization/locale.categories/__scan_keyword.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/localization/locale.categories/__scan_keyword.pass.cpp (added) +++ libcxx/trunk/test/libcxx/localization/locale.categories/__scan_keyword.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,118 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <locale> + +// Not a portable test + +// __scan_keyword +// Scans [__b, __e) until a match is found in the basic_strings range +// [__kb, __ke) or until it can be shown that there is no match in [__kb, __ke). +// __b will be incremented (visibly), consuming CharT until a match is found +// or proved to not exist. A keyword may be "", in which will match anything. +// If one keyword is a prefix of another, and the next CharT in the input +// might match another keyword, the algorithm will attempt to find the longest +// matching keyword. If the longer matching keyword ends up not matching, then +// no keyword match is found. If no keyword match is found, __ke is returned. +// Else an iterator pointing to the matching keyword is found. If more than +// one keyword matches, an iterator to the first matching keyword is returned. +// If on exit __b == __e, eofbit is set in __err. If __case_sensitive is false, +// __ct is used to force to lower case before comparing characters. +// Examples: +// Keywords: "a", "abb" +// If the input is "a", the first keyword matches and eofbit is set. +// If the input is "abc", no match is found and "ab" are consumed. +// +// template <class _InputIterator, class _ForwardIterator, class _Ctype> +// _ForwardIterator +// __scan_keyword(_InputIterator& __b, _InputIterator __e, +// _ForwardIterator __kb, _ForwardIterator __ke, +// const _Ctype& __ct, ios_base::iostate& __err, +// bool __case_sensitive = true); + +#include <locale> +#include <cassert> + +int main() +{ + const std::ctype<char>& ct = std::use_facet<std::ctype<char> >(std::locale::classic()); + std::ios_base::iostate err = std::ios_base::goodbit; + { + const char input[] = "a"; + const char* in = input; + std::string keys[] = {"a", "abb"}; + err = std::ios_base::goodbit; + std::string* k = std::__scan_keyword(in, input+sizeof(input)-1, + keys, keys+sizeof(keys)/sizeof(keys[0]), + ct, err); + assert(k - keys == 0); + assert(in == input+1); + assert(err == std::ios_base::eofbit); + } + { + const char input[] = "abc"; + const char* in = input; + std::string keys[] = {"a", "abb"}; + err = std::ios_base::goodbit; + std::string* k = std::__scan_keyword(in, input+sizeof(input)-1, + keys, keys+sizeof(keys)/sizeof(keys[0]), + ct, err); + assert(k - keys == 2); + assert(in == input+2); + assert(err == std::ios_base::failbit); + } + { + const char input[] = "abb"; + const char* in = input; + std::string keys[] = {"a", "abb"}; + err = std::ios_base::goodbit; + std::string* k = std::__scan_keyword(in, input+sizeof(input)-1, + keys, keys+sizeof(keys)/sizeof(keys[0]), + ct, err); + assert(k - keys == 1); + assert(in == input+3); + assert(err == std::ios_base::eofbit); + } + { + const char input[] = "Tue "; + const char* in = input; + std::string keys[] = {"Mon", "Monday", "Tue", "Tuesday"}; + err = std::ios_base::goodbit; + std::string* k = std::__scan_keyword(in, input+sizeof(input)-1, + keys, keys+sizeof(keys)/sizeof(keys[0]), + ct, err); + assert(k - keys == 2); + assert(in == input+3); + assert(err == std::ios_base::goodbit); + } + { + const char input[] = "tue "; + const char* in = input; + std::string keys[] = {"Mon", "Monday", "Tue", "Tuesday"}; + err = std::ios_base::goodbit; + std::string* k = std::__scan_keyword(in, input+sizeof(input)-1, + keys, keys+sizeof(keys)/sizeof(keys[0]), + ct, err); + assert(k - keys == 4); + assert(in == input+0); + assert(err == std::ios_base::failbit); + } + { + const char input[] = "tue "; + const char* in = input; + std::string keys[] = {"Mon", "Monday", "Tue", "Tuesday"}; + err = std::ios_base::goodbit; + std::string* k = std::__scan_keyword(in, input+sizeof(input)-1, + keys, keys+sizeof(keys)/sizeof(keys[0]), + ct, err, false); + assert(k - keys == 2); + assert(in == input+3); + assert(err == std::ios_base::goodbit); + } +} Added: libcxx/trunk/test/libcxx/localization/locales/locale/locale.types/locale.facet/facet.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/localization/locales/locale/locale.types/locale.facet/facet.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/localization/locales/locale/locale.types/locale.facet/facet.pass.cpp (added) +++ libcxx/trunk/test/libcxx/localization/locales/locale/locale.types/locale.facet/facet.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,53 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <locale> + +// class locale::facet +// { +// protected: +// explicit facet(size_t refs = 0); +// virtual ~facet(); +// facet(const facet&) = delete; +// void operator=(const facet&) = delete; +// }; + +// This test isn't portable + +#include <locale> +#include <cassert> + +struct my_facet + : public std::locale::facet +{ + static int count; + my_facet(unsigned refs = 0) + : std::locale::facet(refs) + {++count;} + + ~my_facet() {--count;} +}; + +int my_facet::count = 0; + +int main() +{ + my_facet* f = new my_facet; + f->__add_shared(); + assert(my_facet::count == 1); + f->__release_shared(); + assert(my_facet::count == 0); + f = new my_facet(1); + f->__add_shared(); + assert(my_facet::count == 1); + f->__release_shared(); + assert(my_facet::count == 1); + f->__release_shared(); + assert(my_facet::count == 0); +} Added: libcxx/trunk/test/libcxx/localization/locales/locale/locale.types/locale.id/id.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/localization/locales/locale/locale.types/locale.id/id.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/localization/locales/locale/locale.types/locale.id/id.pass.cpp (added) +++ libcxx/trunk/test/libcxx/localization/locales/locale/locale.types/locale.id/id.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,50 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <locale> + +// class locale::id +// { +// public: +// id(); +// void operator=(const id&) = delete; +// id(const id&) = delete; +// }; + +// This test isn't portable + +#include <locale> +#include <cassert> + +std::locale::id id0; +std::locale::id id2; +std::locale::id id1; + +int main() +{ + long id = id0.__get(); + assert(id0.__get() == id+0); + assert(id0.__get() == id+0); + assert(id0.__get() == id+0); + assert(id1.__get() == id+1); + assert(id1.__get() == id+1); + assert(id1.__get() == id+1); + assert(id2.__get() == id+2); + assert(id2.__get() == id+2); + assert(id2.__get() == id+2); + assert(id0.__get() == id+0); + assert(id0.__get() == id+0); + assert(id0.__get() == id+0); + assert(id1.__get() == id+1); + assert(id1.__get() == id+1); + assert(id1.__get() == id+1); + assert(id2.__get() == id+2); + assert(id2.__get() == id+2); + assert(id2.__get() == id+2); +} Added: libcxx/trunk/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/__has_operator_addressof.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/__has_operator_addressof.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/__has_operator_addressof.pass.cpp (added) +++ libcxx/trunk/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/__has_operator_addressof.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,71 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// extension + +// template <typename _Tp> struct __has_operator_addressof + + +#include <type_traits> + +#ifndef _LIBCPP_HAS_NO_CONSTEXPR + +struct A +{ +}; + +struct B +{ + constexpr B* operator&() const; +}; + +struct D; + +struct C +{ + template <class U> + D operator,(U&&); +}; + +struct E +{ + constexpr C operator&() const; +}; + +struct F {}; +constexpr F* operator&(F const &) { return nullptr; } + +struct G {}; +constexpr G* operator&(G &&) { return nullptr; } + +struct H {}; +constexpr H* operator&(H const &&) { return nullptr; } + +struct J +{ + constexpr J* operator&() const &&; +}; + +#endif // _LIBCPP_HAS_NO_CONSTEXPR + +int main() +{ +#ifndef _LIBCPP_HAS_NO_CONSTEXPR + static_assert(std::__has_operator_addressof<int>::value == false, ""); + static_assert(std::__has_operator_addressof<A>::value == false, ""); + static_assert(std::__has_operator_addressof<B>::value == true, ""); + static_assert(std::__has_operator_addressof<E>::value == true, ""); + static_assert(std::__has_operator_addressof<F>::value == true, ""); + static_assert(std::__has_operator_addressof<G>::value == true, ""); + static_assert(std::__has_operator_addressof<H>::value == true, ""); + static_assert(std::__has_operator_addressof<J>::value == true, ""); +#endif // _LIBCPP_HAS_NO_CONSTEXPR +} Modified: libcxx/trunk/test/std/containers/associative/map/map.modifiers/insert_or_assign.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.modifiers/insert_or_assign.pass.cpp?rev=267981&r1=267980&r2=267981&view=diff ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.modifiers/insert_or_assign.pass.cpp (original) +++ libcxx/trunk/test/std/containers/associative/map/map.modifiers/insert_or_assign.pass.cpp Thu Apr 28 23:07:45 2016 @@ -22,7 +22,6 @@ // template <class M> // iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj); // C++17 -#include <__config> #include <map> #include <cassert> #include <tuple> @@ -60,9 +59,6 @@ public: int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -#ifndef _LIBCPP_HAS_NO_VARIADICS - { // pair<iterator, bool> insert_or_assign(const key_type& k, M&& obj); typedef std::map<int, Moveable> M; typedef std::pair<M::iterator, bool> R; @@ -186,7 +182,4 @@ int main() assert(r->first.get() == 3); // key assert(r->second.get() == 5); // value } - -#endif // _LIBCPP_HAS_NO_VARIADICS -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } \ No newline at end of file Modified: libcxx/trunk/test/std/containers/associative/map/map.modifiers/try.emplace.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.modifiers/try.emplace.pass.cpp?rev=267981&r1=267980&r2=267981&view=diff ============================================================================== --- libcxx/trunk/test/std/containers/associative/map/map.modifiers/try.emplace.pass.cpp (original) +++ libcxx/trunk/test/std/containers/associative/map/map.modifiers/try.emplace.pass.cpp Thu Apr 28 23:07:45 2016 @@ -22,7 +22,6 @@ // template <class... Args> // iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args); // C++17 -#include <__config> #include <map> #include <cassert> #include <tuple> @@ -58,9 +57,6 @@ public: int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -#ifndef _LIBCPP_HAS_NO_VARIADICS - { // pair<iterator, bool> try_emplace(const key_type& k, Args&&... args); typedef std::map<int, Moveable> M; typedef std::pair<M::iterator, bool> R; @@ -183,7 +179,4 @@ int main() assert(r->first.get() == 3); // key assert(r->second.get() == 4); // value } - -#endif // _LIBCPP_HAS_NO_VARIADICS -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } Removed: libcxx/trunk/test/std/containers/sequences/vector/const_value_type.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/const_value_type.pass.cpp?rev=267980&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/sequences/vector/const_value_type.pass.cpp (original) +++ libcxx/trunk/test/std/containers/sequences/vector/const_value_type.pass.cpp (removed) @@ -1,22 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <vector> - -// vector<const int> v; // an extension - -#include <vector> -#include <type_traits> - -int main() -{ -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - std::vector<const int> v = {1, 2, 3}; -#endif -} Removed: libcxx/trunk/test/std/containers/sequences/vector/db_back.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/db_back.pass.cpp?rev=267980&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/sequences/vector/db_back.pass.cpp (original) +++ libcxx/trunk/test/std/containers/sequences/vector/db_back.pass.cpp (removed) @@ -1,56 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <vector> - -// Call back() on empty container. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include <vector> -#include <cassert> -#include <iterator> -#include <exception> -#include <cstdlib> - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::vector<T> C; - C c(1); - assert(c.back() == 0); - c.clear(); - assert(c.back() == 0); - assert(false); - } -#if __cplusplus >= 201103L - { - typedef int T; - typedef std::vector<T, min_allocator<T>> C; - C c(1); - assert(c.back() == 0); - c.clear(); - assert(c.back() == 0); - assert(false); - } -#endif -} - -#else - -int main() -{ -} - -#endif Removed: libcxx/trunk/test/std/containers/sequences/vector/db_cback.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/db_cback.pass.cpp?rev=267980&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/sequences/vector/db_cback.pass.cpp (original) +++ libcxx/trunk/test/std/containers/sequences/vector/db_cback.pass.cpp (removed) @@ -1,52 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <vector> - -// Call back() on empty const container. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include <vector> -#include <cassert> -#include <iterator> -#include <exception> -#include <cstdlib> - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::vector<T> C; - const C c; - assert(c.back() == 0); - assert(false); - } -#if __cplusplus >= 201103L - { - typedef int T; - typedef std::vector<T, min_allocator<T>> C; - const C c; - assert(c.back() == 0); - assert(false); - } -#endif -} - -#else - -int main() -{ -} - -#endif Removed: libcxx/trunk/test/std/containers/sequences/vector/db_cfront.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/db_cfront.pass.cpp?rev=267980&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/sequences/vector/db_cfront.pass.cpp (original) +++ libcxx/trunk/test/std/containers/sequences/vector/db_cfront.pass.cpp (removed) @@ -1,52 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <vector> - -// Call front() on empty const container. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include <vector> -#include <cassert> -#include <iterator> -#include <exception> -#include <cstdlib> - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::vector<T> C; - const C c; - assert(c.front() == 0); - assert(false); - } -#if __cplusplus >= 201103L - { - typedef int T; - typedef std::vector<T, min_allocator<T>> C; - const C c; - assert(c.front() == 0); - assert(false); - } -#endif -} - -#else - -int main() -{ -} - -#endif Removed: libcxx/trunk/test/std/containers/sequences/vector/db_cindex.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/db_cindex.pass.cpp?rev=267980&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/sequences/vector/db_cindex.pass.cpp (original) +++ libcxx/trunk/test/std/containers/sequences/vector/db_cindex.pass.cpp (removed) @@ -1,54 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <vector> - -// Index const vector out of bounds. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include <vector> -#include <cassert> -#include <iterator> -#include <exception> -#include <cstdlib> - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::vector<T> C; - const C c(1); - assert(c[0] == 0); - assert(c[1] == 0); - assert(false); - } -#if __cplusplus >= 201103L - { - typedef int T; - typedef std::vector<T, min_allocator<T>> C; - const C c(1); - assert(c[0] == 0); - assert(c[1] == 0); - assert(false); - } -#endif -} - -#else - -int main() -{ -} - -#endif Removed: libcxx/trunk/test/std/containers/sequences/vector/db_front.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/db_front.pass.cpp?rev=267980&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/sequences/vector/db_front.pass.cpp (original) +++ libcxx/trunk/test/std/containers/sequences/vector/db_front.pass.cpp (removed) @@ -1,56 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <vector> - -// Call front() on empty container. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include <vector> -#include <cassert> -#include <iterator> -#include <exception> -#include <cstdlib> - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::vector<T> C; - C c(1); - assert(c.front() == 0); - c.clear(); - assert(c.front() == 0); - assert(false); - } -#if __cplusplus >= 201103L - { - typedef int T; - typedef std::vector<T, min_allocator<T>> C; - C c(1); - assert(c.front() == 0); - c.clear(); - assert(c.front() == 0); - assert(false); - } -#endif -} - -#else - -int main() -{ -} - -#endif Removed: libcxx/trunk/test/std/containers/sequences/vector/db_index.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/db_index.pass.cpp?rev=267980&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/sequences/vector/db_index.pass.cpp (original) +++ libcxx/trunk/test/std/containers/sequences/vector/db_index.pass.cpp (removed) @@ -1,56 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <vector> - -// Index vector out of bounds. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include <vector> -#include <cassert> -#include <iterator> -#include <exception> -#include <cstdlib> - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::vector<T> C; - C c(1); - assert(c[0] == 0); - c.clear(); - assert(c[0] == 0); - assert(false); - } -#if __cplusplus >= 201103L - { - typedef int T; - typedef std::vector<T, min_allocator<T>> C; - C c(1); - assert(c[0] == 0); - c.clear(); - assert(c[0] == 0); - assert(false); - } -#endif -} - -#else - -int main() -{ -} - -#endif Removed: libcxx/trunk/test/std/containers/sequences/vector/db_iterators_2.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/db_iterators_2.pass.cpp?rev=267980&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/sequences/vector/db_iterators_2.pass.cpp (original) +++ libcxx/trunk/test/std/containers/sequences/vector/db_iterators_2.pass.cpp (removed) @@ -1,54 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <vector> - -// Compare iterators from different containers with <. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include <vector> -#include <cassert> -#include <iterator> -#include <exception> -#include <cstdlib> - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::vector<T> C; - C c1; - C c2; - bool b = c1.begin() < c2.begin(); - assert(false); - } -#if __cplusplus >= 201103L - { - typedef int T; - typedef std::vector<T, min_allocator<T>> C; - C c1; - C c2; - bool b = c1.begin() < c2.begin(); - assert(false); - } -#endif -} - -#else - -int main() -{ -} - -#endif Removed: libcxx/trunk/test/std/containers/sequences/vector/db_iterators_3.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/db_iterators_3.pass.cpp?rev=267980&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/sequences/vector/db_iterators_3.pass.cpp (original) +++ libcxx/trunk/test/std/containers/sequences/vector/db_iterators_3.pass.cpp (removed) @@ -1,54 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <vector> - -// Subtract iterators from different containers. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include <vector> -#include <cassert> -#include <iterator> -#include <exception> -#include <cstdlib> - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::vector<T> C; - C c1; - C c2; - int i = c1.begin() - c2.begin(); - assert(false); - } -#if __cplusplus >= 201103L - { - typedef int T; - typedef std::vector<T, min_allocator<T>> C; - C c1; - C c2; - int i = c1.begin() - c2.begin(); - assert(false); - } -#endif -} - -#else - -int main() -{ -} - -#endif Removed: libcxx/trunk/test/std/containers/sequences/vector/db_iterators_4.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/db_iterators_4.pass.cpp?rev=267980&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/sequences/vector/db_iterators_4.pass.cpp (original) +++ libcxx/trunk/test/std/containers/sequences/vector/db_iterators_4.pass.cpp (removed) @@ -1,56 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <vector> - -// Index iterator out of bounds. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include <vector> -#include <cassert> -#include <iterator> -#include <exception> -#include <cstdlib> - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::vector<T> C; - C c(1); - C::iterator i = c.begin(); - assert(i[0] == 0); - assert(i[1] == 0); - assert(false); - } -#if __cplusplus >= 201103L - { - typedef int T; - typedef std::vector<T, min_allocator<T>> C; - C c(1); - C::iterator i = c.begin(); - assert(i[0] == 0); - assert(i[1] == 0); - assert(false); - } -#endif -} - -#else - -int main() -{ -} - -#endif Removed: libcxx/trunk/test/std/containers/sequences/vector/db_iterators_5.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/db_iterators_5.pass.cpp?rev=267980&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/sequences/vector/db_iterators_5.pass.cpp (original) +++ libcxx/trunk/test/std/containers/sequences/vector/db_iterators_5.pass.cpp (removed) @@ -1,60 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <vector> - -// Add to iterator out of bounds. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include <vector> -#include <cassert> -#include <iterator> -#include <exception> -#include <cstdlib> - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::vector<T> C; - C c(1); - C::iterator i = c.begin(); - i += 1; - assert(i == c.end()); - i = c.begin(); - i += 2; - assert(false); - } -#if __cplusplus >= 201103L - { - typedef int T; - typedef std::vector<T, min_allocator<T>> C; - C c(1); - C::iterator i = c.begin(); - i += 1; - assert(i == c.end()); - i = c.begin(); - i += 2; - assert(false); - } -#endif -} - -#else - -int main() -{ -} - -#endif Removed: libcxx/trunk/test/std/containers/sequences/vector/db_iterators_6.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/db_iterators_6.pass.cpp?rev=267980&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/sequences/vector/db_iterators_6.pass.cpp (original) +++ libcxx/trunk/test/std/containers/sequences/vector/db_iterators_6.pass.cpp (removed) @@ -1,58 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <vector> - -// Decrement iterator prior to begin. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include <vector> -#include <cassert> -#include <iterator> -#include <exception> -#include <cstdlib> - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::vector<T> C; - C c(1); - C::iterator i = c.end(); - --i; - assert(i == c.begin()); - --i; - assert(false); - } -#if __cplusplus >= 201103L - { - typedef int T; - typedef std::vector<T, min_allocator<T>> C; - C c(1); - C::iterator i = c.end(); - --i; - assert(i == c.begin()); - --i; - assert(false); - } -#endif -} - -#else - -int main() -{ -} - -#endif Removed: libcxx/trunk/test/std/containers/sequences/vector/db_iterators_7.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/db_iterators_7.pass.cpp?rev=267980&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/sequences/vector/db_iterators_7.pass.cpp (original) +++ libcxx/trunk/test/std/containers/sequences/vector/db_iterators_7.pass.cpp (removed) @@ -1,58 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <vector> - -// Increment iterator past end. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include <vector> -#include <cassert> -#include <iterator> -#include <exception> -#include <cstdlib> - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::vector<T> C; - C c(1); - C::iterator i = c.begin(); - ++i; - assert(i == c.end()); - ++i; - assert(false); - } -#if __cplusplus >= 201103L - { - typedef int T; - typedef std::vector<T, min_allocator<T>> C; - C c(1); - C::iterator i = c.begin(); - ++i; - assert(i == c.end()); - ++i; - assert(false); - } -#endif -} - -#else - -int main() -{ -} - -#endif Removed: libcxx/trunk/test/std/containers/sequences/vector/db_iterators_8.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/db_iterators_8.pass.cpp?rev=267980&view=auto ============================================================================== --- libcxx/trunk/test/std/containers/sequences/vector/db_iterators_8.pass.cpp (original) +++ libcxx/trunk/test/std/containers/sequences/vector/db_iterators_8.pass.cpp (removed) @@ -1,54 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <vector> - -// Dereference non-dereferenceable iterator. - -#if _LIBCPP_DEBUG >= 1 - -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) - -#include <vector> -#include <cassert> -#include <iterator> -#include <exception> -#include <cstdlib> - -#include "min_allocator.h" - -int main() -{ - { - typedef int T; - typedef std::vector<T> C; - C c(1); - C::iterator i = c.end(); - T j = *i; - assert(false); - } -#if __cplusplus >= 201103L - { - typedef int T; - typedef std::vector<T, min_allocator<T>> C; - C c(1); - C::iterator i = c.end(); - T j = *i; - assert(false); - } -#endif -} - -#else - -int main() -{ -} - -#endif Modified: libcxx/trunk/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass?rev=267981&r1=267980&r2=267981&view=diff ============================================================================== --- libcxx/trunk/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass (original) +++ libcxx/trunk/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass Thu Apr 28 23:07:45 2016 @@ -22,6 +22,7 @@ // Testing to make sure that the max length values are correctly inserted #include <iostream> +#include <cctype> #include <sstream> #include <cassert> Removed: libcxx/trunk/test/std/localization/locale.categories/__scan_keyword.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/__scan_keyword.pass.cpp?rev=267980&view=auto ============================================================================== --- libcxx/trunk/test/std/localization/locale.categories/__scan_keyword.pass.cpp (original) +++ libcxx/trunk/test/std/localization/locale.categories/__scan_keyword.pass.cpp (removed) @@ -1,118 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <locale> - -// Not a portable test - -// __scan_keyword -// Scans [__b, __e) until a match is found in the basic_strings range -// [__kb, __ke) or until it can be shown that there is no match in [__kb, __ke). -// __b will be incremented (visibly), consuming CharT until a match is found -// or proved to not exist. A keyword may be "", in which will match anything. -// If one keyword is a prefix of another, and the next CharT in the input -// might match another keyword, the algorithm will attempt to find the longest -// matching keyword. If the longer matching keyword ends up not matching, then -// no keyword match is found. If no keyword match is found, __ke is returned. -// Else an iterator pointing to the matching keyword is found. If more than -// one keyword matches, an iterator to the first matching keyword is returned. -// If on exit __b == __e, eofbit is set in __err. If __case_sensitive is false, -// __ct is used to force to lower case before comparing characters. -// Examples: -// Keywords: "a", "abb" -// If the input is "a", the first keyword matches and eofbit is set. -// If the input is "abc", no match is found and "ab" are consumed. -// -// template <class _InputIterator, class _ForwardIterator, class _Ctype> -// _ForwardIterator -// __scan_keyword(_InputIterator& __b, _InputIterator __e, -// _ForwardIterator __kb, _ForwardIterator __ke, -// const _Ctype& __ct, ios_base::iostate& __err, -// bool __case_sensitive = true); - -#include <locale> -#include <cassert> - -int main() -{ - const std::ctype<char>& ct = std::use_facet<std::ctype<char> >(std::locale::classic()); - std::ios_base::iostate err = std::ios_base::goodbit; - { - const char input[] = "a"; - const char* in = input; - std::string keys[] = {"a", "abb"}; - err = std::ios_base::goodbit; - std::string* k = std::__scan_keyword(in, input+sizeof(input)-1, - keys, keys+sizeof(keys)/sizeof(keys[0]), - ct, err); - assert(k - keys == 0); - assert(in == input+1); - assert(err == std::ios_base::eofbit); - } - { - const char input[] = "abc"; - const char* in = input; - std::string keys[] = {"a", "abb"}; - err = std::ios_base::goodbit; - std::string* k = std::__scan_keyword(in, input+sizeof(input)-1, - keys, keys+sizeof(keys)/sizeof(keys[0]), - ct, err); - assert(k - keys == 2); - assert(in == input+2); - assert(err == std::ios_base::failbit); - } - { - const char input[] = "abb"; - const char* in = input; - std::string keys[] = {"a", "abb"}; - err = std::ios_base::goodbit; - std::string* k = std::__scan_keyword(in, input+sizeof(input)-1, - keys, keys+sizeof(keys)/sizeof(keys[0]), - ct, err); - assert(k - keys == 1); - assert(in == input+3); - assert(err == std::ios_base::eofbit); - } - { - const char input[] = "Tue "; - const char* in = input; - std::string keys[] = {"Mon", "Monday", "Tue", "Tuesday"}; - err = std::ios_base::goodbit; - std::string* k = std::__scan_keyword(in, input+sizeof(input)-1, - keys, keys+sizeof(keys)/sizeof(keys[0]), - ct, err); - assert(k - keys == 2); - assert(in == input+3); - assert(err == std::ios_base::goodbit); - } - { - const char input[] = "tue "; - const char* in = input; - std::string keys[] = {"Mon", "Monday", "Tue", "Tuesday"}; - err = std::ios_base::goodbit; - std::string* k = std::__scan_keyword(in, input+sizeof(input)-1, - keys, keys+sizeof(keys)/sizeof(keys[0]), - ct, err); - assert(k - keys == 4); - assert(in == input+0); - assert(err == std::ios_base::failbit); - } - { - const char input[] = "tue "; - const char* in = input; - std::string keys[] = {"Mon", "Monday", "Tue", "Tuesday"}; - err = std::ios_base::goodbit; - std::string* k = std::__scan_keyword(in, input+sizeof(input)-1, - keys, keys+sizeof(keys)/sizeof(keys[0]), - ct, err, false); - assert(k - keys == 2); - assert(in == input+3); - assert(err == std::ios_base::goodbit); - } -} Removed: libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.facet/facet.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.facet/facet.pass.cpp?rev=267980&view=auto ============================================================================== --- libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.facet/facet.pass.cpp (original) +++ libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.facet/facet.pass.cpp (removed) @@ -1,53 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <locale> - -// class locale::facet -// { -// protected: -// explicit facet(size_t refs = 0); -// virtual ~facet(); -// facet(const facet&) = delete; -// void operator=(const facet&) = delete; -// }; - -// This test isn't portable - -#include <locale> -#include <cassert> - -struct my_facet - : public std::locale::facet -{ - static int count; - my_facet(unsigned refs = 0) - : std::locale::facet(refs) - {++count;} - - ~my_facet() {--count;} -}; - -int my_facet::count = 0; - -int main() -{ - my_facet* f = new my_facet; - f->__add_shared(); - assert(my_facet::count == 1); - f->__release_shared(); - assert(my_facet::count == 0); - f = new my_facet(1); - f->__add_shared(); - assert(my_facet::count == 1); - f->__release_shared(); - assert(my_facet::count == 1); - f->__release_shared(); - assert(my_facet::count == 0); -} Added: libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.facet/tested_elsewhere.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.facet/tested_elsewhere.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.facet/tested_elsewhere.pass.cpp (added) +++ libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.facet/tested_elsewhere.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,12 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +int main() +{ +} Removed: libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.id/id.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.id/id.pass.cpp?rev=267980&view=auto ============================================================================== --- libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.id/id.pass.cpp (original) +++ libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.id/id.pass.cpp (removed) @@ -1,50 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <locale> - -// class locale::id -// { -// public: -// id(); -// void operator=(const id&) = delete; -// id(const id&) = delete; -// }; - -// This test isn't portable - -#include <locale> -#include <cassert> - -std::locale::id id0; -std::locale::id id2; -std::locale::id id1; - -int main() -{ - long id = id0.__get(); - assert(id0.__get() == id+0); - assert(id0.__get() == id+0); - assert(id0.__get() == id+0); - assert(id1.__get() == id+1); - assert(id1.__get() == id+1); - assert(id1.__get() == id+1); - assert(id2.__get() == id+2); - assert(id2.__get() == id+2); - assert(id2.__get() == id+2); - assert(id0.__get() == id+0); - assert(id0.__get() == id+0); - assert(id0.__get() == id+0); - assert(id1.__get() == id+1); - assert(id1.__get() == id+1); - assert(id1.__get() == id+1); - assert(id2.__get() == id+2); - assert(id2.__get() == id+2); - assert(id2.__get() == id+2); -} Added: libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.id/tested_elsewhere.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.id/tested_elsewhere.pass.cpp?rev=267981&view=auto ============================================================================== --- libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.id/tested_elsewhere.pass.cpp (added) +++ libcxx/trunk/test/std/localization/locales/locale/locale.types/locale.id/tested_elsewhere.pass.cpp Thu Apr 28 23:07:45 2016 @@ -0,0 +1,12 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +int main() +{ +} Modified: libcxx/trunk/test/std/strings/c.strings/cwchar.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/strings/c.strings/cwchar.pass.cpp?rev=267981&r1=267980&r2=267981&view=diff ============================================================================== --- libcxx/trunk/test/std/strings/c.strings/cwchar.pass.cpp (original) +++ libcxx/trunk/test/std/strings/c.strings/cwchar.pass.cpp Thu Apr 28 23:07:45 2016 @@ -35,11 +35,8 @@ int main() std::tm *tm = 0; std::wint_t w = 0; ::FILE* fp = 0; -#ifdef __APPLE__ - __darwin_va_list va; -#else - __builtin_va_list va; -#endif + std::va_list va; + char* ns = 0; wchar_t* ws = 0; static_assert((std::is_same<decltype(std::fwprintf(fp, L"")), int>::value), ""); Modified: libcxx/trunk/test/std/thread/futures/futures.async/async.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.async/async.pass.cpp?rev=267981&r1=267980&r2=267981&view=diff ============================================================================== --- libcxx/trunk/test/std/thread/futures/futures.async/async.pass.cpp (original) +++ libcxx/trunk/test/std/thread/futures/futures.async/async.pass.cpp Thu Apr 28 23:07:45 2016 @@ -21,15 +21,22 @@ // future<typename result_of<F(Args...)>::type> // async(launch policy, F&& f, Args&&... args); + #include <future> +#include <atomic> #include <memory> #include <cassert> +#include "test_macros.h" + typedef std::chrono::high_resolution_clock Clock; typedef std::chrono::milliseconds ms; +std::atomic_bool invoked = ATOMIC_VAR_INIT(false); + int f0() { + invoked = true; std::this_thread::sleep_for(ms(200)); return 3; } @@ -38,23 +45,27 @@ int i = 0; int& f1() { + invoked = true; std::this_thread::sleep_for(ms(200)); return i; } void f2() { + invoked = true; std::this_thread::sleep_for(ms(200)); } std::unique_ptr<int> f3(int j) { + invoked = true; std::this_thread::sleep_for(ms(200)); return std::unique_ptr<int>(new int(j)); } std::unique_ptr<int> f4(std::unique_ptr<int>&& p) { + invoked = true; std::this_thread::sleep_for(ms(200)); return std::move(p); } @@ -65,136 +76,78 @@ void f5(int j) throw j; } -int main() -{ - { - std::future<int> f = std::async(f0); - std::this_thread::sleep_for(ms(300)); - Clock::time_point t0 = Clock::now(); - assert(f.get() == 3); - Clock::time_point t1 = Clock::now(); - assert(t1-t0 < ms(100)); - } - { - std::future<int> f = std::async(std::launch::async, f0); - std::this_thread::sleep_for(ms(300)); - Clock::time_point t0 = Clock::now(); - assert(f.get() == 3); - Clock::time_point t1 = Clock::now(); - assert(t1-t0 < ms(100)); - } - { - std::future<int> f = std::async(std::launch::any, f0); - std::this_thread::sleep_for(ms(300)); - Clock::time_point t0 = Clock::now(); - assert(f.get() == 3); - Clock::time_point t1 = Clock::now(); - assert(t1-t0 < ms(100)); - } - { - std::future<int> f = std::async(std::launch::deferred, f0); - std::this_thread::sleep_for(ms(300)); - Clock::time_point t0 = Clock::now(); - assert(f.get() == 3); - Clock::time_point t1 = Clock::now(); +template <class Ret, class CheckLamdba, class ...Args> +void test(CheckLamdba&& getAndCheckFn, bool IsDeferred, Args&&... args) { + // Reset global state. + invoked = false; + + // Create the future and wait + std::future<Ret> f = std::async(std::forward<Args>(args)...); + std::this_thread::sleep_for(ms(300)); + + // Check that deferred async's have not invoked the function. + assert(invoked == !IsDeferred); + + // Time the call to f.get() and check that the returned value matches + // what is expected. + Clock::time_point t0 = Clock::now(); + assert(getAndCheckFn(f)); + Clock::time_point t1 = Clock::now(); + + // If the async is deferred it should take more than 100ms, otherwise + // it should take less than 100ms. + if (IsDeferred) { assert(t1-t0 > ms(100)); - } - - { - std::future<int&> f = std::async(f1); - std::this_thread::sleep_for(ms(300)); - Clock::time_point t0 = Clock::now(); - assert(&f.get() == &i); - Clock::time_point t1 = Clock::now(); - assert(t1-t0 < ms(100)); - } - { - std::future<int&> f = std::async(std::launch::async, f1); - std::this_thread::sleep_for(ms(300)); - Clock::time_point t0 = Clock::now(); - assert(&f.get() == &i); - Clock::time_point t1 = Clock::now(); - assert(t1-t0 < ms(100)); - } - { - std::future<int&> f = std::async(std::launch::any, f1); - std::this_thread::sleep_for(ms(300)); - Clock::time_point t0 = Clock::now(); - assert(&f.get() == &i); - Clock::time_point t1 = Clock::now(); + } else { assert(t1-t0 < ms(100)); } - { - std::future<int&> f = std::async(std::launch::deferred, f1); - std::this_thread::sleep_for(ms(300)); - Clock::time_point t0 = Clock::now(); - assert(&f.get() == &i); - Clock::time_point t1 = Clock::now(); - assert(t1-t0 > ms(100)); - } +} + +int main() +{ + // The default launch policy is implementation defined. libc++ defines + // it to be std::launch::async. + bool DefaultPolicyIsDeferred = false; + bool DPID = DefaultPolicyIsDeferred; + + std::launch AnyPolicy = std::launch::async | std::launch::deferred; + LIBCPP_ASSERT(AnyPolicy == std::launch::any); { - std::future<void> f = std::async(f2); - std::this_thread::sleep_for(ms(300)); - Clock::time_point t0 = Clock::now(); - f.get(); - Clock::time_point t1 = Clock::now(); - assert(t1-t0 < ms(100)); - } - { - std::future<void> f = std::async(std::launch::async, f2); - std::this_thread::sleep_for(ms(300)); - Clock::time_point t0 = Clock::now(); - f.get(); - Clock::time_point t1 = Clock::now(); - assert(t1-t0 < ms(100)); - } - { - std::future<void> f = std::async(std::launch::any, f2); - std::this_thread::sleep_for(ms(300)); - Clock::time_point t0 = Clock::now(); - f.get(); - Clock::time_point t1 = Clock::now(); - assert(t1-t0 < ms(100)); + auto checkInt = [](std::future<int>& f) { return f.get() == 3; }; + test<int>(checkInt, DPID, f0); + test<int>(checkInt, false, std::launch::async, f0); + test<int>(checkInt, true, std::launch::deferred, f0); + test<int>(checkInt, DPID, AnyPolicy, f0); } { - std::future<void> f = std::async(std::launch::deferred, f2); - std::this_thread::sleep_for(ms(300)); - Clock::time_point t0 = Clock::now(); - f.get(); - Clock::time_point t1 = Clock::now(); - assert(t1-t0 > ms(100)); + auto checkIntRef = [&](std::future<int&>& f) { return &f.get() == &i; }; + test<int&>(checkIntRef, DPID, f1); + test<int&>(checkIntRef, false, std::launch::async, f1); + test<int&>(checkIntRef, true, std::launch::deferred, f1); + test<int&>(checkIntRef, DPID, AnyPolicy, f1); } - { - std::future<std::unique_ptr<int>> f = std::async(f3, 3); - std::this_thread::sleep_for(ms(300)); - Clock::time_point t0 = Clock::now(); - assert(*f.get() == 3); - Clock::time_point t1 = Clock::now(); - assert(t1-t0 < ms(100)); + auto checkVoid = [](std::future<void>& f) { f.get(); return true; }; + test<void>(checkVoid, DPID, f2); + test<void>(checkVoid, false, std::launch::async, f2); + test<void>(checkVoid, true, std::launch::deferred, f2); + test<void>(checkVoid, DPID, std::launch::any, f2); } - { - std::future<std::unique_ptr<int>> f = - std::async(f4, std::unique_ptr<int>(new int(3))); - std::this_thread::sleep_for(ms(300)); - Clock::time_point t0 = Clock::now(); - assert(*f.get() == 3); - Clock::time_point t1 = Clock::now(); - assert(t1-t0 < ms(100)); + using Ret = std::unique_ptr<int>; + auto checkUPtr = [](std::future<Ret>& f) { return *f.get() == 3; }; + test<Ret>(checkUPtr, DPID, f3, 3); + test<Ret>(checkUPtr, DPID, f4, std::unique_ptr<int>(new int(3))); } - { std::future<void> f = std::async(f5, 3); std::this_thread::sleep_for(ms(300)); try { f.get(); assert (false); } catch ( int ex ) {} } - { std::future<void> f = std::async(std::launch::deferred, f5, 3); std::this_thread::sleep_for(ms(300)); try { f.get(); assert (false); } catch ( int ex ) {} } - } Modified: libcxx/trunk/test/std/thread/futures/futures.overview/launch.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.overview/launch.pass.cpp?rev=267981&r1=267980&r2=267981&view=diff ============================================================================== --- libcxx/trunk/test/std/thread/futures/futures.overview/launch.pass.cpp (original) +++ libcxx/trunk/test/std/thread/futures/futures.overview/launch.pass.cpp Thu Apr 28 23:07:45 2016 @@ -15,28 +15,30 @@ // { // async = 1, // deferred = 2, -// any = async | deferred +// any = async | deferred /* EXTENSION */ // }; #include <future> #include <cassert> +#include "test_macros.h" + int main() { #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS - static_assert(static_cast<int>(std::launch::any) == + LIBCPP_STATIC_ASSERT(static_cast<int>(std::launch::any) == (static_cast<int>(std::launch::async) | static_cast<int>(std::launch::deferred)), ""); #else - static_assert(std::launch::any == (std::launch::async | std::launch::deferred), ""); + LIBCPP_STATIC_ASSERT(std::launch::any == (std::launch::async | std::launch::deferred), ""); static_assert(std::launch(0) == (std::launch::async & std::launch::deferred), ""); - static_assert(std::launch::any == (std::launch::async ^ std::launch::deferred), ""); + LIBCPP_STATIC_ASSERT(std::launch::any == (std::launch::async ^ std::launch::deferred), ""); static_assert(std::launch::deferred == ~std::launch::async, ""); std::launch x = std::launch::async; x &= std::launch::deferred; assert(x == std::launch(0)); x = std::launch::async; x |= std::launch::deferred; - assert(x == std::launch::any); + LIBCPP_ASSERT(x == std::launch::any); x ^= std::launch::deferred; assert(x == std::launch::async); #endif Removed: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/__has_operator_addressof.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/__has_operator_addressof.pass.cpp?rev=267980&view=auto ============================================================================== --- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/__has_operator_addressof.pass.cpp (original) +++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/__has_operator_addressof.pass.cpp (removed) @@ -1,71 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// type_traits - -// extension - -// template <typename _Tp> struct __has_operator_addressof - - -#include <type_traits> - -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - -struct A -{ -}; - -struct B -{ - constexpr B* operator&() const; -}; - -struct D; - -struct C -{ - template <class U> - D operator,(U&&); -}; - -struct E -{ - constexpr C operator&() const; -}; - -struct F {}; -constexpr F* operator&(F const &) { return nullptr; } - -struct G {}; -constexpr G* operator&(G &&) { return nullptr; } - -struct H {}; -constexpr H* operator&(H const &&) { return nullptr; } - -struct J -{ - constexpr J* operator&() const &&; -}; - -#endif // _LIBCPP_HAS_NO_CONSTEXPR - -int main() -{ -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - static_assert(std::__has_operator_addressof<int>::value == false, ""); - static_assert(std::__has_operator_addressof<A>::value == false, ""); - static_assert(std::__has_operator_addressof<B>::value == true, ""); - static_assert(std::__has_operator_addressof<E>::value == true, ""); - static_assert(std::__has_operator_addressof<F>::value == true, ""); - static_assert(std::__has_operator_addressof<G>::value == true, ""); - static_assert(std::__has_operator_addressof<H>::value == true, ""); - static_assert(std::__has_operator_addressof<J>::value == true, ""); -#endif // _LIBCPP_HAS_NO_CONSTEXPR -} Modified: libcxx/trunk/test/support/asan_testing.h URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/asan_testing.h?rev=267981&r1=267980&r2=267981&view=diff ============================================================================== --- libcxx/trunk/test/support/asan_testing.h (original) +++ libcxx/trunk/test/support/asan_testing.h Thu Apr 28 23:07:45 2016 @@ -15,7 +15,7 @@ #if TEST_HAS_FEATURE(address_sanitizer) extern "C" int __sanitizer_verify_contiguous_container ( const void *beg, const void *mid, const void *end ); - + template <typename T, typename Alloc> bool is_contiguous_container_asan_correct ( const std::vector<T, Alloc> &c ) { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits