Alexey Samsonov
829da45631
[CMake] Detect if -Wfoo is supported instead of -Wno-foo, as GCC occasionally silently discards unknown -Wno-foo flags.
...
llvm-svn: 221925
2014-11-13 21:19:53 +00:00
Jay Foad
cf2d4b8ea4
[ASan] Fix use of -asan-instrument-assembly in tests
...
Summary:
The option -asan-instrument-assembly is declared in the X86 backend.
If I test on PowerPC configured with LLVM_TARGETS_TO_BUILD=All then the
option is tolerated but ignored.
If I test on PowerPC configured with LLVM_TARGETS_TO_BUILD=PowerPC then
the testsuite fails with:
[ 93%] Generating ASAN_INST_TEST_OBJECTS.gtest-all.cc.powerpc64-inline.o
clang (LLVM option parsing): Unknown command line argument '-asan-instrument-assembly'. Try: 'clang (LLVM option parsing) -help'
Fix this inconsistency by only adding the option if that toolchain was
built with the X86 backend included.
Reviewers: kcc, samsonov, eugenis
Reviewed By: eugenis
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6190
llvm-svn: 221687
2014-11-11 13:44:08 +00:00
Kuba Brecka
14c0c5901d
[compiler-rt] compiler-rt's CMake append_if function clashes with LLVM's, let's rename it to append_list_if
...
Doing s/append_if/append_list_if/, no functional change.
http://reviews.llvm.org/D5739
llvm-svn: 219860
2014-10-15 22:47:54 +00:00
Evgeniy Stepanov
9e922e7d24
[sanitizer] Android build cleanup.
...
* Detect Android toolchain target arch and set correct runtime library name.
* Merged a lot of Android and non-Android code paths.
* Android is only supported in standalone build of compiler-rt now.
* Linking lsan-common in ASan-Android (makes lsan annotations work).
* Relying on -fsanitize=address linker flag when building tests (again,
unification with non-Android path).
* Runtime library moved from lib/asan to lib/linux.
llvm-svn: 218605
2014-09-29 13:18:55 +00:00
Alexey Samsonov
408d2152c4
Fixup Android tests build rules
...
llvm-svn: 215264
2014-08-09 00:23:11 +00:00
Evgeniy Stepanov
3641cd43b2
[asan] Use -pthread instead of -lpthread in tests.
...
llvm-svn: 210255
2014-06-05 12:22:37 +00:00
Timur Iskhodzhanov
1b42b81549
[Sanitizers Win] Move duplicate Windows-specific compiler flags to a common CMake variable
...
Reviewed at http://reviews.llvm.org/D3952
llvm-svn: 209889
2014-05-30 12:42:57 +00:00
Timur Iskhodzhanov
82ee0433da
[ASan/Win] Use clang rather than clang-cl by default for lit tests. Make Windows-only tests explicitly use clang-cl.
...
Reviewed at http://reviews.llvm.org/D3893
llvm-svn: 209719
2014-05-28 08:38:13 +00:00
Evgeniy Stepanov
687933f55d
[asan] Fix x86 asm instrumentation to preserve flags.
...
This change also enables asm instrumentation in asan tests that was
accidentally disabled yearlier, and adds a sanity test for that.
Patch by Yuri Gorshenin.
llvm-svn: 209282
2014-05-21 08:21:14 +00:00
Timur Iskhodzhanov
930ffe94aa
[Sanitizer tests] Don't need to use -lstdc++ thanks to --driver-mode=g++
...
Reviewed at http://reviews.llvm.org/D3796
llvm-svn: 209115
2014-05-19 08:19:38 +00:00
Timur Iskhodzhanov
2e9136c2da
[Sanitizer/ASan tests] Automatically detect the presence of libstdc++
...
llvm-svn: 208695
2014-05-13 12:57:50 +00:00
Timur Iskhodzhanov
7d07fe20a0
[ASan tests] Add Windows-specific flags to lib/asan/tests/CMakeLists.txt
...
Reviewed at http://reviews.llvm.org/D3720
llvm-svn: 208682
2014-05-13 10:33:42 +00:00
Alexey Samsonov
1866b58885
[ASan] Split static ASan runtime in two parts: asan and asan_cxx.
...
asan_cxx containts replacements for new/delete operators, and should
only be linked in C++ mode. We plan to start building this part
with exception support to make new more standard-compliant.
See https://code.google.com/p/address-sanitizer/issues/detail?id=295
for more details.
llvm-svn: 208609
2014-05-12 18:39:22 +00:00
Timur Iskhodzhanov
fddadefc33
[ASan tests] Auto-define ASAN_NEEDS_SEGV rather than hardcode it in cmake
...
llvm-svn: 208322
2014-05-08 14:53:59 +00:00
Viktor Kutuzov
f9eba2f51d
Fix building Asan and common sanitizers tests on FreeBSD 9.2
...
llvm-svn: 207408
2014-04-28 10:33:01 +00:00
Kostya Serebryany
74f8d65ae4
[asan] add one more mode to run asan tests with '-with-calls', i.e. using -mllvm -asan-instrumentation-with-call-threshold=0. This is very unfortunate since it effectively doubles the number of gunit asan tests that need to be built and run, but as long as we need out-lined calls (PR17409) I see no other way to test this workaround
...
llvm-svn: 206742
2014-04-21 10:31:35 +00:00
Alexey Samsonov
56b6ee9833
[ASan] Optional support for dynamic ASan runtime on Linux.
...
Based on http://llvm-reviews.chandlerc.com/D3042 by Yuri Gribov!
llvm-svn: 205308
2014-04-01 13:16:30 +00:00
Alexey Samsonov
c41ca6d31a
[CMake] Rename the variable
...
llvm-svn: 204602
2014-03-24 13:29:20 +00:00
Alexey Samsonov
1847401332
[CMake] Respect CMAKE_CXX_FLAGS in custom clang_compile commands
...
llvm-svn: 204593
2014-03-24 09:42:12 +00:00
Alexey Samsonov
a2fdd8e253
[CMake] Fix build of ASan tests on Mac
...
llvm-svn: 204238
2014-03-19 14:45:40 +00:00
Alexey Samsonov
17703c1092
[CMake] Build sanitizer unit tests with -std=c++11
...
llvm-svn: 204234
2014-03-19 13:57:33 +00:00
Alexey Samsonov
32956d651a
[CMake] Make append_if semantics similar to those used in LLVM
...
llvm-svn: 203773
2014-03-13 09:31:36 +00:00
Alexey Samsonov
d964e7cd81
[CMake] Test for libdl and libpthread presence
...
llvm-svn: 202847
2014-03-04 13:28:21 +00:00
Kostya Serebryany
cc92c79531
[asan] simplify the code that compute the shadow offset; get rid of two internal flags that allowed to override it. The tests pass, but still this change might break asan on some platform not covered by tests. If you see this, please submit a fix with a test.
...
llvm-svn: 202033
2014-02-24 13:40:24 +00:00
Alexey Samsonov
11705b2f10
[CMake] break dependency between unit tests and runtimes in standalone build
...
llvm-svn: 201778
2014-02-20 12:03:56 +00:00
Evgeniy Stepanov
caaaac8c30
[asan] Disable asm instrumentation and tests on Mac.
...
Move asm tests to their own file.
llvm-svn: 201653
2014-02-19 09:14:39 +00:00
Alexey Samsonov
9a1ffce25a
[CMake] Simplify code for detecting/setting compiler flags
...
llvm-svn: 201543
2014-02-18 07:26:58 +00:00
Alexey Samsonov
9a70077b47
[ASan] Rename asan_runtime_libraries to asan. Re-enable tests on Android.
...
llvm-svn: 201417
2014-02-14 14:45:13 +00:00
Evgeniy Stepanov
8978389a32
[asan] Enable SEGV handler on Android by default.
...
Seems stable enough.
Fixes null_deref.cc test.
llvm-svn: 201326
2014-02-13 13:43:47 +00:00
Evgeniy Stepanov
350fe4b1af
[asan] Android logging.
...
This change duplicates all ASan output to system log on Android.
llvm-svn: 199887
2014-01-23 11:34:41 +00:00
Evgeniy Stepanov
fe906a1df6
[asan] Restore lost -pie in Android tests.
...
llvm-svn: 199379
2014-01-16 13:11:37 +00:00
Evgeniy Stepanov
780d85a8ef
[asan] Remove leftover use of -fsanitize-address-zero-base-shadow.
...
llvm-svn: 199373
2014-01-16 11:42:40 +00:00
Evgeniy Stepanov
e259b658e4
[asan] Nuke ASAN_FLEXIBLE_MAPPING_AND_OFFSET.
...
llvm-svn: 199370
2014-01-16 10:16:19 +00:00
Alexey Samsonov
003c4bfc42
[ASan] Introduce a top-level target to collect all ASan runtimes and deps
...
llvm-svn: 194696
2013-11-14 12:24:12 +00:00
Evgeniy Stepanov
e8cd2fad0e
[asan] Maybe fix test failures on lld bots.
...
llvm-svn: 193647
2013-10-29 20:06:12 +00:00
Kostya Serebryany
01ff028814
[asan] remove -fsanitize=use-after-return from the tests (this flag now comes with asan by default)
...
llvm-svn: 191204
2013-09-23 14:34:06 +00:00
Alexey Samsonov
a7f35c06dc
[ASan] Enable fake stack test on Mac and Android, as no-instrumentation tests are now fixed
...
llvm-svn: 190856
2013-09-17 08:40:32 +00:00
Alexey Samsonov
676c109c24
[ASan] Link tests with -pie if ASan runtime uses zero-base shadow
...
llvm-svn: 190853
2013-09-17 07:50:12 +00:00
Alexey Samsonov
f71c88910c
[ASan] Don't link with pthread on Android
...
llvm-svn: 190794
2013-09-16 16:51:49 +00:00
Alexey Samsonov
036a5bef2d
[ASan] Split ASan unit tests into two different binaries:
...
(1) instrumented, i.e. compiled and linked with -fsanitize=address
(2) not instrumented, compiled w/o -fsanitize=address and linked with ASan runtime statically.
llvm-svn: 190788
2013-09-16 15:50:53 +00:00
Alexey Samsonov
70c93d3b1c
[ASan] Temporary disable UAR unit test on Android due to https://code.google.com/p/address-sanitizer/issues/detail?id=222
...
llvm-svn: 190667
2013-09-13 08:07:21 +00:00
Alexander Potapenko
9caa10d0c7
[ASan] Do not build asan_fake_stack_test.cc on OSX until https://code.google.com/p/address-sanitizer/issues/detail?id=222 is fixed.
...
llvm-svn: 190597
2013-09-12 09:46:56 +00:00
Kostya Serebryany
729c8dc65b
[asan] fully re-implement the FakeStack (use-after-return) to make it faster and async-signal-safe. The implementation is not yet complete (see FIXMEs) but the existing tests pass.
...
llvm-svn: 190588
2013-09-12 07:11:58 +00:00
Kostya Serebryany
d332d42372
[asan] remove one redundant malloc stress test, unify the usage of ASAN_LOW_MEMORY macro in tests, slightly reduce test memory usage (all to make 32-bit runs consume less RAM)
...
llvm-svn: 177069
2013-03-14 13:16:09 +00:00
Kostya Serebryany
dd0ab08b6e
[asan] use short path for sanitizer_common/tests/sanitizer_test_utils.h, add -I sanitizer_common/tests to asan/tests/CMakeLists.txt
...
llvm-svn: 175142
2013-02-14 08:12:26 +00:00
Alexey Samsonov
5311754b62
[CMake] Fix compiler-rt tests after r173617
...
llvm-svn: 173668
2013-01-28 07:16:22 +00:00
Alexey Samsonov
d7b901d581
ASan: use Clang -fsanitize-blacklist flag in unit tests (instead of -mllvm)
...
llvm-svn: 173142
2013-01-22 10:30:17 +00:00
Alexey Samsonov
a168f30073
ASan: simplify build rules for unit tests
...
llvm-svn: 173133
2013-01-22 07:31:28 +00:00
Alexey Samsonov
2f20275730
ASan: disable flexible mapping and offset on Android. It doesn't work for dynamic ASan runtime there
...
llvm-svn: 173132
2013-01-22 07:21:24 +00:00
Kostya Serebryany
56fc958506
[asan] split asan_test.cc even more
...
llvm-svn: 173131
2013-01-22 07:01:47 +00:00