File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
compiler-rt/test/sanitizer_common/TestCases/Posix Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 1- // RUN: %clangxx -O1 %s -o %t && %run %t %t.tmp
1+ // RUN: rm -rf %t.tmp
2+ // RUN: mkdir -p %t.tmp
3+ // RUN: %clangxx -O1 %s -o %t && %run %t %t.tmp/1
24
35#include < assert.h>
46#include < fcntl.h>
5- #include < unistd.h>
67#include < sys/stat.h>
8+ #include < unistd.h>
79
8- int main (int argc, char *argv[]) {
9- assert (argv[1 ]);
10- unlink (argv[1 ]);
11- int fd = open (argv[1 ], O_RDWR | O_CREAT, 0600 );
10+ void test (const char *path, int flags) {
11+ assert (path);
12+ int fd = open (path, flags, 0600 );
1213 assert (fd != -1 );
1314 struct stat info;
1415 int result = fstat (fd, &info);
1516 assert ((info.st_mode & ~S_IFMT) == 0600 );
1617 assert (result == 0 );
1718 close (fd);
1819}
20+
21+ int main (int argc, char *argv[]) {
22+ assert (argc == 2 );
23+ test (argv[1 ], O_RDWR | O_CREAT);
24+ }
You can’t perform that action at this time.
0 commit comments