summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2016-04-28[test/asan] Update a test case to work with old Darwin SDK'sVedant Kumar
On Darwin, MAP_ANONYMOUS is a synonym for MAP_ANON. However, some SDK's don't define MAP_ANONYMOUS. Use MAP_ANON to work around this. (As a point of interest, the situation is exactly reversed on Linux.) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267907 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28Update visibility flags for CFI tests.Peter Collingbourne
Differential Revision: http://reviews.llvm.org/D18813 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267902 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27[sanitizers] read/write page fault detection on mac.Mike Aizatsky
Summary: Resubmit of http://reviews.llvm.org/D19495 enabled only on intel. Subscribers: kubabrecka Differential Revision: http://reviews.llvm.org/D19561 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267750 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27Un-XFAIL tests on Windows after fixing PR27492Reid Kleckner
Private symbols in PDBs do not have parameter types in their names so we have to drop the parens from the lambda call operator. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267735 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26[sanitizers] rewriting test assuming assert() changes coverage.Mike Aizatsky
Summary: On windows platform assert() call creates two distinct CFG edges which are coverage-instrumented. Simply calling assert would change coverage numbers on the platform. Subscribers: kubabrecka Differential Revision: http://reviews.llvm.org/D19514 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267610 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26[sanitizer] [SystemZ] Add ptrace support bits.Marcin Koscielnicki
Differential Revision: http://reviews.llvm.org/D19134 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267548 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26Revert "[sanitizers] read/write page fault detection on mac."Mehdi Amini
This reverts commit r267477. It broke our bots that enables the AArch64 backends, it seems that this code is using a Darwin *X86 specific* field. From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267526 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25[MSan] Use COMMON_INTERCEPTOR_ENTER in libdl interceptors.Marcin Koscielnicki
This fixes fails in test/msan/dlerror.cc - when real dlerror calls strcmp, our strcmp interceptor now skips poison checking, since it's called in interceptor context. Strictly speaking, only the dlerror change is necessary to fix the fail, but let's also change the other two just in case. Differential Revision: http://reviews.llvm.org/D19499 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267486 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25[sanitizers] read/write page fault detection on mac.Mike Aizatsky
Subscribers: kubabrecka Differential Revision: http://reviews.llvm.org/D19495 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267477 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-23[esan] EfficiencySanitizer libc interceptorsDerek Bruening
Summary: Adds libc interceptors to the runtime library for the new EfficiencySanitizer ("esan") family of tools. The interceptors cover the memory operations in most common library calls and will be shared among all esan tools. Reviewers: aizatsky Subscribers: zhaoqin, tberghammer, danalbert, srhines, llvm-commits, vitalybuka, eugenis, kcc Differential Revision: http://reviews.llvm.org/D19411 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267293 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-22[asan] Disable one test on windows.Evgeniy Stepanov
Patch by Vitaly Buka. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267088 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-22Enable stack-use-after-scope tests.Evgeniy Stepanov
Fix and enable working stack-use-after-scope tests. Add more failing tests for the feature, for fix later. PR27453. Patch by Vitaly Buka. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267084 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21[esan] EfficiencySanitizer base runtime libraryDerek Bruening
Summary: Adds the initial version of a runtime library for the new EfficiencySanitizer ("esan") family of tools. The library includes: + Slowpath code via callouts from the compiler instrumentation for each memory access. + Registration of atexit() to call finalization code. + Runtime option flags controlled by the environment variable ESAN_OPTIONS. The common sanitizer flags are supported such as verbosity and log_path. + An initial simple test. Still TODO: common code for libc interceptors and shadow memory mapping, and tool-specific code for shadow state updating. Reviewers: eugenis, vitalybuka, aizatsky, filcab Subscribers: filcab, vkalintiris, kubabrecka, llvm-commits, zhaoqin, kcc Differential Revision: http://reviews.llvm.org/D19168 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267060 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21[asan] Mark strdup test as unsupported on arm/linux.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267028 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21[tsan] Rename ReportThread->pid to ReportThread->os_idKuba Brecka
The field "pid" in ReportThread is used to store the OS-provided thread ID (pthread_self or gettid). The name "pid" suggests it's a process ID, which it isn't. Let's rename it. Differential Revision: http://reviews.llvm.org/D19365 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266994 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-20[asan] Add __strdup interceptor.Evgeniy Stepanov
This happens on Linux when building as C (not C++) with optimization. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266931 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19[compiler-rt] Remove unwanted --check-prefix=CHECK from unit tests. NFC.Mandeep Singh Grang
Summary: Removed unwanted --check-prefix=CHECK from the following unit tests: test/asan/TestCases/Posix/start-deactivated.cc test/tsan/Darwin/ignored-interceptors.mm Patch by: Mandeep Singh Grang (mgrang) Reviewers: samsonov, kcc, dvyukov, eugenis Differential Revision: http://reviews.llvm.org/D19281 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266813 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-18Additional test for use-after-scopeKostya Serebryany
Summary: Test that asan detects access to the dead variable captured by lambda. Reviewers: aizatsky, kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19238 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266676 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-16Replace hardcoded comment at 'lit.site.cfg.in'Alex Denisov
At the moment almost every lit.site.cfg.in contains two lines comment: ## Autogenerated by LLVM/Clang configuration. # Do not edit! The patch adds variable LIT_SITE_CFG_IN_HEADER, that is replaced from configure_lit_site_cfg with the note and some useful information. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266520 91177308-0d34-0410-b5e6-96231b3b80d8
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