Skip to content

Commit 2e729ba

Browse files
authored
[NFC][sanitizer] Debug test on bot
Remove unneded _GNU_SOURCE. Add perror.
1 parent 06c3a7d commit 2e729ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler-rt/test/sanitizer_common/TestCases/Posix/variadic-open.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
// RUN: mkdir -p %t.tmp
33
// RUN: %clangxx -O1 %s -o %t && %run %t %t.tmp/1 %t.tmp
44

5-
#define _GNU_SOURCE
6-
75
#include <assert.h>
86
#include <fcntl.h>
7+
#include <stdio.h>
98
#include <sys/stat.h>
109
#include <unistd.h>
1110

1211
void test(const char *path, int flags) {
1312
assert(path);
1413
int fd = open(path, flags, 0600);
14+
if (fd == -1)
15+
perror ("open");
1516
assert(fd != -1);
1617
struct stat info;
1718
int result = fstat(fd, &info);

0 commit comments

Comments
 (0)