summaryrefslogtreecommitdiff
path: root/lib/msan/tests
AgeCommit message (Collapse)Author
2017-05-10[msan] Fix getmntent{_r} for empty /etc/fstabAdhemerval Zanella
Some configuration (for instance default docker ubuntu images) uses a default empty and invalid /etc/fstab configuration file. It makes any call to getmntent return NULL and it leads to failures on Msan-aarch64{-with-call}-Test/MemorySanitizer.getmntent{_r}. This patch fixes it by creating a temporary file with some valid entries (although not valid for the system) to use along with setmntent/getmntent. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302639 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-02Revert r301904 causing tsan test failure in x86_64-linux-autoconfPierre Gousseau
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301909 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-02[asan] Add strndup/__strndup interceptors if targeting linux.Pierre Gousseau
Differential Revision: https://reviews.llvm.org/D31457 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301904 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13[msan] Fix msan_test.cc by checking bind results before assuming IPv6 supported.Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300250 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13Revert "[msan] Fix msan_test broken after r299884."Vitaly Buka
This does not fix the test, it still fails to bind. This reverts commit r300150. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300249 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13[msan] Fix msan_test broken after r299884.Vitaly Buka
Bind to ANY as some machines may have IPv6 support but without IPv6 on loopback interface. Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31998 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300150 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13[msan] Fix invalid use of vector constructor introduced by r299884.Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300149 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10[msan] Choose in runtime if IPv4 or IPv6 are supported.Vitaly Buka
Summary: This reverts commit cab5051c691ce27a7ffac41e8e76ceb222ad9549. Reviewers: eugenis Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D31894 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299884 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10[msan] Wrap sockaddr_in and socket for future IPv6 support.Vitaly Buka
Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31893 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10[msan] Reorder unittests for future parametrization.Vitaly Buka
Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31892 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299858 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-29[sanitizers] Fix get_groups interceptor in sanitizer ↵Kostya Serebryany
(https://reviews.llvm.org/D31332, patch by Martin Liška) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299036 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-03[msan] Test for _mm_getcsr and _mm_setcsr (r296848).Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@296849 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10Make cmake link flag naming consistentFrancis Ricci
Summary: The build system was inconsistent in its naming conventions for link flags. This patch changes all uses of LINKFLAGS to LINK_FLAGS, for consistency with cmake's LINK_FLAGS property. This patch should make it easier to search the source code for uses of link flags, as well as providing the benefit of improved style and consistency. Reviewers: compnerd, beanz Subscribers: kubabrecka, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D28506 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291539 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-20[msan] Disable prlimit test on glibc < 2.13.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279352 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-31__builtin_ia32_storeups is no more. Replace it with xmmintrin.h intrinsic.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271257 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09[MSan] Add a test for vararg with lots of non-vararg arguments.Marcin Koscielnicki
This is a testcase for http://llvm.org/PR27646, hitting the bug on x86_64, aarch64, mips. Differential Revision: http://reviews.llvm.org/D19944 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@268981 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29[msan] Tests for vector compare intrinsics.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267967 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-20[msan] Implement GetPageSize in the test.Evgeniy Stepanov
Instead of calling a sanitizer_common function, implement GetPageSize in the test directly. MSan runtime does not export __sanitizer::* symbols, and the current code breaks when the test and the runtime library are in the separate link units (ex. when the test is built as a shared library). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266910 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-18[msan] Don't hardcode 4kiB page size in msan_test.cc.Marcin Koscielnicki
This breaks the valloc test on PowerPC, which has 64kiB pages. Since getting page size portably is nontrivial, and there's already a function for that in __sanitizer, just use it. Unfortunately, sanitizer_common.h conflicts with the interface headers inclucded by msan_test.cc (and a few of its own macros), so we have to declare it manually. Differential Revision: http://reviews.llvm.org/D19227 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266688 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-18[MSan] [PowerPC] Add loadable library name for testing.Marcin Koscielnicki
Differential Revision: http://reviews.llvm.org/D19217 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266646 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-25[Compiler-rt][MSan]Fix shmat testcase: Pass SHMLBA-alligned address to shmatMohit K. Bhakkad
Reviewers: samsonov Subscribers: jaydeep, sagar, llvm-commits Differential Revision: http://reviews.llvm.org/D17262 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261837 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17[msan] Extend prlimit test.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261049 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17[msan] Intercept prlimit.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261048 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16[Compiler-rt][MSan][MIPS] Resolve gethostbyname_r_erange for MIPSMohit K. Bhakkad
Reviewers: eugenis, kcc, samsonov Subscribers: jaydeep, sagar, llvm-commits Differential Revision: http://reviews.llvm.org/D17135 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@260946 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12Fix MemorySanitizer.ptrtoint test on big-endian targets.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@260749 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14Fix the cross compilation of unit tests. NFC (second attempt)Sumanth Gundapaneni
With COMPILER_RT_INCLUDE_TESTS turned ON and in a cross compiling environment, the unit tests fail to link. This patch does the following changes >Rename COMPILER_RT_TEST_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS to reflect the way it's used. >Add COMPILER_RT_TEST_COMPILER_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to build/compile the unit tests >Add COMPILER_RT_UNITTEST_LINKFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to link the unit tests (if needed) Differential Revision: http://reviews.llvm.org/D16165 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13Revert r257686 "With COMPILER_RT_INCLUDE_TESTS turned ON and in a cross ↵Hans Wennborg
compiling" This broke the build. For example, from http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/1191/steps/cmake%20stage%201/logs/stdio: -- Compiler-RT supported architectures: aarch64 CMake Error at projects/compiler-rt/cmake/Modules/AddCompilerRT.cmake:170 (string): string sub-command REPLACE requires at least four arguments. Call Stack (most recent call first): projects/compiler-rt/lib/CMakeLists.txt:4 (include) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257694 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13With COMPILER_RT_INCLUDE_TESTS turned ON and in a cross compilingSumanth Gundapaneni
environment, the unit tests fail to link. This patch does the following changes >Rename COMPILER_RT_TEST_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS to reflect the way it's used. >Add COMPILER_RT_TEST_COMPILER_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to build/compile the unit tests >Add COMPILER_RT_UNITTEST_LINKFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to link the unit tests (if needed) Differential Revision:http://reviews.llvm.org/D15082 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257686 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24[compiler-rt] [msan] Couple of fixes for msan with libc++Adhemerval Zanella
This patch adds some fixes for MSAN with libc++ for aarch64: 1. Adds the libmsan_loadable name for aarch64. 2. Fixes some pthread_attr_setstacksize for aarch64, since glibc sets the mininum stack size to be higher than the x86_64 default (16KB vs 128KB). 3. Fixes a swprintf null char constant definition. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254015 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-21[msan] Build unit test shared library code with -fPIC.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@250957 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-08Fix msan tests build.Evgeniy Stepanov
CMake build rules listed -I flags for two different libc++ header locations which broke when libc++ headers started using include_next. Also change -I to -isystem to avoid compiler warning about include_next. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249759 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-26[compiler-rt] Add common interceptor for wcrtomb. Eric Fiselier
Summary: Currently there is a libc++ test failing under MSAN because wcrtomb is not intercepted. This patch adds an interceptor for it. Reviewers: samsonov, eugenis Subscribers: tberghammer, danalbert, srhines, llvm-commits Differential Revision: http://reviews.llvm.org/D12311 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@245994 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31[CMake] Don't build libc++ with MSan-with-calls instrumentation.Alexey Samsonov
Instead, refactor the build rules so that we build libc++ with MSan for each supported architecture. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@243785 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19CMake: Stop using LLVM's custom parse_arguments. NFCFilipe Cabecinhas
Summary: Use CMake's cmake_parse_arguments() instead. It's called in a slightly different way, but supports all our use cases. It's in CMake 2.8.8, which is our minimum supported version. CMake 3.0 doc (roughly the same. No direct link to 2.8.8 doc): http://www.cmake.org/cmake/help/v3.0/module/CMakeParseArguments.html?highlight=cmake_parse_arguments Since I was already changing these calls, I changed ARCH and LIB into ARCHS and LIBS to make it more clear that they're lists of arguments. Reviewers: eugenis, samsonov, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10529 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240120 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04[Sanitizer] Fix/suppress compiler warnings in unit tests.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@231293 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26[msan] Fix MsanTest to pass in track_origins=2 mode.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@230639 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18[MSan][MIPS] Fix for some failing tests on MIPS64Mohit K. Bhakkad
Enabling internal ptrace for mips, which fixes some ptrace related tests. Along with this fixing some other failures. Reviewers: Reviewers: eugenis, kcc, samsonov Subscribers: dsanders, sagar, lldb-commits Differential Revision: http://reviews.llvm.org/D7332 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229656 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-17[Msan] Fix the unit tests' PathToLoadable() to work on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7587 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229491 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16[msan] Fix UnalignedLoad/UnalignedStore tests.Evgeniy Stepanov
Add alignment attrubutes to ensure that the tests actually test unaligned access irrespective of the stack layout. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229398 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16[Msan] Improve the EXPECT_NOT_POISONED() macro to provide the original line ↵Viktor Kutuzov
number Differential Revision: http://reviews.llvm.org/D7341 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229389 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16[Msan] Make unit tests that use mempcpy() passing on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7588 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229388 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16[Msan] Disable the fgetgrent_r unit test on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7343 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229387 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16[Msan] Disable fcvt unit tests on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7340 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229386 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16[Msan] Fix the getgrnam_r unit test to pass on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7339 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229385 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16[Msan] Fix the sigaction unit test to build on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7335 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229384 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16[Msan] Fix the ether unit test to build on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7334 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229383 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04[Msan] Fix the pthread_attr_get unit test to build on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7342 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@228125 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02Fix missed #endif in rL227790.Viktor Kutuzov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@227797 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02[Msan] Disable unit tests for non-FreeBSD functions on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7252 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@227790 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30[Msan] Fix the shmctl unit tests to pass on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7253 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@227571 91177308-0d34-0410-b5e6-96231b3b80d8