aboutsummaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/tests/sanitizer_list_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sanitizer_common/tests/sanitizer_list_test.cc')
-rw-r--r--lib/sanitizer_common/tests/sanitizer_list_test.cc20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/sanitizer_common/tests/sanitizer_list_test.cc b/lib/sanitizer_common/tests/sanitizer_list_test.cc
index d328fbfdf92c..fbe53c0375c0 100644
--- a/lib/sanitizer_common/tests/sanitizer_list_test.cc
+++ b/lib/sanitizer_common/tests/sanitizer_list_test.cc
@@ -21,8 +21,7 @@ struct ListItem {
typedef IntrusiveList<ListItem> List;
-// Check that IntrusiveList can be made thread-local.
-static THREADLOCAL List static_list;
+static List static_list;
static void SetList(List *l, ListItem *x = 0,
ListItem *y = 0, ListItem *z = 0) {
@@ -154,4 +153,21 @@ TEST(SanitizerCommon, IntrusiveList) {
CHECK(l2.empty());
}
+TEST(SanitizerCommon, IntrusiveListAppendEmpty) {
+ ListItem i;
+ List l;
+ l.clear();
+ l.push_back(&i);
+ List l2;
+ l2.clear();
+ l.append_back(&l2);
+ CHECK_EQ(l.back(), &i);
+ CHECK_EQ(l.front(), &i);
+ CHECK_EQ(l.size(), 1);
+ l.append_front(&l2);
+ CHECK_EQ(l.back(), &i);
+ CHECK_EQ(l.front(), &i);
+ CHECK_EQ(l.size(), 1);
+}
+
} // namespace __sanitizer