Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions libcxx/test/benchmarks/GenerateInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <algorithm>
#include <climits>
#include <concepts>
#include <cstddef>
#include <random>
#include <string>
Expand Down Expand Up @@ -171,4 +172,31 @@ inline std::vector<const char*> getRandomCStringInputs(std::size_t N) {
return cinputs;
}

template <class T>
struct Generate {
// When the contents don't matter
static T arbitrary();

// Prefer a cheap-to-construct element if possible
static T cheap();

// Prefer an expensive-to-construct element if possible
static T expensive();
};

template <class T>
requires std::integral<T>
struct Generate<T> {
static T arbitrary() { return 42; }
static T cheap() { return 42; }
static T expensive() { return 42; }
};

template <>
struct Generate<std::string> {
static std::string arbitrary() { return "hello world"; }
static std::string cheap() { return "small"; }
static std::string expensive() { return std::string(256, 'x'); }
};

#endif // BENCHMARK_GENERATE_INPUT_H
37 changes: 0 additions & 37 deletions libcxx/test/benchmarks/Utilities.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: c++03, c++11, c++14, c++17

#include <algorithm>
#include <array>
Expand Down
2 changes: 1 addition & 1 deletion libcxx/test/benchmarks/algorithms/lower_bound.bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: c++03, c++11, c++14, c++17

#include <algorithm>
#include <numeric>
Expand Down
2 changes: 1 addition & 1 deletion libcxx/test/benchmarks/algorithms/make_heap.bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: c++03, c++11, c++14, c++17

#include <algorithm>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: c++03, c++11, c++14, c++17

#include <algorithm>

Expand Down
2 changes: 1 addition & 1 deletion libcxx/test/benchmarks/algorithms/pop_heap.bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: c++03, c++11, c++14, c++17

#include <algorithm>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-has-no-incomplete-pstl

#include <algorithm>
Expand Down
2 changes: 1 addition & 1 deletion libcxx/test/benchmarks/algorithms/push_heap.bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: c++03, c++11, c++14, c++17

#include <algorithm>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: c++03, c++11, c++14, c++17

#include <algorithm>
#include <cstdlib>
Expand Down
2 changes: 1 addition & 1 deletion libcxx/test/benchmarks/algorithms/sort.bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: c++03, c++11, c++14, c++17

#include <algorithm>

Expand Down
2 changes: 1 addition & 1 deletion libcxx/test/benchmarks/algorithms/sort_heap.bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: c++03, c++11, c++14, c++17

#include <algorithm>

Expand Down
2 changes: 1 addition & 1 deletion libcxx/test/benchmarks/algorithms/stable_sort.bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: c++03, c++11, c++14, c++17

#include <algorithm>

Expand Down
Loading