summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2016-04-15[TSAN] Make tsan tests more portable (take 3)Renato Golin
Some tests didn't merge stderr with stdout. Patch by Maxim Kuvyrkov. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266426 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-14Revert "Make tsan tests more portable (take 2)"Renato Golin
This reverts commit r266294, as it broke some buildbots again. :/ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266300 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-14Make tsan tests more portable (take 2)Renato Golin
Using stderr more uniformily, avoiding potential races when scanning stdout and stderr output. Patch by Maxim Kuvyrkov. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266294 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-14[tsan] Fix size reporting for OS X zone allocator with 0-sized allocationsKuba Brecka
The custom zone implementation for OS X must not return 0 (even for 0-sized allocations). Returning 0 indicates that the pointer doesn't belong to the zone. This can break existing applications. The underlaying allocator allocates 1 byte for 0-sized allocations anyway, so returning 1 in this case is okay. Differential Revision: http://reviews.llvm.org/D19100 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266283 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-13[asan] Prefer alloc-dealloc-mismatch to new-delete-type-mismatch.Evgeniy Stepanov
With -fsized-deallocation, new[] vs delete mismatch is reported as new-delete-type-mismatch. This is technically true, but alloc-dealloc-mismatch describes it better. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266246 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-13[PGO] Fix the buildbots for r266229. Betul Buyukkurt
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266240 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-12[safestack] Fix stack canary test on Mac.Evgeniy Stepanov
Disable FORTIFY_SOURCE and explicitly disable stack protector in the no-stack-protector run. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266106 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11[safestack] A test for stackprotector canaries.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266006 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11[tsan] Replace 'not' with '%deflake' in gcd-apply-race.mm Darwin test.Kuba Brecka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265919 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-07[sanitizer] Fix sem_init_glibc.cc test on __HAVE_64B_ATOMIC arches.Evgeniy Stepanov
glibc can use one of 2 layouts for semaphores: architectures that don't HAVE_64B_ATOMIC use an uint32_t field with semaphore value, then a private field, then a waiting thread count field - this is the layout currently assumed by the test. However, HAVE_64B_ATOMIC arches use a fused uint64_t field that contains the value in low bits and waiting thread count in high bits, followed by a private field. This resulted in taking private field from the wrong offset on 64-bit atomic platforms (the test still passed, but didn't actually test the private field). On big-endian platforms, this resulted in a fail, since the first 4 bytes overlay the thread count field, and not the value field. Found while porting ASan to s390x. Patch by Marcin Kościelnicki. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265715 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-07[sancov] updaing android test after enabling cc edge pruningMike Aizatsky
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265714 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-07[sancov] updaing android testMike Aizatsky
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265692 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-07[tsan] Remove long sleeps from fork testsKuba Brecka
On one of our testing machines, we're running the tests under heavy load, and especially in the fork-based TSan tests, we're seeing timeouts when a test uses sleep(10), assuming that calling fork() on another thread will finish sooner than that. This patch removes a timeout and makes another one longer. Differential Revision: http://reviews.llvm.org/D18476 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265666 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-07[tsan] Add support for OS X OSAtomic* functionsKuba Brecka
OS X provides atomic functions in libkern/OSAtomic.h. These provide atomic guarantees and they have alternatives which have barrier semantics. This patch adds proper TSan support for the functions from libkern/OSAtomic.h. Differential Revision: http://reviews.llvm.org/D18500 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265665 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-07[tsan] Add interceptors for dispatch_applyKuba Brecka
Adding an interceptor with two more release+acquire pairs to avoid false positives with dispatch_apply. Differential Revision: http://reviews.llvm.org/D18722 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265662 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-07[tsan] Add XPC support (OS X)Kuba Brecka
XPC APIs have async callbacks, and we need some more happen-before edges to avoid false positives. This patch add them, plus a test case (sorry for the long boilerplate code, but XPC just needs all that). Differential Revision: http://reviews.llvm.org/D18493 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265661 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-07[tsan] Add support for dispatch event sourcesKuba Brecka
GCD has APIs for event sources, we need some more release-acquire pairs to avoid false positives in TSan. Differential Revision: http://reviews.llvm.org/D18515 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265660 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-07[tsan] Fix synchronization in dispatch_syncKuba Brecka
In the interceptor for dispatch_sync, we're currently missing synchronization between the callback and the code *after* the call to dispatch_sync. This patch fixes this by adding an extra release+acquire pair to dispatch_sync() and similar APIs. Added a testcase. Differential Revision: http://reviews.llvm.org/D18502 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265659 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-07[tsan] Fix Darwin tests (missing FileCheck's)Kuba Brecka
A little embarrassing, but we're missing the call to FileCheck in several Darwin tests. Let's fix this. Differential Revision: http://reviews.llvm.org/D18503 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265658 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-07[sancov] removing flaky test case (win)Mike Aizatsky
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265627 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-06[sancov] enabling coverage edge pruning by default.Mike Aizatsky
Differential Revision: http://reviews.llvm.org/D18845 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265614 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-06Another place for CMAKE_HOST_UNIXSean Silva
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265613 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04Apply suggestion from HJ Lu to avoid misaligned stack in testReid Kleckner
Fixes PR27191 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265322 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04[asan,tsan] Make Darwin-specific tests more stable (use ↵Kuba Brecka
ignore_interceptors_accesses=1 for GCD tests and printf instead of NSLog). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265300 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-30[asan] Mark the initialization-bug.cc unsupported on OS X Yosemite and olderRyan Govostes
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264938 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-30[profile] Remove quotes around env variable, NFCVedant Kumar
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264824 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-30[profile] Test error reporting by writing to a temp directoryVedant Kumar
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! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264817 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-30[libprofile] Make this test express intent a bit better.Sean Silva
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264812 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-29Fix comment in testXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264792 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-29[profile] Make a test work if run by the super-userVedant Kumar
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264773 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-29[asan] Make the Darwin/dead-strip.c test require El Capitan or newerRyan Govostes
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264766 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-28[libprofile] Use one fewer -mllvm option in this test.Sean Silva
AFAIK there is still no way to avoid `-mllvm -disable-vp=false` currently. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264682 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-28[asan] Add runtime support for __asan_(un)register_image_globalsRyan Govostes
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264644 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-28[tsan] Fix a crash when exiting the main thread (e.g. dispatch_main)Kuba Brecka
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264627 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-28[libprofile] Make this test not depend on previous runs.Sean Silva
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264626 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-28[libprofile] Make this test a bit more specificSean Silva
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264625 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-28Fix-up for OS X test failure after r264451 ("Add memset, memmove, and memcpy ↵Kuba Brecka
to the common interceptors") git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264571 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-26Make vp merge test more robustXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264521 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-26[libprofile] Adjust dummy condition to be more forgiving.Sean Silva
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264491 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-26[libprofile] Add some missing `env` prefixes on commands.Sean Silva
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264490 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-26Stop depending on the keys in a hash table being in a particular order.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264488 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-26[asan] bump the scariness score of read-after-frees (based on feedback from ↵Kostya Serebryany
the Chrome security team) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264481 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25[profile] Add integration test to validate PGO function namesVedant Kumar
Differential Revision: http://reviews.llvm.org/D18485 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264480 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24Follow-up for r264261, adding a comment explaining what the testcase does.Kuba Brecka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264271 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24[tsan] Fix fork() and fork-based tests for OS XKuba Brecka
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264261 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24[tsan] Use direct syscalls for internal_mmap and internal_munmap on OS XKuba Brecka
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264259 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23[sanitizer] Add strnlen to the common interceptorsDerek Bruening
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264195 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22[tsan] Change nullptr to NULL in one Darwin test.Kuba Brecka
Depending on the version of libcxx, nullptr might not be available. Let's use NULL instead. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264058 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22Move -fms-compatibility-version=19 into target cflagsReid Kleckner
This reduces cflags duplication and allows us to build sanitizer_common/tests with clang and the VS 2015 STL. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22[asan] Relax strdup test check linesReid Kleckner
On the buildbot, strdup appears as frame 1 instead of frame 0. Either is an acceptable user experience. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264016 91177308-0d34-0410-b5e6-96231b3b80d8