-
Notifications
You must be signed in to change notification settings - Fork 11.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NFC][sanitizer] Don't use FileCheck in test
`assert` is enough.
- Loading branch information
1 parent
3ad3f05
commit e5d174c
Showing
1 changed file
with
2 additions
and
9 deletions.
There are no files selected for viewing
11 changes: 2 additions & 9 deletions
11
compiler-rt/test/sanitizer_common/TestCases/Posix/variadic-open.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,18 @@ | ||
// RUN: %clangxx -O1 %s -o %t && %run %t %t.tmp 2>&1 | FileCheck %s | ||
// RUN: %clangxx -O1 %s -o %t && %run %t %t.tmp | ||
|
||
#include <stdio.h> | ||
#include <assert.h> | ||
#include <fcntl.h> | ||
#include <unistd.h> | ||
#include <sys/stat.h> | ||
|
||
int main(int argc, char *argv[]) { | ||
fprintf(stderr, "Hello world.\n"); | ||
assert(argv[1]); | ||
unlink(argv[1]); | ||
int fd = open(argv[1], O_RDWR | O_CREAT, 0600); | ||
assert(fd != -1); | ||
struct stat info; | ||
int result = fstat(fd, &info); | ||
fprintf(stderr, "permissions = 0%o\n", info.st_mode & ~S_IFMT); | ||
assert((info.st_mode & ~S_IFMT) == 0600); | ||
assert(result == 0); | ||
close(fd); | ||
fprintf(stderr, "Done.\n"); | ||
} | ||
|
||
// CHECK: Hello world. | ||
// CHECK: permissions = 0600 | ||
// CHECK: Done. |