[compiler-rt] 39d2506 - Fix crypt.cpp sanitizer test on FreeBSD

Alex Richardson via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 04:21:50 PDT 2020


Author: Alex Richardson
Date: 2020-08-25T12:20:33+01:00
New Revision: 39d25064614fb87dcb934739af987c8f66068be2

URL: https://github.com/llvm/llvm-project/commit/39d25064614fb87dcb934739af987c8f66068be2
DIFF: https://github.com/llvm/llvm-project/commit/39d25064614fb87dcb934739af987c8f66068be2.diff

LOG: Fix crypt.cpp sanitizer test on FreeBSD

FreeBSD doesn't provide a crypt.h header but instead defines the functions
in unistd.h. Use __has_include() to handle that case.

Reviewed By: #sanitizers, vitalybuka

Differential Revision: https://reviews.llvm.org/D85406

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/crypt.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/crypt.cpp
index 17ab6965b20b..3a8faaa1ae76 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/crypt.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/crypt.cpp
@@ -6,7 +6,9 @@
 #include <assert.h>
 #include <unistd.h>
 #include <cstring>
+#if __has_include(<crypt.h>)
 #include <crypt.h>
+#endif
 
 int
 main (int argc, char** argv)


        


More information about the llvm-commits mailing list