Skip to content

Commit e5d174c

Browse files
committed
[NFC][sanitizer] Don't use FileCheck in test
`assert` is enough.
1 parent 3ad3f05 commit e5d174c

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
1-
// RUN: %clangxx -O1 %s -o %t && %run %t %t.tmp 2>&1 | FileCheck %s
1+
// RUN: %clangxx -O1 %s -o %t && %run %t %t.tmp
22

3-
#include <stdio.h>
43
#include <assert.h>
54
#include <fcntl.h>
65
#include <unistd.h>
76
#include <sys/stat.h>
87

98
int main(int argc, char *argv[]) {
10-
fprintf(stderr, "Hello world.\n");
119
assert(argv[1]);
1210
unlink(argv[1]);
1311
int fd = open(argv[1], O_RDWR | O_CREAT, 0600);
1412
assert(fd != -1);
1513
struct stat info;
1614
int result = fstat(fd, &info);
17-
fprintf(stderr, "permissions = 0%o\n", info.st_mode & ~S_IFMT);
15+
assert((info.st_mode & ~S_IFMT) == 0600);
1816
assert(result == 0);
1917
close(fd);
20-
fprintf(stderr, "Done.\n");
2118
}
22-
23-
// CHECK: Hello world.
24-
// CHECK: permissions = 0600
25-
// CHECK: Done.

0 commit comments

Comments
 (0)