summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [Esan] Port cache frag to FreeBSDDavid Carlier2018-10-048-2/+15
| | | | | | | | | | | | Data involving struct accesses accounting work (plan to support only efficiency-cache-frag flag in the frontend side). Reviewers: krytarowski, vitalybuka, jfb Reviewed By : vitalybuka Differential Revision: https://reviews.llvm.org/D52608 llvm-svn: 343812
* Mark two tests, which require too much available VM, as "UNSUPPORTED: ios".Kuba Mracek2018-10-032-0/+6
| | | | llvm-svn: 343650
* Reland r342652 "[winasan] Unpoison the stack in NtTerminateThread"David Major2018-10-021-0/+1
| | | | | | | | In long-running builds we've seen some ASan complaints during thread creation that we suspect are due to leftover poisoning from previous threads whose stacks occupied that memory. This patch adds a hook that unpoisons the stack just before the NtTerminateThread syscall. Differential Revision: https://reviews.llvm.org/D52091 llvm-svn: 343606
* [sanitizer] Include inlined frames into __sanitizer_symbolize_pc outputVitaly Buka2018-10-021-0/+32
| | | | | | | | | | | | | | | | Summary: Behavior for existing used is not changing as the first line is going to be the same, and it was invalid to try to read more lines. New clients can read until they get empty string. Reviewers: eugenis, morehouse Subscribers: kubamracek, eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D52743 llvm-svn: 343605
* Revert "[sanitizer] Include inlined frames into __sanitizer_symbolize_pc output"Jessica Paquette2018-10-021-30/+0
| | | | | | | | | This reverts r343554. It was breaking some bots: http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA/49997/ llvm-svn: 343600
* [sanitizer] Include inlined frames into __sanitizer_symbolize_pc outputVitaly Buka2018-10-021-0/+30
| | | | | | | | | | | | | | | | Summary: Behavior for existing used is not changing as the first line is going to be the same, and it was invalid to try to read more lines. New clients can read until they get empty string. Reviewers: eugenis, morehouse Subscribers: kubamracek, eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D52743 llvm-svn: 343554
* [sanitizer] Small buffer tests for __sanitizer_symbolize_pcVitaly Buka2018-10-011-3/+20
| | | | llvm-svn: 343534
* [Cfi] Compiling cfi library on FreeBSD and NetBSDDavid Carlier2018-10-012-2/+2
| | | | | | | | | | | | Making the library slighty more portable. Reviewers: vitalybuka, krytarowski Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D51682 llvm-svn: 343510
* Revert r342652 "[winasan] Unpoison the stack in NtTerminateThread"Hans Wennborg2018-09-281-1/+0
| | | | | | | | | | | | | This seems to cause the thread's exit code to be clobbered, breaking Chromium tests. Also revert follow-up r342654. > In long-running builds we've seen some ASan complaints during thread creation that we suspect are due to leftover poisoning from previous threads whose stacks occupied that memory. This patch adds a hook that unpoisons the stack just before the NtTerminateThread syscall. > > Differential Revision: https://reviews.llvm.org/D52091 llvm-svn: 343322
* [XRay] Fix fdr-thread-order.cc when current directory contains ↵Fangrui Song2018-09-281-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fdr-thread-order.cc Summary: Currently, cd test/xray/TestCases/Posix $build/bin/llvm-lit fdr-thread-order.cc fails because `rm fdr-thread-order.*` deletes the .cc file. This patch uses: * %t as temporary directory name containing log files * %t.exe as executable name It does not delete %t after the test finishes for debugging convenience. This matches the behavior of tests of various other LLVM components. Log files will not clog up because the temporary directory (unique among test files but the same among multiple invocations of a test) is cleaned at the beginning of the test. Reviewers: dberris, mboerger, eizan Reviewed By: dberris Subscribers: delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D52638 llvm-svn: 343295
* [XRay] Fix argv0-log-file-name.cc race when tests are executed parallellyFangrui Song2018-09-271-1/+1
| | | | | | | `rm xray-log.*` may delete log files of other tests and cause them to fail, when tests are executed parallelly. llvm-svn: 343282
* [XRay] Add LD_LIBRARY_PATH to env variables for Unit TestsDean Michael Berris2018-09-271-0/+8
| | | | | | | | | | | | | | | | | Summary: This change allows us to use the library path from which the LLVM libraries are installed, in case the LLVM installation generates shared libraries. This should address llvm.org/PR39070. Reviewers: mboerger, eizan Subscribers: mgorny, jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D52597 llvm-svn: 343280
* [compiler-rt][ubsan][NFC] Slight test cleanup in preparation for D50902.Roman Lebedev2018-09-272-90/+605
| | | | | | | | | | | | Reviewers: vsk, vitalybuka, filcab Reviewed By: vitalybuka Subscribers: kubamracek, dberris, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D52590 llvm-svn: 343250
* [compiler-rt] [builtins] Restore tests from r342917 (disabled in r343095) on ↵Jordan Rupprecht2018-09-273-9/+3
| | | | | | | | | | | | | | | | | | | Windows. Summary: -lm is needed for these tests on Linux, but the lit config for this package automatically adds it for Linux and excludes it for Windows. So we should be able to get these tests running again by just dropping -lm and let the lit config add it when possible. I was under the impression that -lm worked across platforms because it exists in other tests without and 'UNSUPPORTED: windows' commands (e.g. divsc3_test.c), but those are actually excluded because they 'REQUIRES: c99-complex' which is excluded from windows platforms (also by the local lit config). I don't have easy access to a windows machine to verify this patch, but I can trigger a build bot run on clang-x64-ninja-win7 shortly after submitting. Reviewers: hans Subscribers: dberris, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D52563 llvm-svn: 343245
* [Coverage] Disable Linux/coverage-missing.cc in AddressSanitizer-i386-linux ↵Fangrui Song2018-09-271-1/+9
| | | | | | | | | | | | | | | testsuite sancov.py relies on objdump -d to obtain the number of instrumented PCs. The i386 %dynamiclib will now include .plt entries that are not recognized by objdump, "sancov.py: found 0 instrumented PCs in *.so", causing AddressSanitizer-i386-linux to fail. Change it back to x86-target-arch after %sancov switches to a more robust approach. llvm-svn: 343178
* Disable tests from r342917 on Windows; -lm won't work thereHans Wennborg2018-09-263-0/+6
| | | | llvm-svn: 343095
* [Profile] Fix gcov testsCalixte Denizet2018-09-253-7/+7
| | | | | | | | | | | | | | Summary: The gcda need to be delete before running the binary to avoid to have an increasing "# of Runs" when a test is failing Reviewers: vitalybuka, eugenis, marco-c Reviewed By: marco-c Subscribers: delcypher, llvm-commits, #sanitizers, sylvestre.ledru, marco-c Differential Revision: https://reviews.llvm.org/D52456 llvm-svn: 342963
* [hwasan] Record and display stack history in stack-based reports.Evgeniy Stepanov2018-09-243-0/+175
| | | | | | | | | | | | | | | | | | | | | Summary: Display a list of recent stack frames (not a stack trace!) when tag-mismatch is detected on a stack address. The implementation uses alignment tricks to get both the address of the history buffer, and the base address of the shadow with a single 8-byte load. See the comment in hwasan_thread_list.h for more details. Developed in collaboration with Kostya Serebryany. Reviewers: kcc Subscribers: srhines, kubamracek, mgorny, hiraditya, jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D52249 llvm-svn: 342923
* Revert "[hwasan] Record and display stack history in stack-based reports."Evgeniy Stepanov2018-09-243-175/+0
| | | | | | This reverts commit r342921: test failures on clang-cmake-arm* bots. llvm-svn: 342922
* [hwasan] Record and display stack history in stack-based reports.Evgeniy Stepanov2018-09-243-0/+175
| | | | | | | | | | | | | | | | | | | | | Summary: Display a list of recent stack frames (not a stack trace!) when tag-mismatch is detected on a stack address. The implementation uses alignment tricks to get both the address of the history buffer, and the base address of the shadow with a single 8-byte load. See the comment in hwasan_thread_list.h for more details. Developed in collaboration with Kostya Serebryany. Reviewers: kcc Subscribers: srhines, kubamracek, mgorny, hiraditya, jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D52249 llvm-svn: 342921
* [compiler-rt] [builtins] Add logb/logbf/logbl methods to compiler-rt to ↵Jordan Rupprecht2018-09-243-0/+205
| | | | | | | | | | | | | | | | | | | | | | | avoid libm dependencies when possible. Summary: The complex division builtins (div?c3) use logb methods from libm to scale numbers during division and avoid rounding issues. However, these come from libm, meaning anyone that uses --rtlib=compiler-rt also has to include -lm. Implement logb* methods for standard ieee 754 floats so we can avoid -lm on those platforms, falling back to the old behavior (using either logb() or `__builtin_logb()`) when not supported. These new methods are defined internally as `__compiler_rt_logb` so as not to conflict with the libm definitions in any way. This fixes just the libm methods mentioned in PR32279 and PR28652. libc is still required, although that seems to not be an issue. Note: this is proposed as an alternative to just adding -lm: D49330. Reviewers: efriedma, compnerd, scanon, echristo Reviewed By: echristo Subscribers: jsji, echristo, nemanjai, dberris, mgorny, kbarton, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D49514 llvm-svn: 342917
* [profile] Revert commit https://reviews.llvm.org/rL342718Calixte Denizet2018-09-2416-19/+20
| | | | llvm-svn: 342913
* When running the ios/iossim prepare script show the script output when it ↵Dan Liew2018-09-241-1/+6
| | | | | | | | | | | | | | | | | | | returns with a non-zero exit code. Summary: Previously we'd just show the exception and not the output from the executed script. This is unhelpful in the case that the script actually reports some useful information on the failure. Now we print the output and re-raise the exception. Reviewers: kubamracek, george.karpenkov Subscribers: #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D52350 llvm-svn: 342869
* SafeStack: Fix flaky test (PR39001)Vlad Tsyrklevich2018-09-211-8/+16
| | | | | | | | | | | | | | | | | | | | Summary: pthread_join() can return before a thread finishes exit()ing in the kernel and a subsequent tgkill() can report the thread still alive. Update the pthread-cleanup.c test to sleep and retry if it hits this possible flake. Thanks to Jeremy Morse for reporting. Reviewers: jmorse, eugenis, vitalybuka Reviewed By: jmorse, vitalybuka Subscribers: delcypher, jfb, llvm-commits, #sanitizers, kcc Differential Revision: https://reviews.llvm.org/D52330 llvm-svn: 342763
* [libfuzzer] Fix a test's run lineJeremy Morse2018-09-211-0/+1
| | | | | | | | | | r342698 removed the 'UNSUPPORTED: windows' flags from a number of fuzzer tests, however too many lines were removed from 'fuzzer-flags.test', including the run-line that generates the test binary, which breaks that test for me (and the clang-x64-ninja-win7 buildbot). This patch just re-adds that line. llvm-svn: 342720
* [profile] Fix the tests for patch in https://reviews.llvm.org/D49916.Calixte Denizet2018-09-2116-20/+19
| | | | | | | | | | | | | | | | | Summary: The goal of D49916 is to remove some hit counters from lines like '}'. So as a consequence, the tests must be fixed. FYI, after holidays, I'll add more tests. Reviewers: marco-c, davidxl Reviewed By: marco-c Subscribers: delcypher, llvm-commits, #sanitizers, sylvestre.ledru Differential Revision: https://reviews.llvm.org/D49917 llvm-svn: 342718
* [fuzzer] Replace FuzzerExtFunctionsDlsymWin.cpp with ↵Jonathan Metzman2018-09-206-13/+0
| | | | | | | | | | | | | | | | | | | | | FuzzerExtFunctionsWeakAlias.cpp Summary: Replace FuzzerExtFunctionsDlsymWin.cpp with FuzzerExtFunctionsWeakAlias.cpp to get externally defined functions (eg: LLVMFuzzerInitialize, LLVMFuzzerCustomMutator, etc) working again. Also enable tests that depended on these functions (on windows) Reviewers: rnk, morehouse Reviewed By: rnk, morehouse Subscribers: rnk, morehouse, mgorny Differential Revision: https://reviews.llvm.org/D51700 llvm-svn: 342698
* [profile] Fix tests in compiler-rt for patch in gcov ↵Calixte Denizet2018-09-203-5/+3
| | | | | | | | | | | | | | | | (https://reviews.llvm.org/D49659) Summary: Some tests are broken if patch in D49659 is accepted so this patch fixes them. Reviewers: marco-c Reviewed By: marco-c Subscribers: dberris, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D49721 llvm-svn: 342661
* Fix test after r342652David Major2018-09-201-0/+1
| | | | llvm-svn: 342654
* [UBSan] Fix typo in CMake conditional that checked if the architectureDan Liew2018-09-191-1/+1
| | | | | | | | | | | | | | of a darwin platform was in the list of `UBSAN_SUPPORTED_ARCH`. This is a follow up to r341306. The typo meant that if an architecture was a prefix to another architecture in the list (e.g. `armv7` is a prefix of `armv7k`) then this would trigger a match which is not the intended behaviour. rdar://problem/41126835 llvm-svn: 342553
* [UBSan] Partially fix `test/ubsan/TestCases/Misc/log-path_test.cc` so that ↵Dan Liew2018-09-173-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | it can run on devices. Summary: In order for this test to work the log file needs to be removed from both from the host and device. To fix this the `rm` `RUN` lines have been replaced with `RUN: rm` followed by `RUN: %device_rm`. Initially I tried having it so that `RUN: %run rm` implicitly runs `rm` on the host as well so that only one `RUN` line is needed. This simplified writing the test however that had two large drawbacks. * It's potentially very confusing (e.g. for use of the device scripts outside of the lit tests) if asking for `rm` to run on device also causes files on the host to be deleted. * This doesn't work well with the glob patterns used in the test. The host shell expands the `%t.log.*` glob pattern and not on the device so we could easily miss deleting old log files from previous test runs if the corresponding file doesn't exist on the host. So instead deletion of files on the device and host are explicitly separate commands. The command to delete files from a device is provided by a new substitution `%device_rm` as suggested by Filipe Cabecinhas. The semantics of `%device_rm` are that: * It provides a way remove files from a target device when the host is not the same as the target. In the case that the host and target are the same it is a no-op. * It interprets shell glob patterns in the context of the device file system instead of the host file system. This solves the globbing problem provided the argument is quoted so that lit's underlying shell doesn't try to expand the glob pattern. * It supports the `-r` and `-f` flags of the `rm` command, with the same semantics. Right now an implementation of `%device_rm` is provided only for ios devices. For all other devices a lit warning is emitted and the `%device_rm` is treated as a no-op. This done to avoid changing the behaviour for other device types but leaves room for others to implement `%device_rm`. The ios device implementation uses the `%run` wrapper to do the work of removing files on a device. The `iossim_run.py` script has been fixed so that it just runs `rm` on the host operating system because the device and host file system are the same. rdar://problem/41126835 Reviewers: vsk, kubamracek, george.karpenkov, eugenis Subscribers: #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D51648 llvm-svn: 342391
* [XRay] Remove the unused variablePetr Hosek2018-09-151-2/+0
| | | | | | | This broke the fdr-single-thread test after FDRLoggingOptions struct has been removed in r342318. llvm-svn: 342320
* [XRay] Remove the deprecated __xray_log_init APIPetr Hosek2018-09-154-14/+3
| | | | | | | | | This API has been deprecated three months ago and shouldn't be used anymore, all clients should migrate to the new string based API. Differential Revision: https://reviews.llvm.org/D51606 llvm-svn: 342318
* [libFuzzer] Disable value-profile-strncmp.test on aarch64.Matt Morehouse2018-09-141-1/+1
| | | | | | | Test no longer finds the BINGO on clang-cmake-aarch64-full bot, and I can't reproduce on our ARM machine. llvm-svn: 342255
* [asan] Fix test case failure on SystemZUlrich Weigand2018-09-141-0/+2
| | | | | | | | | Since we changed our inlining parameters, this test case was failing on SystemZ, as the two tests were now both inlined into the main function, which the test didn't expect. Fixed by adding a few more noinline attributes. llvm-svn: 342236
* [XRay][clang] Emit "never-instrument" attributeDean Michael Berris2018-09-141-0/+11
| | | | | | | | | | | | | | | | | | | | | | | Summary: Before this change, we only emit the XRay attributes in LLVM IR when the -fxray-instrument flag is provided. This may cause issues with thinlto when the final binary is being built/linked with -fxray-instrument, and the constitutent LLVM IR gets re-lowered with xray instrumentation. With this change, we can honour the "never-instrument "attributes provided in the source code and preserve those in the IR. This way, even in thinlto builds, we retain the attributes which say whether functions should never be XRay instrumented. This change addresses llvm.org/PR38922. Reviewers: mboerger, eizan Subscribers: mehdi_amini, dexonsmith, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D52015 llvm-svn: 342200
* [hwasan] On every use-after-free print a developer note: the index of this ↵Kostya Serebryany2018-09-121-0/+27
| | | | | | heap object in the thread's deallocation ring buffer. Mostly useful to hwasan developers, will hopefully let us know the good size of the deallocation ring buffer llvm-svn: 342014
* [hwasan] tests for a buffer overflow with a large allocationKostya Serebryany2018-09-121-1/+6
| | | | llvm-svn: 342011
* [gcov] Fix branch counters with switch statements (fix PR38821)Vedant Kumar2018-09-112-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Right now, the counters are added in regards of the number of successors for a given BasicBlock: it's good when we've only 1 or 2 successors (at least with BranchInstr). But in the case of a switch statement, the BasicBlock after switch has several predecessors and we need know from which BB we're coming from. So the idea is to revert what we're doing: add a PHINode in each block which will select the counter according to the incoming BB. They're several pros for doing that: - we fix the "switch" bug - we remove the function call to "__llvm_gcov_indirect_counter_increment" and the lookup table stuff - we replace by PHINodes, so the optimizer will probably makes a better job. Patch by calixte! Differential Revision: https://reviews.llvm.org/D51619 llvm-svn: 341977
* [Msan] Fix unit test linkage issue on FreeBSDDavid Carlier2018-09-111-1/+1
| | | | | | | | | | | | Fix typical relocation linkage issue. Reviwewers: dim, emaste Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D51681 llvm-svn: 341924
* [hwasan] Re-enable print-memory-usage-android test.Evgeniy Stepanov2018-09-101-3/+6
| | | | | | | The problem was not in a non-rooted device, but in tagged local variable address passed to a system call, see comments in the code. llvm-svn: 341875
* [hwasan] rename two .cc tests into .cKostya Serebryany2018-09-082-6/+6
| | | | llvm-svn: 341739
* [hwasan] Disable print-memory-usage-android test.Evgeniy Stepanov2018-09-081-0/+5
| | | | | | Requires a rooted device => fails on sanitizer-x86_64-linux-android bot. llvm-svn: 341738
* [hwasan] Export memory stats through /proc/$PID/maps.Evgeniy Stepanov2018-09-081-0/+13
| | | | | | | Adds a line to /proc/$PID/maps with more or less up-to-date memory stats of the process. llvm-svn: 341735
* [MSan] Define %clang_kmsan for KMSAN testsAlexander Potapenko2018-09-071-0/+6
| | | | llvm-svn: 341638
* [libfuzzer] Enable trace-malloc-unballanced.test on Windows.Jonathan Metzman2018-09-071-5/+7
| | | | | | | | | | | | | | | | | Summary: Enables trace-malloc-unbalanced.test on Windows, fixing two problems it had with Windows before. The first fix is specifying python instead of relying on a script's shebang since they can't be used on Windows. The second fix is making the regex tolerate windows' implementation of the "%p" format string. Reviewers: Dor1s Reviewed By: Dor1s Subscribers: morehouse Differential Revision: https://reviews.llvm.org/D51760 llvm-svn: 341632
* [hwasan] relax the rint-memory-usage.c test furtherKostya Serebryany2018-09-071-5/+5
| | | | llvm-svn: 341625
* [libfuzzer] Use cl driver mode for tests and enable another test on WindowsJonathan Metzman2018-09-072-7/+11
| | | | | | | | | | | | | | | | | | | Summary: When targeting MSVC: compile using clang's cl driver mode (this is needed for libfuzzer's exit_on_src_pos feature). Don't use -lstdc++ when linking, it isn't needed and causes a warning. On Windows: Fix exit_on_src_pos.test by making sure debug info isn't overwritten during compilation of second binary by using .exe extension. Reviewers: morehouse Reviewed By: morehouse Subscribers: aprantl, JDevlieghere Differential Revision: https://reviews.llvm.org/D51757 llvm-svn: 341622
* [hwasan] make the print-memory-usage.c less agressive: do not assume that ↵Kostya Serebryany2018-09-071-3/+4
| | | | | | malloc can't happen before main llvm-svn: 341615
* [hwasan] Fix malloc overflow detection.Evgeniy Stepanov2018-09-071-0/+80
| | | | | | | | | Check size limit before rounding up, otherwise malloc((size_t)-1) would happily allocate 0 bytes. Steal a nice test case from scudo. llvm-svn: 341612
OpenPOWER on IntegriCloud