summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Another place for CMAKE_HOST_UNIXSean Silva2016-04-061-1/+1
| | | | | | | | | | | | | If we don't create the target, don't try to add it as a dependency. After r265595, we were only creating the SanitizerLintCheck when `CMAKE_HOST_UNIX` was true. CMake was emitting a warning: The dependency target "SanitizerLintCheck" of target "check-ubsan" does not exist. llvm-svn: 265613
* Apply suggestion from HJ Lu to avoid misaligned stack in testReid Kleckner2016-04-041-1/+1
| | | | | | Fixes PR27191 llvm-svn: 265322
* [asan,tsan] Make Darwin-specific tests more stable (use ↵Kuba Brecka2016-04-0413-18/+18
| | | | | | ignore_interceptors_accesses=1 for GCD tests and printf instead of NSLog). llvm-svn: 265300
* [asan] Mark the initialization-bug.cc unsupported on OS X Yosemite and olderRyan Govostes2016-03-302-0/+9
| | | | | | | This test should fail on OS X Yosemite and older, and pass on OS X El Capitan and newer as well as on other platforms. llvm-svn: 264938
* [profile] Remove quotes around env variable, NFCVedant Kumar2016-03-301-1/+1
| | | | llvm-svn: 264824
* [profile] Test error reporting by writing to a temp directoryVedant Kumar2016-03-301-1/+1
| | | | | | | | | | This test case is meant to check whether verbose error logging works. It does this by _failing_ to write a profile to a path corresponding to a directory. Make this clearer by writing to a temporary directory. Patch suggested by Sean Silva! llvm-svn: 264817
* [libprofile] Make this test express intent a bit better.Sean Silva2016-03-301-8/+8
| | | | | | | | | This also makes it work on PS4 a bit better. For running the libprofile tests on PS4, we are sneaking environment variables through on the command line, so the extra argument for LLVM_PROFILE_FILE was messing up the simple `argc < 2` check. llvm-svn: 264812
* Fix comment in testXinliang David Li2016-03-291-3/+6
| | | | llvm-svn: 264792
* [profile] Make a test work if run by the super-userVedant Kumar2016-03-291-4/+1
| | | | llvm-svn: 264773
* [asan] Make the Darwin/dead-strip.c test require El Capitan or newerRyan Govostes2016-03-292-6/+9
| | | | llvm-svn: 264766
* [libprofile] Use one fewer -mllvm option in this test.Sean Silva2016-03-281-2/+2
| | | | | | | AFAIK there is still no way to avoid `-mllvm -disable-vp=false` currently. llvm-svn: 264682
* [asan] Add runtime support for __asan_(un)register_image_globalsRyan Govostes2016-03-282-1/+22
| | | | | | | | | | | This change introduces routines that register and unregister all instrumented globals in a loaded executable image. These routines are only implemented on Darwin, where globals metadata is expected to be placed in the __DATA,__asan_globals section. Review: http://reviews.llvm.org/D16841 llvm-svn: 264644
* [tsan] Fix a crash when exiting the main thread (e.g. dispatch_main)Kuba Brecka2016-03-281-0/+38
| | | | | | | | This patch fixes the custom ThreadState destruction on OS X to avoid crashing when dispatch_main calls pthread_exit which quits the main thread. Differential Revision: http://reviews.llvm.org/D18496 llvm-svn: 264627
* [libprofile] Make this test not depend on previous runs.Sean Silva2016-03-281-0/+1
| | | | llvm-svn: 264626
* [libprofile] Make this test a bit more specificSean Silva2016-03-281-16/+16
| | | | llvm-svn: 264625
* Fix-up for OS X test failure after r264451 ("Add memset, memmove, and memcpy ↵Kuba Brecka2016-03-281-1/+1
| | | | | | to the common interceptors") llvm-svn: 264571
* Make vp merge test more robustXinliang David Li2016-03-261-14/+17
| | | | llvm-svn: 264521
* [libprofile] Adjust dummy condition to be more forgiving.Sean Silva2016-03-261-1/+1
| | | | | | | | | | | On PS4, we have to fake environment variables by passing extra command line arguments, so the dummy test `argc > 1` was failing. The condition is just a dummy condition that the compiler can't fold away, so the number is arbitrary as long as the condition is false. Increase the number it compares against. llvm-svn: 264491
* [libprofile] Add some missing `env` prefixes on commands.Sean Silva2016-03-263-3/+3
| | | | llvm-svn: 264490
* Stop depending on the keys in a hash table being in a particular order.Richard Smith2016-03-261-77/+83
| | | | llvm-svn: 264488
* [asan] bump the scariness score of read-after-frees (based on feedback from ↵Kostya Serebryany2016-03-261-3/+3
| | | | | | the Chrome security team) llvm-svn: 264481
* [profile] Add integration test to validate PGO function namesVedant Kumar2016-03-254-1/+129
| | | | | | Differential Revision: http://reviews.llvm.org/D18485 llvm-svn: 264480
* Follow-up for r264261, adding a comment explaining what the testcase does.Kuba Brecka2016-03-241-0/+5
| | | | llvm-svn: 264271
* [tsan] Fix fork() and fork-based tests for OS XKuba Brecka2016-03-245-5/+0
| | | | | | | | On OS X, fork() under TSan asserts (in debug builds only) because REAL(fork) calls some intercepted functions, which check that no internal locks are held via CheckNoLocks(). But the wrapper of fork intentionally holds some locks. This patch fixes that by using ScopedIgnoreInterceptors during the call to REAL(fork). After that, all the fork-based tests seem to pass on OS X, so let's just remove all the UNSUPPORTED: darwin annotations we have. Differential Revision: http://reviews.llvm.org/D18409 llvm-svn: 264261
* [tsan] Use direct syscalls for internal_mmap and internal_munmap on OS XKuba Brecka2016-03-241-0/+19
| | | | | | | | On OS X, internal_mmap just uses mmap, which can invoke callbacks into libmalloc (e.g. when MallocStackLogging is enabled). This can subsequently call other intercepted functions, and this breaks our Darwin-specific ThreadState initialization. Let's use direct syscalls in internal_mmap and internal_munmap. Added a testcase. Differential Revision: http://reviews.llvm.org/D18431 llvm-svn: 264259
* [sanitizer] Add strnlen to the common interceptorsDerek Bruening2016-03-231-0/+12
| | | | | | | | | | | | | | | | | | | Summary: Adds strnlen to the common interceptors, under the existing flag intercept_strlen. Removes the now-duplicate strnlen interceptor from asan and msan. This adds strnlen to tsan, which previously did not intercept it. Adds a new test of strnlen to the sanitizer_common test cases. Reviewers: samsonov Subscribers: zhaoqin, llvm-commits, kcc Differential Revision: http://reviews.llvm.org/D18397 llvm-svn: 264195
* [tsan] Change nullptr to NULL in one Darwin test.Kuba Brecka2016-03-221-1/+1
| | | | | | Depending on the version of libcxx, nullptr might not be available. Let's use NULL instead. llvm-svn: 264058
* Move -fms-compatibility-version=19 into target cflagsReid Kleckner2016-03-223-13/+0
| | | | | | | This reduces cflags duplication and allows us to build sanitizer_common/tests with clang and the VS 2015 STL. llvm-svn: 264017
* [asan] Relax strdup test check linesReid Kleckner2016-03-221-2/+2
| | | | | | | On the buildbot, strdup appears as frame 1 instead of frame 0. Either is an acceptable user experience. llvm-svn: 264016
* [asan] Intercept strdup on WindowsReid Kleckner2016-03-221-4/+2
| | | | | | | | Some unit tests were failing because we didn't intercept strdup. It turns out it works just fine on 2013 and 2015 with a small patch to the interception logic. llvm-svn: 264013
* Fix coverage-related asan tests for VS 2015Reid Kleckner2016-03-222-2/+9
| | | | | | | | printf is an inline function in VS 2015, giving these tests an unexpected extra point of coverage. This change works around that by avoiding printf. llvm-svn: 264010
* [asan] Pass -fms-compatibility-version=19 with VS 2015Reid Kleckner2016-03-213-0/+13
| | | | | | | This resolves errors about char16_t and char32_t when compiling 2015 STL headers with clang. llvm-svn: 263973
* [tsan] Adding a test case for r263939 ("Add some NULL pointer checks into ↵Kuba Brecka2016-03-211-0/+20
| | | | | | the debugging API") llvm-svn: 263946
* [TSAN] Fix build bot failure for powerpc64leSagar Thakur2016-03-181-3/+0
| | | | | | race_on_mutex.c passes for powerpc64le too after revision 263778. So removing the XFAIL marker. llvm-svn: 263779
* [TSAN] Relax the expected output of race_on_mutex.cSagar Thakur2016-03-181-7/+3
| | | | | | | | | | | | | | | | | | | The stack trace produced by TSan on MIPS is: Previous write of size 8 at 0x0120ed2930 by thread T1: #0 memset /home/slt/LLVM/llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:678 (race_on_mutex.c.tmp+0x0120071808) #1 __GI___pthread_mutex_init /build/glibc-g99ldr/glibc-2.19/nptl/pthread_mutex_init.c:84 (libpthread.so.0+0x000000d634) #2 <null> /home/slt/LLVM/llvm/projects/compiler-rt/test/tsan/race_on_mutex.c:11 (race_on_mutex.c.tmp+0x01200ea59c) Reviewers: samsonov, dvyukov Subscribers: llvm-commits, mohit.bhakkad, jaydeep Differential: http://reviews.llvm.org/D17796 llvm-svn: 263778
* [sanitizer] On OS X, verify that interceptors work and abort if not, take 2Kuba Brecka2016-03-172-0/+49
| | | | | | | | | | On OS X 10.11+, we have "automatic interceptors", so we don't need to use DYLD_INSERT_LIBRARIES when launching instrumented programs. However, non-instrumented programs that load TSan late (e.g. via dlopen) are currently broken, as TSan will still try to initialize, but the program will crash/hang at random places (because the interceptors don't work). This patch adds an explicit check that interceptors are working, and if not, it aborts and prints out an error message suggesting to explicitly use DYLD_INSERT_LIBRARIES. TSan unit tests run with a statically linked runtime, where interceptors don't work. To avoid aborting the process in this case, the patch replaces `DisableReexec()` with a weak `ReexecDisabled()` function which is defined to return true in unit tests. Differential Revision: http://reviews.llvm.org/D18212 llvm-svn: 263695
* [tsan] Detect uses of uninitialized, destroyed and invalid mutexesKuba Brecka2016-03-161-0/+25
| | | | | | | | This patch adds a new TSan report type, ReportTypeMutexInvalidAccess, which is triggered when pthread_mutex_lock or pthread_mutex_unlock returns EINVAL (this means the mutex is invalid, uninitialized or already destroyed). Differential Revision: http://reviews.llvm.org/D18132 llvm-svn: 263641
* Revert r263551 due to a test failure.Kuba Brecka2016-03-152-49/+0
| | | | llvm-svn: 263553
* [sanitizer] On OS X, verify that interceptors work and abort if notKuba Brecka2016-03-152-0/+49
| | | | | | | | On OS X 10.11+, we have "automatic interceptors", so we don't need to use DYLD_INSERT_LIBRARIES when launching instrumented programs. However, non-instrumented programs that load TSan late (e.g. via dlopen) are currently broken, as TSan will still try to initialize, but the program will crash/hang at random places (because the interceptors don't work). This patch adds an explicit check that interceptors are working, and if not, it aborts and prints out an error message suggesting to explicitly use DYLD_INSERT_LIBRARIES. Differential Revision: http://reviews.llvm.org/D18121 llvm-svn: 263551
* Fix bad regression from r263077 when building with MSVC.Nico Weber2016-03-121-3/+0
| | | | | | | | | | | | | | That change did: -#if defined(__BIG_ENDIAN__) +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ If __BYTE_ORDER__ and __ORDER_BIG_ENDIAN__ aren't defined, like they are with MSVC, this condition is true (0 == 0). Fixes PR26919. llvm-svn: 263324
* Disable a test that started failing recently; see PR26919.Nico Weber2016-03-121-0/+3
| | | | llvm-svn: 263311
* Fix order of arguments to fputsReid Kleckner2016-03-111-3/+3
| | | | | | This time actually tested on Linux, where the test is not XFAILed. llvm-svn: 263294
* Switch to fputs stderr to try to fix output buffering issuesReid Kleckner2016-03-111-3/+3
| | | | llvm-svn: 263293
* Make printf-4 more robust to strlen interception after r263177Reid Kleckner2016-03-111-5/+7
| | | | | | | The CHECK line was matching stack-buffer-overflow from puts calling strlen, which is not the bug the test is trying to catch. llvm-svn: 263282
* Fix ASan test cases after r263177Alexey Samsonov2016-03-113-7/+7
| | | | llvm-svn: 263195
* [Windows] Fix UnmapOrDie and MmapAlignedOrDieReid Kleckner2016-03-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Now ASan can return virtual memory to the underlying OS. Portable sanitizer runtime code needs to be aware that UnmapOrDie cannot unmap part of previous mapping. In particular, this required changing how we implement MmapAlignedOrDie on Windows, which is what Allocator32 uses. The new code first attempts to allocate memory of the given size, and if it is appropriately aligned, returns early. If not, it frees the memory and attempts to reserve size + alignment bytes. In this region there must be an aligned address. We then free the oversized mapping and request a new mapping at the aligned address immediately after. However, a thread could allocate that virtual address in between our free and allocation, so we have to retry if that allocation fails. The existing thread creation stress test managed to trigger this condition, so the code isn't totally untested. Reviewers: samsonov Differential Revision: http://reviews.llvm.org/D17431 llvm-svn: 263160
* [sanitizer_common tests] Make Darwin a Posix system and bring the ↵Filipe Cabecinhas2016-03-104-1/+7
| | | | | | | | | | | | | | | | | | | stable-runtime definition from ASan tests. Summary: This is an initial setup in order to move some additional tests from Linux onto Posix. I also moved decorate_proc_maps onto the Linux directory Finally added msan's definition for "stable-runtime". Only a test requires it, and its commit message (r248014) seems to imply that AArch64 is problematic with MSan. Reviewers: samsonov, rengolin, t.p.northover, eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D17928 llvm-svn: 263142
* Follow-up fix for r263126. Apparently `printf("%p", NULL)` can output 0x0, ↵Kuba Brecka2016-03-101-2/+2
| | | | | | (nil) or (null) on different platforms. llvm-svn: 263137
* [tsan] Add TSan debugger APIsKuba Brecka2016-03-101-0/+88
| | | | | | | | Currently, TSan only reports everything in a formatted textual form. The idea behind this patch is to provide a consistent API that can be used to query information contained in a TSan-produced report. User can use these APIs either in a debugger (via a script or directly), or they can use it directly from the process (e.g. in the __tsan_on_report callback). ASan already has a similar API, see http://reviews.llvm.org/D4466. Differential Revision: http://reviews.llvm.org/D16191 llvm-svn: 263126
* [test/asan/closed-fds] Properly quote log_path for shell invocation.Filipe Cabecinhas2016-03-101-1/+1
| | | | llvm-svn: 263106
OpenPOWER on IntegriCloud