mirror of git://gcc.gnu.org/git/gcc.git
libstdc++: Fix nodiscard warnings in performance tests
libstdc++-v3/ChangeLog: * testsuite/performance/23_containers/sort_search/list.cc: Cast results to void to suppress -Wunused-result warnings from nodiscard functions. * testsuite/performance/25_algorithms/equal_deque_iterators.cc: Likewise. * testsuite/performance/25_algorithms/search_n.cc: Likewise.
This commit is contained in:
parent
37e881b316
commit
7f355b11db
|
|
@ -34,7 +34,7 @@ template<typename Container, int Iter>
|
||||||
|
|
||||||
//Search for random values that may or may not belong to the list.
|
//Search for random values that may or may not belong to the list.
|
||||||
for (int i = 0; i < 50; ++i)
|
for (int i = 0; i < 50; ++i)
|
||||||
std::find(obj.begin(), obj.end(), rand() % 100001);
|
(void) std::find(obj.begin(), obj.end(), rand() % 100001);
|
||||||
|
|
||||||
obj.sort();
|
obj.sort();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ int main()
|
||||||
start_counters(time, resource);
|
start_counters(time, resource);
|
||||||
for (int i = 0; i < 1000; ++i)
|
for (int i = 0; i < 1000; ++i)
|
||||||
for (int j = 0; j < 3000; ++j)
|
for (int j = 0; j < 3000; ++j)
|
||||||
std::equal(data.begin(), data.begin() + j, d.begin());
|
(void) std::equal(data.begin(), data.begin() + j, d.begin());
|
||||||
stop_counters(time, resource);
|
stop_counters(time, resource);
|
||||||
report_performance(__FILE__, "deque vs deque", time, resource);
|
report_performance(__FILE__, "deque vs deque", time, resource);
|
||||||
clear_counters(time, resource);
|
clear_counters(time, resource);
|
||||||
|
|
@ -44,7 +44,7 @@ int main()
|
||||||
start_counters(time, resource);
|
start_counters(time, resource);
|
||||||
for (int i = 0; i < 1000; ++i)
|
for (int i = 0; i < 1000; ++i)
|
||||||
for (int j = 0; j < 3000; ++j)
|
for (int j = 0; j < 3000; ++j)
|
||||||
std::equal(data.begin(), data.begin() + j, v.begin());
|
(void) std::equal(data.begin(), data.begin() + j, v.begin());
|
||||||
stop_counters(time, resource);
|
stop_counters(time, resource);
|
||||||
report_performance(__FILE__, "deque vs vector", time, resource);
|
report_performance(__FILE__, "deque vs vector", time, resource);
|
||||||
clear_counters(time, resource);
|
clear_counters(time, resource);
|
||||||
|
|
@ -54,7 +54,7 @@ int main()
|
||||||
start_counters(time, resource);
|
start_counters(time, resource);
|
||||||
for (int i = 0; i < 1000; ++i)
|
for (int i = 0; i < 1000; ++i)
|
||||||
for (int j = 0; j < 3000; ++j)
|
for (int j = 0; j < 3000; ++j)
|
||||||
std::equal(v.begin(), v.begin() + j, d.begin());
|
(void) std::equal(v.begin(), v.begin() + j, d.begin());
|
||||||
stop_counters(time, resource);
|
stop_counters(time, resource);
|
||||||
report_performance(__FILE__, "vector vs deque", time, resource);
|
report_performance(__FILE__, "vector vs deque", time, resource);
|
||||||
clear_counters(time, resource);
|
clear_counters(time, resource);
|
||||||
|
|
@ -64,7 +64,7 @@ int main()
|
||||||
start_counters(time, resource);
|
start_counters(time, resource);
|
||||||
for (int i = 0; i < 1000; ++i)
|
for (int i = 0; i < 1000; ++i)
|
||||||
for (int j = 0; j < 3000; ++j)
|
for (int j = 0; j < 3000; ++j)
|
||||||
std::equal(data.begin(), data.begin() + j, cv.begin());
|
(void) std::equal(data.begin(), data.begin() + j, cv.begin());
|
||||||
stop_counters(time, resource);
|
stop_counters(time, resource);
|
||||||
report_performance(__FILE__, "int deque vs char vector", time, resource);
|
report_performance(__FILE__, "int deque vs char vector", time, resource);
|
||||||
clear_counters(time, resource);
|
clear_counters(time, resource);
|
||||||
|
|
@ -74,7 +74,7 @@ int main()
|
||||||
start_counters(time, resource);
|
start_counters(time, resource);
|
||||||
for (int i = 0; i < 1000; ++i)
|
for (int i = 0; i < 1000; ++i)
|
||||||
for (int j = 0; j < 3000; ++j)
|
for (int j = 0; j < 3000; ++j)
|
||||||
std::equal(cv.begin(), cv.begin() + j, d.begin());
|
(void) std::equal(cv.begin(), cv.begin() + j, d.begin());
|
||||||
stop_counters(time, resource);
|
stop_counters(time, resource);
|
||||||
report_performance(__FILE__, "char vector vs int deque", time, resource);
|
report_performance(__FILE__, "char vector vs int deque", time, resource);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ main(void)
|
||||||
__gnu_test::test_container<int, forward_iterator_wrapper> fcon(ary, ary + length);
|
__gnu_test::test_container<int, forward_iterator_wrapper> fcon(ary, ary + length);
|
||||||
start_counters(time, resource);
|
start_counters(time, resource);
|
||||||
for(int i = 0; i < 100; i++)
|
for(int i = 0; i < 100; i++)
|
||||||
search_n(fcon.begin(), fcon.end(), 10, 1);
|
(void) search_n(fcon.begin(), fcon.end(), 10, 1);
|
||||||
stop_counters(time, resource);
|
stop_counters(time, resource);
|
||||||
report_performance(__FILE__, "forward iterator", time, resource);
|
report_performance(__FILE__, "forward iterator", time, resource);
|
||||||
clear_counters(time, resource);
|
clear_counters(time, resource);
|
||||||
|
|
@ -55,7 +55,7 @@ main(void)
|
||||||
__gnu_test::test_container<int, random_access_iterator_wrapper> rcon(ary, ary + length);
|
__gnu_test::test_container<int, random_access_iterator_wrapper> rcon(ary, ary + length);
|
||||||
start_counters(time, resource);
|
start_counters(time, resource);
|
||||||
for(int i = 0; i < 100; i++)
|
for(int i = 0; i < 100; i++)
|
||||||
search_n(rcon.begin(), rcon.end(), 10, 1);
|
(void) search_n(rcon.begin(), rcon.end(), 10, 1);
|
||||||
stop_counters(time, resource);
|
stop_counters(time, resource);
|
||||||
report_performance(__FILE__, "random access iterator", time, resource);
|
report_performance(__FILE__, "random access iterator", time, resource);
|
||||||
clear_counters(time, resource);
|
clear_counters(time, resource);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue