[compiler-rt] 76cffc2 - [sanitizer] Add O_TMPFILE test

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 22 12:36:26 PDT 2024


Author: Vitaly Buka
Date: 2024-09-22T12:35:57-07:00
New Revision: 76cffc2aa5d85874b2e83661debfce30cf8d3028

URL: https://github.com/llvm/llvm-project/commit/76cffc2aa5d85874b2e83661debfce30cf8d3028
DIFF: https://github.com/llvm/llvm-project/commit/76cffc2aa5d85874b2e83661debfce30cf8d3028.diff

LOG: [sanitizer] Add O_TMPFILE test

For #108291

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 fd4c4ae0d123ae..5c3f8b755a0ad8 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/variadic-open.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/variadic-open.cpp
@@ -1,6 +1,8 @@
 // RUN: rm -rf %t.tmp
 // RUN: mkdir -p %t.tmp
-// RUN: %clangxx -O1 %s -o %t && %run %t %t.tmp/1
+// RUN: %clangxx -O1 %s -o %t && %run %t %t.tmp/1 %t.tmp
+
+#define _GNU_SOURCE
 
 #include <assert.h>
 #include <fcntl.h>
@@ -19,6 +21,10 @@ void test(const char *path, int flags) {
 }
 
 int main(int argc, char *argv[]) {
-  assert(argc == 2);
+  assert(argc == 3);
   test(argv[1], O_RDWR | O_CREAT);
+
+#ifdef O_TMPFILE
+  test(argv[2], O_RDWR | O_TMPFILE);
+#endif
 }


        


More information about the llvm-commits mailing list