summaryrefslogtreecommitdiff
path: root/compiler-rt/test/sanitizer_common/TestCases/Posix/sl_add.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/test/sanitizer_common/TestCases/Posix/sl_add.cc')
-rw-r--r--compiler-rt/test/sanitizer_common/TestCases/Posix/sl_add.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/sl_add.cc b/compiler-rt/test/sanitizer_common/TestCases/Posix/sl_add.cc
new file mode 100644
index 00000000000..4da70c7888f
--- /dev/null
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/sl_add.cc
@@ -0,0 +1,26 @@
+// RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s
+//
+// UNSUPPORTED: linux, darwin, solaris
+
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <stringlist.h>
+
+int main(void) {
+ printf("sl_add\n");
+
+ StringList *sl = sl_init();
+ assert(sl);
+ char *p = strdup("entry");
+ assert(!sl_add(sl, p));
+ char *entry = sl_find(sl, "entry");
+ assert(!strcmp(entry, p));
+ printf("Found '%s'\n", entry);
+ sl_free(sl, 1);
+
+ return 0;
+ // CHECK: sl_add
+ // CHECK: Found '{{.*}}'
+}