diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-04-12 18:40:39 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-04-12 18:40:39 +0000 |
commit | 1eb3b89d9278ae4e049f5cd9a436a595d6c7e131 (patch) | |
tree | 925429234418f203e2c4d1e7a2bf5a10fcd5fb13 /lld/unittests/CoreTests/ParallelTest.cpp | |
parent | 685e913d714b404fb76c8e6bdf6cab202b03356d (diff) | |
download | bcm5719-llvm-1eb3b89d9278ae4e049f5cd9a436a595d6c7e131.tar.gz bcm5719-llvm-1eb3b89d9278ae4e049f5cd9a436a595d6c7e131.zip |
[Core] Add parallel infrastructure to lld.
Uses ConcRT and PPL on Windows.
llvm-svn: 179397
Diffstat (limited to 'lld/unittests/CoreTests/ParallelTest.cpp')
-rw-r--r-- | lld/unittests/CoreTests/ParallelTest.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lld/unittests/CoreTests/ParallelTest.cpp b/lld/unittests/CoreTests/ParallelTest.cpp new file mode 100644 index 00000000000..ffa2b23fd3b --- /dev/null +++ b/lld/unittests/CoreTests/ParallelTest.cpp @@ -0,0 +1,33 @@ +//===- lld/unittest/ParallelTest.cpp --------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// +/// \file +/// \brief Parallel.h unit tests. +/// +//===----------------------------------------------------------------------===// + +#include "gtest/gtest.h" + +#include "lld/Core/Parallel.h" + +#include <array> +#include <random> + +uint32_t array[1024 * 1024]; + +TEST(Parallel, sort) { + std::mt19937 randEngine; + std::uniform_int_distribution<uint32_t> dist; + + for (auto &i : array) + i = dist(randEngine); + + lld::parallel_sort(std::begin(array), std::end(array)); + ASSERT_TRUE(std::is_sorted(std::begin(array), std::end(array))); +} |