summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [tsan] Don't delay SIGTRAP handlerVitaly Buka2019-10-071-0/+29
| | | | | | | | | | | | Reviewers: eugenis, jfb Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D68604 llvm-svn: 373978
* [compiler-rt] Remove O1 tests from signal_line.cppVitaly Buka2019-10-041-4/+0
| | | | | | It does not work on arm llvm-svn: 373702
* [compiler-rt] Fix signal_line.cpp testVitaly Buka2019-10-041-2/+2
| | | | | | r373682 committed wrong experimental version llvm-svn: 373684
* [compiler-rt] Remove O2, O3 from signal_line test for fix android testsVitaly Buka2019-10-041-11/+2
| | | | llvm-svn: 373682
* [compiler-rt] More optimization levels in signal_line.cpp testVitaly Buka2019-10-031-12/+13
| | | | llvm-svn: 373642
* [sanitizer_common] Disable onprint.cpp on Android.Matt Morehouse2019-10-021-0/+2
| | | | | | The test fails to find the written file on Android. llvm-svn: 373531
* [compiler-rt] Use GetNextInstructionPc in signal handlersVitaly Buka2019-10-021-0/+36
| | | | | | | | | | | | | | | | | | Summary: All other stack trace callers assume that PC contains return address. HWAsan already use GetNextInstructionPc in similar code. PR43339 Reviewers: eugenis, kcc, jfb Subscribers: dexonsmith, dberris, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D68313 llvm-svn: 373529
* [sanitizer_common] Rename OnPrint to __sanitizer_on_print.Matt Morehouse2019-10-021-0/+31
| | | | | | | | | | | | | | | | | | Summary: https://reviews.llvm.org/D28596 exposed OnPrint in the global namespace, which can cause collisions with user-defined OnPrint() functions. Reviewers: vitalybuka, dvyukov Reviewed By: vitalybuka, dvyukov Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67987 llvm-svn: 373518
* [CMake] Fix the value of `config.target_cflags` for non-macOS Apple ↵Dan Liew2019-10-014-50/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | platforms. Attempt #3. The main problem here is that `-*-version_min=` was not being passed to the compiler when building test cases. This can cause problems when testing on devices running older OSs because Clang would previously assume the minimum deployment target is the the latest OS in the SDK which could be much newer than what the device is running. Previously the generated value looked like this: `-arch arm64 -isysroot <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk` With this change it now looks like: `-arch arm64 -stdlib=libc++ -miphoneos-version-min=8.0 -isysroot <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk` This mirrors the setting of config.target_cflags on macOS. This change is made for ASan, LibFuzzer, TSan, and UBSan. To implement this a new `get_test_cflags_for_apple_platform()` function has been added that when given an Apple platform name and architecture returns a string containing the C compiler flags to use when building tests. This also calls a new helper function `is_valid_apple_platform()` that validates Apple platform names. This is the third attempt at landing the patch. The first attempt (r359305) had to be reverted (r359327) due to a buildbot failure. The problem was that calling `get_test_cflags_for_apple_platform()` can trigger a CMake error if the provided architecture is not supported by the current CMake configuration. Previously, this could be triggered by passing `-DCOMPILER_RT_ENABLE_IOS=OFF` to CMake. The root cause is that we were generating test configurations for a list of architectures without checking if the relevant Sanitizer actually supported that architecture. We now intersect the list of architectures for an Apple platform with `<SANITIZER>_SUPPORTED_ARCH` (where `<SANITIZER>` is a Sanitizer name) to iterate through the correct list of architectures. The second attempt (r363633) had to be reverted (r363779) due to a build failure. The failed build was using a modified Apple toolchain where the iOS simulator SDK was missing. This exposed a bug in the existing UBSan test generation code where it was assumed that `COMPILER_RT_ENABLE_IOS` implied that the toolchain supported both iOS and the iOS simulator. This is not true. This has been fixed by using the list `SANITIZER_COMMON_SUPPORTED_OS` for the list of supported Apple platforms for UBSan. For consistency with the other Sanitizers we also now intersect the list of architectures with UBSAN_SUPPORTED_ARCH. rdar://problem/50124489 Differential Revision: https://reviews.llvm.org/D61242 llvm-svn: 373405
* [libFuzzer] Remove lazy counters.Matt Morehouse2019-10-011-3/+0
| | | | | | | | | | | | | | | | Summary: Lazy counters haven't improved performance for large fuzz targets. Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67476 llvm-svn: 373403
* [msan] Intercept __getrlimit.Evgeniy Stepanov2019-09-301-0/+16
| | | | | | | | | | | | | | | | | | | | Summary: This interceptor is useful on its own, but the main purpose of this change is to intercept libpthread initialization on linux/glibc in order to run __msan_init before any .preinit_array constructors. We used to trigger on pthread_initialize_minimal -> getrlimit(), but that call has changed to __getrlimit at some point. Reviewers: vitalybuka, pcc Subscribers: jfb, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D68168 llvm-svn: 373239
* Revert "[profile] Add a test dependency on cxx-headers"Vedant Kumar2019-09-271-1/+1
| | | | | | | | | | This reverts commit b539350f7d006b7d6f42c5c4b5715da87a52e5d8. See: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/52140/steps/annotate/logs/stdio The cxx-headers target doesn't exist everywhere. llvm-svn: 373123
* [profile] Mark instrprof-gcov-fork.test UNSUPPORTED on Darwin as wellVedant Kumar2019-09-271-0/+1
| | | | | | | | | | This test remains flaky everywhere, I think. We should consider deleting it and accompanying support code in GCOVProfiling: I've stopped short of doing that now as the gcov exec* tests appear to be stable. See the thread re: r347779. llvm-svn: 373121
* [profile] Add a test dependency on cxx-headersVedant Kumar2019-09-271-1/+1
| | | | | | | This enables running profile runtime tests which #include <string>, etc. via just `check-profile`. llvm-svn: 373120
* hwasan: Compatibility fixes for short granules.Peter Collingbourne2019-09-272-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | We can't use short granules with stack instrumentation when targeting older API levels because the rest of the system won't understand the short granule tags stored in shadow memory. Moreover, we need to be able to let old binaries (which won't understand short granule tags) run on a new system that supports short granule tags. Such binaries will call the __hwasan_tag_mismatch function when their outlined checks fail. We can compensate for the binary's lack of support for short granules by implementing the short granule part of the check in the __hwasan_tag_mismatch function. Unfortunately we can't do anything about inline checks, but I don't believe that we can generate these by default on aarch64, nor did we do so when the ABI was fixed. A new function, __hwasan_tag_mismatch_v2, is introduced that lets code targeting the new runtime avoid redoing the short granule check. Because tag mismatches are rare this isn't important from a performance perspective; the main benefit is that it introduces a symbol dependency that prevents binaries targeting the new runtime from running on older (i.e. incompatible) runtimes. Differential Revision: https://reviews.llvm.org/D68059 llvm-svn: 373035
* [libFuzzer] [NFC] Fix grammar error with "it's"Mitch Phillips2019-09-261-1/+1
| | | | llvm-svn: 372937
* builtins test: Move clear_cache_test.c from a mprotect()ed global to a ↵Nico Weber2019-09-251-28/+21
| | | | | | | | | | | | | | | | | | mmap()ed variable ld64 in the macOS 10.15 SDK gives __DATA a maxprot of 3, meaning it can't be made executable at runtime by default. Change clear_cache_test.c to use mmap()ed data that's mapped as writable and executable from the beginning, instead of trying to mprotect()ing a __DATA variable as executable. This fixes the test on macOS with the 10.15 SDK. PR43407. Differential Revision: https://reviews.llvm.org/D67929 llvm-svn: 372849
* [TSAN] Add read/write range interface functions with PCJoachim Protze2019-09-241-0/+40
| | | | | | | | | | Adding annotation function variants __tsan_write_range_pc and __tsan_read_range_pc to annotate ranged access to memory while providing a program counter for the access. Differential Revision: https://reviews.llvm.org/D66885 llvm-svn: 372730
* [llvm-cov] NFC: Specify a specific C++ standard in the test.Artem Dergachev2019-09-241-3/+6
| | | | | | Makes life easier for downstream users with customized default standard. llvm-svn: 372674
* Avoid memory leak in ASan testKamil Rytarowski2019-09-211-0/+1
| | | | | | | | | | | | | | | | | | | Summary: Add missing free(3) for the malloc(3) call. Detected on NetBSD with LSan. Reviewers: joerg, mgorny, vitalybuka, dvyukov Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D67330 llvm-svn: 372460
* [lsan] Fix deadlock in dl_iterate_phdr.Evgeniy Stepanov2019-09-191-0/+52
| | | | | | | | | | | | | | | | | Summary: Do not grab the allocator lock before calling dl_iterate_phdr. This may cause a lock order inversion with (valid) user code that uses malloc inside a dl_iterate_phdr callback. Reviewers: vitalybuka, hctim Subscribers: jfb, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D67738 llvm-svn: 372348
* [test] Clean up previous raw profile before merging into itVedant Kumar2019-09-161-1/+1
| | | | | | | This fixes a test failure in instrprof-set-file-object-merging.c which seems to have been caused by reuse of stale data in old raw profiles. llvm-svn: 372041
* Commit missing part of "Split many_tls_keys.cpp into two tests"Kamil Rytarowski2019-09-152-28/+8
| | | | | | | | https://reviews.llvm.org/D67428 This change was lost due to a file rename and modification. llvm-svn: 371941
* compiler-rt/builtins: Make check-builtins run tests on macOS.Nico Weber2019-09-142-4/+11
| | | | | | Differential Revision: https://reviews.llvm.org/D66984 llvm-svn: 371926
* Split many_tls_keys.cpp into two testsKamil Rytarowski2019-09-122-0/+61
| | | | | | | | | | | | | | | | | | | | | Summary: many_tls_keys_pthread.cpp for TSD many_tls_keys_thread.cpp for TLS The TSD test is unsupported on NetBSD as it assumes TLS used internally. TSD on NetBSD does not use TLS. Reviewers: joerg, vitalybuka, mgorny, dvyukov, kcc Reviewed By: vitalybuka Subscribers: jfb, llvm-commits, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D67428 llvm-svn: 371757
* [compiler-rt] Remove some cpplint filtersVitaly Buka2019-09-121-2/+2
| | | | llvm-svn: 371704
* [compiler-rt] Run cpplint only for check-sanitizerVitaly Buka2019-09-122-3/+5
| | | | llvm-svn: 371703
* Remove NOLINTs from compiler-rtVitaly Buka2019-09-119-23/+29
| | | | llvm-svn: 371687
* Update compiler-rt cpplint.pyVitaly Buka2019-09-114-9/+9
| | | | | | https://github.com/cpplint/cpplint/commit/adb3500107f409ac5491188ae652ac3f4d03d9d3 llvm-svn: 371675
* [libFuzzer] Remove hardcoded number of new features in merge_two_step.test.Max Moroz2019-09-111-2/+2
| | | | | | | | | | | | | | | | | | | | Summary: The number of features can be different on different platforms. This should fixed broken builders, e.g. http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/7946 Reviewers: Dor1s Reviewed By: Dor1s Subscribers: kristof.beyls, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D67458 llvm-svn: 371647
* [libFuzzer] Make -merge=1 to reuse coverage information from the control file.Max Moroz2019-09-112-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change allows to perform corpus merging in two steps. This is useful when the user wants to address the following two points simultaneously: 1) Get trustworthy incremental stats for the coverage and corpus size changes when adding new corpus units. 2) Make sure the shorter units will be preferred when two or more units give the same unique signal (equivalent to the `REDUCE` logic). This solution was brainstormed together with @kcc, hopefully it looks good to the other people too. The proposed use case scenario: 1) We have a `fuzz_target` binary and `existing_corpus` directory. 2) We do fuzzing and write new units into the `new_corpus` directory. 3) We want to merge the new corpus into the existing corpus and satisfy the points mentioned above. 4) We create an empty directory `merged_corpus` and run the first merge step: ` ./fuzz_target -merge=1 -merge_control_file=MCF ./merged_corpus ./existing_corpus ` this provides the initial stats for `existing_corpus`, e.g. from the output: ` MERGE-OUTER: 3 new files with 11 new features added; 11 new coverage edges ` 5) We recreate `merged_corpus` directory and run the second merge step: ` ./fuzz_target -merge=1 -merge_control_file=MCF ./merged_corpus ./existing_corpus ./new_corpus ` this provides the final stats for the merged corpus, e.g. from the output: ` MERGE-OUTER: 6 new files with 14 new features added; 14 new coverage edges ` Alternative solutions to this approach are: A) Store precise coverage information for every unit (not only unique signal). B) Execute the same two steps without reusing the control file. Either of these would be suboptimal as it would impose an extra disk or CPU load respectively, which is bad given the quadratic complexity in the worst case. Tested on Linux, Mac, Windows. Reviewers: morehouse, metzman, hctim, kcc Reviewed By: morehouse Subscribers: JDevlieghere, delcypher, mgrang, #sanitizers, llvm-commits, kcc Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D66107 llvm-svn: 371620
* Remove xfail i386 NetBSD mark in vptr-non-unique-typeinfo.cppKamil Rytarowski2019-09-101-1/+0
| | | | | | This test passes now. llvm-svn: 371575
* Remove xfail NetBSD mark from ignored-interceptors-mmap.cppKamil Rytarowski2019-09-101-1/+0
| | | | | | This test now passes. llvm-svn: 371574
* [UBSan] Follow up fix for r371442.Max Moroz2019-09-091-1/+1
| | | | | | | | | | | | | | Reviewers: vitalybuka, hctim, Dor1s Reviewed By: Dor1s Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D67371 llvm-svn: 371453
* [TSan] Add AnnotateIgnoreReadsBegin declaration to tsan/test.hJulian Lettner2019-09-096-31/+5
| | | | | | | | | | | | Declare the family of AnnotateIgnore[Read,Write][Begin,End] TSan annotations in compiler-rt/test/tsan/test.h so that we don't have to declare them separately in every test that needs them. Replace usages. Leave usages that explicitly test the annotation mechanism: thread_end_with_ignore.cpp thread_end_with_ignore3.cpp llvm-svn: 371446
* [UBSan] Do not overwrite the default print_summary sanitizer option.Max Moroz2019-09-091-0/+11
| | | | | | | | | | | | | | | | | | | | | Summary: This option is true by default in sanitizer common. The default false value was added a while ago without any reasoning in https://github.com/llvm-mirror/compiler-rt/commit/524e934112a593ac081bf2b05aa0d60a67987f05 so, presumably it's safe to remove for consistency. Reviewers: hctim, samsonov, morehouse, kcc, vitalybuka Reviewed By: hctim, samsonov, vitalybuka Subscribers: delcypher, #sanitizers, llvm-commits, kcc Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D67193 llvm-svn: 371442
* [TSan] Add interceptors for mach_vm_[de]allocateJulian Lettner2019-09-091-0/+73
| | | | | | | | | | | | I verified that the test is red without the interceptors. rdar://40334350 Reviewed By: kubamracek, vitalybuka Differential Revision: https://reviews.llvm.org/D66616 llvm-svn: 371439
* Enable LSan for NetBSD/i386 in test/asan/lit.cfg.pyKamil Rytarowski2019-09-081-1/+1
| | | | llvm-svn: 371354
* Enable LSan tests for NetBSD/i386Kamil Rytarowski2019-09-081-1/+1
| | | | llvm-svn: 371338
* Stop marking 5 ASan tests as failing on NetBSD/i386Kamil Rytarowski2019-09-084-6/+0
| | | | | | | | | | Unexpected Passing Tests (4): AddressSanitizer-i386-netbsd :: TestCases/Posix/coverage-reset.cpp AddressSanitizer-i386-netbsd :: TestCases/Posix/coverage.cpp AddressSanitizer-i386-netbsd :: TestCases/Posix/interception-in-shared-lib-test.cpp AddressSanitizer-i386-netbsd :: TestCases/suppressions-library.cpp llvm-svn: 371337
* [ASan] Only run dlopen-mixed-c-cxx.c with static runtimeJonas Hahnfeld2019-09-081-2/+3
| | | | | | | | | | | | | | This is what the original bug (http://llvm.org/PR39641) and the fix in https://reviews.llvm.org/D63877 have been about. With the dynamic runtime the test only passes when the asan library is linked against libstdc++: In contrast to libc++abi, it does not implement __cxa_rethrow_primary_exception so the regex matches the line saying that asan cannot intercept this function. Indeed, there is no message that the runtime failed to intercept __cxa_throw. Differential Revision: https://reviews.llvm.org/D67298 llvm-svn: 371336
* Enable leak-detection for NetBSD/amd64 in test/asanKamil Rytarowski2019-09-081-1/+2
| | | | llvm-svn: 371335
* Revert "Revert "[builtins] Rounding mode support for addxf3/subxf3""Yi Kong2019-09-052-1/+62
| | | | | | | | Test failure fixed. This reverts commit e204d244badb2e9765a1020f41c773f63da208f4. llvm-svn: 371003
* Further relax checks in asan-symbolize-bad-path.cppAlexander Richardson2019-08-281-2/+2
| | | | | | | | | | It turns out that the DarwinSymbolizer does not print the "in" part for invalid files but instead prints #0 0xabcdabcd (.../asan-symbolize-bad-path.cpp.tmp/bad/path:i386+0x1234) This tests is only checking that asan_symbolize.py doesn't hang or crash, so further relax the checks to ensure that the test passes on macOS. llvm-svn: 370243
* [XRay] Fixing one test case for FreeBSDDavid Carlier2019-08-281-0/+10
| | | | | | | | | | Reviewers: dberris Reviewed By: dberris Differential Revision: https://reviews.llvm.org/D66867 llvm-svn: 370209
* Fix asan-symbolize-bad-path.cpp on DarwinAlexander Richardson2019-08-271-1/+2
| | | | | | | | I accidentally made the CHECK line stricter when committing D65322. While it happens to work for Linux and FreeBSD, it broke on Darwin. This commit restores the previous behaviour. llvm-svn: 370110
* Relax test introduced in D65322Alexander Richardson2019-08-271-2/+2
| | | | | | | | | | | It is possible that addr2line returns a valid function and file name for the passed address on some build configuations. The test is only checking that asan_symbolize doesn't assert any more when passed a valid file with an invalid address so there is no need to check that it can't find a valid function name. This should fix http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux llvm-svn: 370021
* msan, codegen, instcombine: Keep more lifetime markers used for msanVitaly Buka2019-08-261-0/+18
| | | | | | | | | | | | Reviewers: eugenis Subscribers: hiraditya, cfe-commits, #sanitizers, llvm-commits Tags: #clang, #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D66695 llvm-svn: 369979
* [hwasan] Fix test failure in r369721.Evgeniy Stepanov2019-08-261-3/+6
| | | | | | | | | Try harder to emulate "old runtime" in the test. To get the old behavior with the new runtime library, we need both disable personality function wrapping and enable landing pad instrumentation. llvm-svn: 369977
* [asan_symbolize] Avoid blocking when llvm-symbolizer is installed as addr2lineAlexander Richardson2019-08-261-2/+13
| | | | | | | | | | | | | | | | | | | | | | Summary: Currently, llvm-symbolizer will print -1 when presented with -1 and not print a second line. In that case we will block for ever trying to read the file name. This also happens for non-existent files, in which case GNU addr2line exits immediate, but llvm-symbolizer does not (see https://llvm.org/PR42754). While touching these lines, I also added some more debug logging to help diagnose this and potential future issues. Reviewers: kcc, eugenis, glider, samsonov Reviewed By: eugenis Subscribers: kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D65322 llvm-svn: 369924
OpenPOWER on IntegriCloud