Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / Posix / getfsent.cpp
blob8df8b5726148b81883afa2cb44644f589ab53e15
1 // RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s
2 //
3 // UNSUPPORTED: darwin, target={{.*(linux|solaris).*}}
5 #include <assert.h>
6 #include <errno.h>
7 #include <stdio.h>
8 #include <string.h>
9 #include <fstab.h>
11 int main(void) {
12 printf("getfsent\n");
14 setfsent();
15 struct fstab *fentry = getfsent();
17 assert(fentry);
19 setfsent();
20 struct fstab *pentry = getfsspec(fentry->fs_spec);
21 assert(pentry);
22 setfsent();
23 struct fstab *wentry = getfsfile(fentry->fs_file);
24 assert(wentry);
25 assert(!memcmp(fentry, wentry, sizeof(*wentry)));
26 assert(!memcmp(pentry, wentry, sizeof(*pentry)));
28 printf("First entry: device block '%s', mounted with '%s'\n",
29 fentry->fs_spec, fentry->fs_mntops);
31 endfsent();
33 return 0;
34 // CHECK: getfsent
35 // CHECK: First entry: device block '{{.*}}', mounted with '{{.*}}'