summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/tests/sanitizer_test_utils.h
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [Sanitizers, test] Fix sanitizer tests on Solaris (PR 33274)Kamil Rytarowski2018-01-171-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch (on top of the previous two (https://reviews.llvm.org/D40898 and https://reviews.llvm.org/D40899) complete the compiler-rt side of the the Solaris sanitizer port. It contains the following sets of changes: * For the time being, the port is for 32-bit x86 only, so reject the various tests on x86_64. * When compiling as C++, <setjmp.h> resp. <iso/setjmp_iso.h> only declares _setjmp and _longjmp inside namespace std. * MAP_FILE is a Windows feature. While e.g. Linux <sys/mman.h> provides a no-op compat define, Solaris does not. * test/asan/TestCases/Posix/coverage.cc was initially failing like this: /vol/gcc/src/llvm/llvm/local/projects/compiler-rt/lib/sanitizer_common/scripts/sancov.py: 4 files merged; 2 PCs total rm: cannot remove '/var/gcc/llvm/local/projects/compiler-rt/test/asan/I386SunOSConfig/TestCases/Posix/Output/coverage': Invalid argument Further digging revealed that the rm was trying to remove the running test's working directory which failed as observed. cd'ing out of the dir before let the test pass. * Two tests needed a declaration of alloca. I've now copied the existing code from test/asan/TestCases/alloca_constant_size.cc, but it may be more profitable and maintainable to have a common testsuite header where such code is collected. * Similarly, Solaris' printf %p format doesn't include the leading 0x. * In test/asan/TestCases/malloc-no-intercept.c, I had to undef __EXTENSIONS__ (predefined by clang for no apparent reason) to avoid conflicting declarations for memalign. * test/ubsan/TestCases/Float/cast-overflow.cpp has different platform dependent ways to define BYTE_ORDER and friends. Why not just use __BYTE_ORDER__ and friends as predefined by clang and gcc? Patch by Rainer Orth. Reviewers: kcc, alekseyshl Reviewed By: alekseyshl Subscribers: srhines, kubamracek, mgorny, krytarowski, fedor.sergeev, JDevlieghere, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40900 llvm-svn: 322635
* Add NetBSD support in sanitizer_test_utils.hKamil Rytarowski2017-08-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | Summary: NetBSD ships with printf_l(3) like FreeBSD. NetBSD does not ship with memalign, pvalloc, malloc with "usable size" and is the same here as Darwin, Android, FreeBSD and Windows. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, kcc, fjricci, filcab Reviewed By: vitalybuka Subscribers: srhines, llvm-commits, emaste, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36373 llvm-svn: 310248
* [asan] Add strndup/__strndup interceptors.Pierre Gousseau2017-06-011-0/+6
| | | | | | | | Recommit of r302781 with Vitaly Buka's fix for non zero terminated strings. Differential Revision: https://reviews.llvm.org/D31457 llvm-svn: 304399
* Revert r302781 and subsequent attempts to disable part of it.Daniel Jasper2017-05-181-7/+0
| | | | | | | The Msan unit tests are still broken and by this point, I think we should start over. llvm-svn: 303339
* temporary disable stndup interceptor, due to r302781 being buggyKostya Serebryany2017-05-181-1/+2
| | | | llvm-svn: 303324
* [asan] Recommit of r301904: Add strndup/__strndup interceptorsPierre Gousseau2017-05-111-0/+6
| | | | | | | | | Fix undeclared __interceptor_malloc in esan_interceptors.cc Fix undeclared strnlen on OSX Differential Revision: https://reviews.llvm.org/D31457 llvm-svn: 302781
* Revert r301904 causing tsan test failure in x86_64-linux-autoconfPierre Gousseau2017-05-021-6/+0
| | | | llvm-svn: 301909
* [asan] Add strndup/__strndup interceptors if targeting linux.Pierre Gousseau2017-05-021-0/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D31457 llvm-svn: 301904
* [Sanitizers] Intercept snprintf_l() on FreeBSDViktor Kutuzov2014-12-221-0/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D6418 llvm-svn: 224700
* Fix checks for Android.Dan Albert2014-10-201-2/+2
| | | | | | | | | | | | __ANDROID__ is a define that comes from the toolchain when building for Android targets. ANDROID has a different meaning. ANDROID is defined for _every_ Android build, including those done for host modules. For host modules, we want to build the regular Linux sanitizers and builtins, not the one for Android devices. This hasn't been a problem until now because we only just started building the sanitizers for the host. llvm-svn: 220203
* Exclude Android from the tests for valloc/pvalloc.Dan Albert2014-06-141-1/+2
| | | | | | | These functions are being removed from Android because they were removed from POSIX 2004. llvm-svn: 210962
* [Sanitizer tests] Add sanitizer_test_config.h to make the inclusion of ↵Timur Iskhodzhanov2014-05-131-0/+6
| | | | | | | | gtest.h conditional Reviewed at http://reviews.llvm.org/D3744 llvm-svn: 208696
* [Sanitizer tests] Make simple pthread tests compile and pass on WindowsTimur Iskhodzhanov2014-05-131-0/+8
| | | | | | Reviewed at http://reviews.llvm.org/D3725 llvm-svn: 208674
* [Sanitizer tests] Fix a comment that got out of sync with the #ifTimur Iskhodzhanov2014-05-121-2/+2
| | | | llvm-svn: 208602
* [ASan tests] Use the proper attribute on RunStrChrTest helper functions to ↵Timur Iskhodzhanov2014-05-121-3/+9
| | | | | | avoid "unused function" warnings llvm-svn: 208568
* [ASan] Update sanitizer_common and asan test_util headers to support ↵Timur Iskhodzhanov2014-05-081-11/+6
| | | | | | building on Windows llvm-svn: 208306
* [ASan] Better way to disable tests for functions unavailable on certain ↵Alexey Samsonov2014-03-071-0/+23
| | | | | | platforms llvm-svn: 203224
* Migrate ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS to new spelling - ↵Alexey Samsonov2013-09-061-4/+4
| | | | | | ATTRIBUTE_NO_SANITIZE_ADDRESS llvm-svn: 190136
* [asan] guard ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS definition with an #ifndefKostya Serebryany2013-02-271-5/+7
| | | | llvm-svn: 176175
* [asan] use the new attribute syntax (no_address_safety_analysis => ↵Kostya Serebryany2013-02-261-1/+1
| | | | | | no_sanitize_address) llvm-svn: 176077
* Move large part of asan_test_utils.h to sanitizer_common.Evgeniy Stepanov2013-01-141-0/+80
Move my_rand() to the common header. This lets us avoid the use of rand_r in sanitizer_common tests. There is no rand_r on Android. llvm-svn: 172421
OpenPOWER on IntegriCloud