[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / NetBSD / statvfs1.cpp
blob40dfca37bb5899e12ef25ec0909a9f227a1ca9e8
1 // RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s
3 #include <sys/param.h>
4 #include <sys/types.h>
6 #include <sys/statvfs.h>
8 #include <assert.h>
9 #include <fcntl.h>
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <unistd.h>
14 void test_statvfs1() {
15 printf("statvfs1\n");
17 struct statvfs buf;
18 int rv = statvfs1("/etc/fstab", &buf, ST_WAIT);
19 assert(rv != -1);
21 printf("fstypename='%s'\n", buf.f_fstypename);
22 printf("mntonname='%s'\n", buf.f_mntonname);
23 printf("mntfromname='%s'\n", buf.f_mntfromname);
26 void test_fstatvfs1() {
27 printf("fstatvfs1\n");
29 int fd = open("/etc/fstab", O_RDONLY);
30 assert(fd > 0);
32 struct statvfs buf;
33 int rv = fstatvfs1(fd, &buf, ST_WAIT);
34 assert(rv != -1);
36 printf("fstypename='%s'\n", buf.f_fstypename);
37 printf("mntonname='%s'\n", buf.f_mntonname);
38 printf("mntfromname='%s'\n", buf.f_mntfromname);
40 rv = close(fd);
41 assert(rv != -1);
44 int main(void) {
45 test_statvfs1();
46 test_fstatvfs1();
48 // CHECK: statvfs1
49 // CHECK: fstypename='{{.*}}'
50 // CHECK: mntonname='{{.*}}'
51 // CHECK: mntfromname='{{.*}}'
52 // CHECK: fstatvfs1
53 // CHECK: fstypename='{{.*}}'
54 // CHECK: mntonname='{{.*}}'
55 // CHECK: mntfromname='{{.*}}'
57 return 0;