Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / FreeBSD / fparseln.cpp
blobf805f3159ab15d2709b3a302dabb17534b7888ac
1 // RUN: %clangxx -O0 -g %s -o %t -lutil && %run %t 2>&1 | FileCheck %s
3 #include <assert.h>
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <libutil.h>
8 int main(void) {
9 printf("fparseln\n");
11 FILE *fp = fopen("/etc/fstab", "r");
12 assert(fp);
14 int flags = FPARSELN_UNESCALL;
15 const char *delim = "\\\\#";
16 size_t lineno = 0, len;
17 char *line;
18 while ((line = fparseln(fp, &len, &lineno, delim, flags))) {
19 printf("lineno: %zu, length: %zu, line: %s\n", lineno, len, line);
20 free(line);
23 // CHECK: fparseln
25 return 0;