[compiler-rt] 2e729ba - [NFC][sanitizer] Debug test on bot

via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 22 12:57:59 PDT 2024


Author: Vitaly Buka
Date: 2024-09-22T12:57:55-07:00
New Revision: 2e729bac35fb3e17c21a636f0fd076a8d7ee84d1

URL: https://github.com/llvm/llvm-project/commit/2e729bac35fb3e17c21a636f0fd076a8d7ee84d1
DIFF: https://github.com/llvm/llvm-project/commit/2e729bac35fb3e17c21a636f0fd076a8d7ee84d1.diff

LOG: [NFC][sanitizer] Debug test on bot

Remove unneded _GNU_SOURCE.
Add perror.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/variadic-open.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/variadic-open.cpp
index 5c3f8b755a0ad8..8b269f23dd6396 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/variadic-open.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/variadic-open.cpp
@@ -2,16 +2,17 @@
 // RUN: mkdir -p %t.tmp
 // RUN: %clangxx -O1 %s -o %t && %run %t %t.tmp/1 %t.tmp
 
-#define _GNU_SOURCE
-
 #include <assert.h>
 #include <fcntl.h>
+#include <stdio.h>
 #include <sys/stat.h>
 #include <unistd.h>
 
 void test(const char *path, int flags) {
   assert(path);
   int fd = open(path, flags, 0600);
+  if (fd == -1)
+    perror ("open");
   assert(fd != -1);
   struct stat info;
   int result = fstat(fd, &info);


        


More information about the llvm-commits mailing list