summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [NFC] Use clearer naming for local variablesJF Bastien2019-04-101-9/+9
| | | | llvm-svn: 358145
* [TSan][libdispatch] Replace CFRunLoop with dispatch_semaphore, pt. 1Julian Lettner2019-04-096-53/+54
| | | | | | | | | | | | Remove the dependency on Foundation so we can start running those tests on other platforms. Rename/move of tests will be done in a separate commit. Reviewed By: kubamracek, dvyukov Differential Revision: https://reviews.llvm.org/D60347 llvm-svn: 358023
* hwasan: Enable -hwasan-allow-ifunc by default.Peter Collingbourne2019-04-091-2/+1
| | | | | | | | | It's been on in Android for a while without causing problems, so it's time to make it the default and remove the flag. Differential Revision: https://reviews.llvm.org/D60355 llvm-svn: 357960
* [asan_symbolize] Use proper logging infrastructure.Dan Liew2019-04-083-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The previous logging infrastructure had several problems: * Debugging output was emitted to standard output which is also where the symbolized output would go. Interleaving these two separate bits of information makes inspecting the output difficult and could potentially break tests. * Enabling debugging output requires modifying the script which is not very conveninent. * When debugging it isn't immediately obvious where the output is coming from. This patch uses the Python standard library logging infrastructure which fixes all of the above problems. Logging is controlled using two new options. * `--log-level` - Sets the logging level, default is `info`. * `--log-dest` - Set the logging destination, default is standard error. Some simple test cases for the feature are included. rdar://problem/49476995 Reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka Subscribers: #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60343 llvm-svn: 357951
* [Sanitizer] Make wcrtomb test posix-onlyPavel Labath2019-04-081-0/+3
| | | | | | | | | | | | wcrtomb is not intercepted on windows, so this test fails there. It's not clear to me why we do not intercept this function there (I'll look into that separately), but for now this should at least make the windows sanitizer bot green again (broken by r357889, when I added this test). I also add "UNSUPPORTED: android" as this function is also not intercepted there. llvm-svn: 357892
* [Sanitizer] Fix a possible write to freed memory in the wcrtomb interceptorPavel Labath2019-04-082-0/+49
| | | | | | | | | | | | | | | | | | Summary: r357240 added an interceptor for wctomb, which uses a temporary local buffer to make sure we don't write to unallocated memory. This patch applies the same technique to wcrtomb, and adds some additional tests for this function. Reviewers: vitalybuka, eugenis Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D59984 llvm-svn: 357889
* [TSan][libdispatch] Remove Darwin-only version of fully-ported testsJulian Lettner2019-04-0610-428/+0
| | | | | | | Remove 10 tests that already have a copy in tsan/libdispatch, without dependencies on Darwin-specifis. llvm-svn: 357832
* Use binary write mode in WriteToFile function to avoid appended \r ↵Vitaly Buka2019-04-052-0/+37
| | | | | | | | | | | | | | | | | | | | | characters on Windows Summary: When using libfuzzer on Windows, in the contents of a crash sample, bytes that can be mistaken for a \n are replaced by a \r\n sequence. As a consequence, crashes are not reproducible. This patch will open files in binary mode to fix this issue. The patch does not affect POSIX systems. Patch by tuktuk Reviewers: kcc, vitalybuka Reviewed By: vitalybuka Subscribers: dexonsmith, jdoerfert, llvm-commits, #sanitizers Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60008 llvm-svn: 357807
* [TSan][libdispatch] Make test work on Linux, pt. 2Julian Lettner2019-04-051-2/+2
| | | | llvm-svn: 357741
* [TSan][libdispatch] Make test work on LinuxJulian Lettner2019-04-041-3/+4
| | | | llvm-svn: 357729
* [TSan][libdispatch] Stricter checks via `--implicit-check-not`Julian Lettner2019-04-047-16/+8
| | | | | | | | `--implicit-check-not='ThreadSanitizer'` checks in the entire output while `// CHECK-NOT: ThreadSanitizer` only checks after (before) the previous (next) match. llvm-svn: 357727
* [TSan][libdispatch] Specify libdispatch header dir for lit testsJulian Lettner2019-04-042-6/+7
| | | | | | | | | Specify libdispatch header dir (include path) for lit tests. This is the last missing piece in order to run the libdispatch tests on Linux even when libdispatch is installed in a custom path instead of a default (system) location. llvm-svn: 357707
* [NFC][TSan][libdispatch] Better CMake variable namesJulian Lettner2019-04-041-2/+2
| | | | llvm-svn: 357664
* Fix typos in tests. NFC.Xing GUO2019-04-031-1/+1
| | | | | | | | | | | | | | Reviewers: Higuoxing Reviewed By: Higuoxing Subscribers: kubamracek, cfe-commits, #sanitizers, llvm-commits Tags: #clang, #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D60183 llvm-svn: 357577
* [NFC][TSan][libdispatch] Cleanup testJulian Lettner2019-04-021-6/+6
| | | | llvm-svn: 357530
* [NFC] Test is C++, not CJulian Lettner2019-04-021-0/+0
| | | | llvm-svn: 357524
* [NFC][libdispatch] Improve a few testsJulian Lettner2019-04-023-6/+7
| | | | llvm-svn: 357510
* Fix tests after r357452Hans Wennborg2019-04-022-4/+4
| | | | llvm-svn: 357462
* [compiler-rt][test] Make instrprof-set-dir-mode test tolerant of group IDMatt Davis2019-04-021-1/+5
| | | | | | | | | | | | | | | | | | | Patch from 'troyj': Hi, I ran into a problem with this test when the source was located in certain directories. The mkdir(2) man page states that the set-group-ID bit is inherited from the parent directory, but this test was written in such a way that it assumes the bit is unset. Whether that assumption is true depends on where the checkout lives, which leads to some people being able to reproduce the problem whereas others cannot. I think the correct fix is to exclude the bit from the check. Making probinson a reviewer since they reviewed the original test. Patch landed for troyj, thanks! Differential Revision: D53832 llvm-svn: 357449
* [Sanitizer] Add interceptor for wctombPavel Labath2019-03-291-0/+14
| | | | | | | | | | | | | | | | | Summary: This is required to avoid msan false positives for code using this function (although generally one should avoid using this function in favor of wcrtomb). Reviewers: eugenis, EricWF, vitalybuka Subscribers: srhines, kubamracek, fedor.sergeev, delcypher, llvm-commits, #sanitizers Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D59548 llvm-svn: 357240
* Revert "[builtins] Rounding mode support for addxf3/subxf3"Yi Kong2019-03-272-43/+1
| | | | | | | | This reverts commit 2cabea054e40ae2837da959d0ca89ae25cf1b1f1. Test failure on buildbots. llvm-svn: 357048
* [builtins] Rounding mode support for addxf3/subxf3Yi Kong2019-03-262-1/+43
| | | | | | | | | | | | | | | | | Implement rounding mode support for addxf3/subxf3. On architectures that implemented the support, this will access the corresponding floating point environment register to apply the correct rounding. For other architectures, it will keep the current behaviour and use IEEE-754 default rounding mode (to nearest, ties to even). ARM32/AArch64 support implemented in this change. i386 and AMD64 will be added in a follow up change. Differential Revision: https://reviews.llvm.org/D57143 llvm-svn: 357035
* [NFC][TSan][libdispatch] Don't use ignore_noninstrumented_modules on LinuxJulian Lettner2019-03-221-3/+0
| | | | llvm-svn: 356728
* Enable `asan/TestCases/Posix/start-deactivated.cc` test for iOS.Dan Liew2019-03-212-2/+1
| | | | | | | | | | | | | | | | | | | Summary: To make this test pass it was necesary to change `iossim_run.py` to propagate the `ASAN_ACTIVATION_OPTIONS` environment variable into the testing environment. rdar://problem/49114807 Reviewers: kubamracek, yln, serge-sans-paille Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D59660 llvm-svn: 356701
* [builtins] Divide shouldn't underflow if rounded result would be normal.Eli Friedman2019-03-193-2/+97
| | | | | | | | | | | We were treating certain edge cases that are actually normal as denormal results, and flushing them to zero; we shouldn't do that. Not sure this is the cleanest way to implement this edge case, but I wanted to avoid adding any code on the common path. Differential Revision: https://reviews.llvm.org/D59070 llvm-svn: 356529
* [asan] Disable -Wfortify-source in intentional OOB testsReid Kleckner2019-03-182-4/+4
| | | | | | Needed after r356397 llvm-svn: 356426
* [NFC][TSan][libdispatch] Fix test for dispatch_apply[_f]Julian Lettner2019-03-181-12/+18
| | | | | | | | | | | | | | | | * Array index out of bounds: 100 iterations, but size of array is 2. * Unmatched barrier_init (2) with barrier_wait (200) * Number of iterations must be smaller than the available parallelism for the queue, otherwise we deadlock (since every barrier_wait call blocks the thread). Scary: All of this worked reliably in gcd-apply.mm (for Darwin) Rievewed By: kubamracek Differential Revision: https://reviews.llvm.org/D59510 llvm-svn: 356418
* [TSan][libdispatch] Configure libdispatch lit testsJulian Lettner2019-03-161-1/+6
| | | | llvm-svn: 356311
* [TSan][libdispatch] Enable linking and running of tests on LinuxJulian Lettner2019-03-151-0/+3
| | | | | | | | | | | | | | | | | | | | | When COMPILER_RT_INTERCEPT_LIBDISPATCH is ON the TSan runtime library now has a dependency on the blocks runtime and libdispatch. Make sure we set all the required linking options. Also add cmake options for specifying additional library paths to instruct the linker where to search for libdispatch and the blocks runtime. This allows us to build TSan runtime with libdispatch support without installing those libraries into default linker library paths. `CMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY` is necessary to avoid aborting the build due to failing the link step in CMake's check_c_compiler test. Reviewed By: dvyukov, kubamracek Differential Revision: https://reviews.llvm.org/D59334 llvm-svn: 356281
* [NFC][TSan] Move libdispatch tests into their own subfolderJulian Lettner2019-03-1414-31/+18
| | | | | | | | | | | | | | | | | Remove 'gcd' file prefix. GCD stands for Grand Central Dispatch, which is another name for libdispatch. https://apple.github.io/swift-corelibs-libdispatch/ Remove `REQUIRE: dispatch` from tests. Also rename lit feature 'dispatch' -> 'libdispatch' to be more explicit what this is about. Reviewed By: kubamracek Differential Revision: https://reviews.llvm.org/D59341 llvm-svn: 356202
* Remove ASan asm instrumentation.Evgeniy Stepanov2019-03-111-33/+0
| | | | | | | | | | | | | | Summary: It is incomplete and has no users AFAIK. Reviewers: pcc, vitalybuka Subscribers: srhines, kubamracek, mgorny, krytarowski, eraman, hiraditya, jdoerfert, #sanitizers, llvm-commits, thakis Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D59154 llvm-svn: 355870
* Remove esan.Nico Weber2019-03-1116-984/+0
| | | | | | | | | | | It hasn't seen active development in years, and it hasn't reached a state where it was useful. Remove the code until someone is interested in working on it again. Differential Revision: https://reviews.llvm.org/D59133 llvm-svn: 355862
* [HWASan] Save + print registers when tag mismatch occurs in AArch64.Mitch Phillips2019-03-081-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change change the instrumentation to allow users to view the registers at the point at which tag mismatch occured. Most of the heavy lifting is done in the runtime library, where we save the registers to the stack and emit unwind information. This allows us to reduce the overhead, as very little additional work needs to be done in each __hwasan_check instance. In this implementation, the fast path of __hwasan_check is unmodified. There are an additional 4 instructions (16B) emitted in the slow path in every __hwasan_check instance. This may increase binary size somewhat, but as most of the work is done in the runtime library, it's manageable. The failure trace now contains a list of registers at the point of which the failure occured, in a format similar to that of Android's tombstones. It currently has the following format: Registers where the failure occurred (pc 0x0055555561b4): x0 0000000000000014 x1 0000007ffffff6c0 x2 1100007ffffff6d0 x3 12000056ffffe025 x4 0000007fff800000 x5 0000000000000014 x6 0000007fff800000 x7 0000000000000001 x8 12000056ffffe020 x9 0200007700000000 x10 0200007700000000 x11 0000000000000000 x12 0000007fffffdde0 x13 0000000000000000 x14 02b65b01f7a97490 x15 0000000000000000 x16 0000007fb77376b8 x17 0000000000000012 x18 0000007fb7ed6000 x19 0000005555556078 x20 0000007ffffff768 x21 0000007ffffff778 x22 0000000000000001 x23 0000000000000000 x24 0000000000000000 x25 0000000000000000 x26 0000000000000000 x27 0000000000000000 x28 0000000000000000 x29 0000007ffffff6f0 x30 00000055555561b4 ... and prints after the dump of memory tags around the buggy address. Every register is saved exactly as it was at the point where the tag mismatch occurs, with the exception of x16/x17. These registers are used in the tag mismatch calculation as scratch registers during __hwasan_check, and cannot be saved without affecting the fast path. As these registers are designated as scratch registers for linking, there should be no important information in them that could aid in debugging. Reviewers: pcc, eugenis Reviewed By: pcc, eugenis Subscribers: srhines, kubamracek, mgorny, javed.absar, krytarowski, kristof.beyls, hiraditya, jdoerfert, llvm-commits, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58857 llvm-svn: 355738
* Reland compiler-rt support for order file instrumentation.Manman Ren2019-03-083-0/+41
| | | | | | | | | | | | | | r355343 was landed and was reverted in r355363 due to build breakage. This patch adds Linux/Windows support on top of r355343. In this patch, Darwin should be working with testing case. Linux should be working, I will enable the testing case in a follwup diff. Windows/Other should be building. Correct implementation for Other platforms will be added. Thanks David for reviewing the original diff, helping me with issues on Linux, and giving suggestions for adding support for Other platforms. llvm-svn: 355701
* [TSan] Temporarily disable test which fails on build botJulian Lettner2019-03-071-0/+3
| | | | llvm-svn: 355642
* [TSan] Temporarily disable test which fails on build botJulian Lettner2019-03-071-0/+3
| | | | llvm-svn: 355633
* Delete x86_64 ShadowCallStack supportVlad Tsyrklevich2019-03-076-30/+7
| | | | | | | | | | | | | | | | | | | | | Summary: ShadowCallStack on x86_64 suffered from the same racy security issues as Return Flow Guard and had performance overhead as high as 13% depending on the benchmark. x86_64 ShadowCallStack was always an experimental feature and never shipped a runtime required to support it, as such there are no expected downstream users. Reviewers: pcc Reviewed By: pcc Subscribers: mgorny, javed.absar, hiraditya, jdoerfert, cfe-commits, #sanitizers, llvm-commits Tags: #clang, #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D59034 llvm-svn: 355624
* [NFC][TSan] Add libdispatch tests for non-Darwin platformsJulian Lettner2019-03-0712-0/+540
| | | | | | | | | | | | Add new sets of tests (copy instead of move existing tests) because there could be subtle differences between C/Obj-C and with/without Foundation etc. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D59047 llvm-svn: 355618
* [Sanitizer] Add 'dispatch' feature to be used in compiler-rt testsJulian Lettner2019-03-072-0/+5
| | | | | | | | Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D59037 llvm-svn: 355617
* Revert compiler-rt diffs for order file instrumentation to get bot green!Manman Ren2019-03-053-40/+0
| | | | | | | | This caused issues on Linux/Windows and other platforms. r355343 355350 355350 llvm-svn: 355363
* [sanitizer] Intercept bzero.Evgeniy Stepanov2019-03-042-0/+31
| | | | | | | | | | | | | | | | Summary: Intercept bzero and enable existing __bzero interceptor in Linux. bzero is deprecated but still used occasionally. Reviewers: vitalybuka Subscribers: srhines, kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58850 llvm-svn: 355347
* Order File Instrumentation: dump the data in compiler-rtManman Ren2019-03-043-0/+40
| | | | | | | | The profile data will be dumped in a file default_xxx.profraw.order. Differential Revision: https://reviews.llvm.org/D57530 llvm-svn: 355343
* [build] Rename clang-headers to clang-resource-headersShoaib Meenai2019-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The current install-clang-headers target installs clang's resource directory headers. This is different from the install-llvm-headers target, which installs LLVM's API headers. We want to introduce the corresponding target to clang, and the natural name for that new target would be install-clang-headers. Rename the existing target to install-clang-resource-headers to free up the install-clang-headers name for the new target, following the discussion on cfe-dev [1]. I didn't find any bots on zorg referencing install-clang-headers. I'll send out another PSA to cfe-dev to accompany this rename. [1] http://lists.llvm.org/pipermail/cfe-dev/2019-February/061365.html Reviewers: beanz, phosek, tstellar, rnk, dim, serge-sans-paille Subscribers: mgorny, javed.absar, jdoerfert, #sanitizers, openmp-commits, lldb-commits, cfe-commits, llvm-commits Tags: #clang, #sanitizers, #lldb, #openmp, #llvm Differential Revision: https://reviews.llvm.org/D58791 llvm-svn: 355340
* [NFC][Sanitizer] Test unexpectedly passes on ppc64be botJulian Lettner2019-03-011-1/+1
| | | | llvm-svn: 355239
* [NFC][Sanitizer] Make GetStackTrace a private method of BufferedStackTraceJulian Lettner2019-03-011-0/+3
| | | | | | | | | | GetStackTrace is a implementation detail of BufferedStackTrace. Make it a private method. Reviewed By: vitalybuka Differential-Revision: https://reviews.llvm.org/D58753 llvm-svn: 355232
* [msan] Add an interceptor for ttyname().Evgeniy Stepanov2019-03-011-3/+6
| | | | llvm-svn: 355214
* Reland "[compiler-rt] Intercept the bcmp() function."Clement Courbet2019-03-015-5/+32
| | | | | | | Fix test issues on darwin: The REQUIRES for the test should be the same as the guard for whether we intercept bcmp. llvm-svn: 355204
* [Sanitizer] lit test config: Respect existing parallelism_groupJulian Lettner2019-02-284-4/+8
| | | | llvm-svn: 355128
* [InstrProf] Use separate comdat group for data and countersReid Kleckner2019-02-271-2/+9
| | | | | | | | | | | | | | | | | | | | | | | Summary: I hadn't realized that instrumentation runs before inlining, so we can't use the function as the comdat group. Doing so can create relocations against discarded sections when references to discarded __profc_ variables are inlined into functions outside the function's comdat group. In the future, perhaps we should consider standardizing the comdat group names that ELF and COFF use. It will save object file size, since __profv_$sym won't appear in the symbol table again. Reviewers: xur, vsk Subscribers: eraman, hiraditya, cfe-commits, #sanitizers, llvm-commits Tags: #clang, #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58737 llvm-svn: 355044
* [hwasan, asan] Intercept vfork.Evgeniy Stepanov2019-02-272-0/+63
| | | | | | | | | | | | | | | Summary: Intercept vfork on arm, aarch64, i386 and x86_64. Reviewers: pcc, vitalybuka Subscribers: kubamracek, mgorny, javed.absar, krytarowski, kristof.beyls, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58533 llvm-svn: 355030
OpenPOWER on IntegriCloud