Skip to content

Commit f5fc74a

Browse files
committed
use clang address sanitizer
1 parent 7e2fb89 commit f5fc74a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ test-with-cpp11: test/test.cpp timsort.hpp .bin
2929
time ./.bin/$@
3030

3131
test-issue14: valgrind/issue14.cpp
32-
$(COMPILE) -std=c++11 $< -o .bin/$@
33-
valgrind ./.bin/$@
32+
$(COMPILE) -DENABLE_TIMSORT_LOG -std=c++11 -fsanitize=address $< -o .bin/$@
33+
./.bin/$@
3434

3535
bench: example/bench.cpp timsort.hpp .bin
3636
$(CXX) -v

test/test.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <iostream>
22
#include <vector>
3+
#include <deque>
34
#include <algorithm>
45
#include <utility>
56

@@ -607,4 +608,13 @@ BOOST_AUTO_TEST_CASE(shuffle10k_for_move_only_types) {
607608
}
608609
}
609610

611+
BOOST_AUTO_TEST_CASE(issue14) {
612+
int a[] = {15, 7, 16, 20, 25, 28, 13, 27, 34, 24, 19, 1, 6, 30, 32, 29, 10, 9,
613+
3, 31, 21, 26, 8, 2, 22, 14, 4, 12, 5, 0, 23, 33, 11, 17, 18};
614+
std::deque<int> c(std::begin(a), std::end(a));
615+
616+
gfx::timsort(std::begin(c), std::end(c));
617+
BOOST_CHECK(std::is_sorted(std::begin(c), std::end(c)));
618+
}
619+
610620
#endif // if std::move available

0 commit comments

Comments
 (0)