diff options
| author | David Carlier <devnexen@gmail.com> | 2019-01-15 11:21:33 +0000 |
|---|---|---|
| committer | David Carlier <devnexen@gmail.com> | 2019-01-15 11:21:33 +0000 |
| commit | bd27e4c1566b6cb218624d30763bce412d4fbd7b (patch) | |
| tree | 7d13fed5c8ef14972f85b5bbfd1da7a375bd9131 /compiler-rt/test/sanitizer_common | |
| parent | cce1c2eb0e87e84be6345c870d3334f748bdc5bb (diff) | |
| download | bcm5719-llvm-bd27e4c1566b6cb218624d30763bce412d4fbd7b.tar.gz bcm5719-llvm-bd27e4c1566b6cb218624d30763bce412d4fbd7b.zip | |
[Sanitizer] Intercept sl_add api on FreeBSD/NetBSD
Reviewers: krytarowski, vitalybuka
Reviewed By: krytarowski
Differential Revision: https://reviews.llvm.org/D56670
llvm-svn: 351189
Diffstat (limited to 'compiler-rt/test/sanitizer_common')
| -rw-r--r-- | compiler-rt/test/sanitizer_common/TestCases/Posix/getusershell.cc | 1 | ||||
| -rw-r--r-- | compiler-rt/test/sanitizer_common/TestCases/Posix/sl_add.cc | 26 |
2 files changed, 27 insertions, 0 deletions
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/getusershell.cc b/compiler-rt/test/sanitizer_common/TestCases/Posix/getusershell.cc index c00d75f1121..42ee03fffc0 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Posix/getusershell.cc +++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/getusershell.cc @@ -1,4 +1,5 @@ // RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s +// UNSUPPORTED: android // UNSUPPORTED: android 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 '{{.*}}' +} |

