diff options
Diffstat (limited to 'test/sanitizer_common/TestCases/NetBSD/fparseln.cc')
-rw-r--r-- | test/sanitizer_common/TestCases/NetBSD/fparseln.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/sanitizer_common/TestCases/NetBSD/fparseln.cc b/test/sanitizer_common/TestCases/NetBSD/fparseln.cc new file mode 100644 index 0000000000000..8a71d5fcdadcd --- /dev/null +++ b/test/sanitizer_common/TestCases/NetBSD/fparseln.cc @@ -0,0 +1,25 @@ +// RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s + +#include <assert.h> +#include <stdio.h> +#include <stdlib.h> + +int main(void) { + printf("fparseln\n"); + + FILE *fp = fopen("/etc/fstab", "r"); + assert(fp); + + int flags = FPARSELN_UNESCALL; + const char *delim = "\\\\#"; + size_t lineno = 0, len; + char *line; + while ((line = fparseln(fp, &len, &lineno, delim, flags))) { + printf("lineno: %zu, length: %zu, line: %s\n", lineno, len, line); + free(line); + } + + // CHECK: fparseln + + return 0; +} |