Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / FreeBSD / hexdump.cc
blobe07650d64102a4eae137f188a26f5f5a36fe5b99
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("hexdump");
10 char *line;
11 size_t lineno = 0, len;
12 const char *delim = "\\\\#";
13 FILE *fp = fopen("/etc/fstab", "r");
14 assert(fp);
15 line = fparseln(fp, &len, &lineno, delim, 0);
16 hexdump(line, len, nullptr, 0);
17 free(line);
18 fclose(fp);
19 assert(lineno != 0);
20 assert(len > 0);
22 return 0;