Add a missing parenthesis mistakenly dropped in r221621.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221656 91177308-0d34-0410-b5e6-96231b3b80d8
[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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221687 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] fix coverage tests to use the new flag syntax (-fsanitize-coverage=N)

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221720 91177308-0d34-0410-b5e6-96231b3b80d8
delete => delete[] for arrays.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221769 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Skip ptrace test on non-x86 targets

Summary:
Address sanitization of ptrace(2) is only implemented for x86, so skip
the test on other targets.

Reviewers: kcc, eugenis, earthdok, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6215

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221777 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Skip dump_instruction_bytes test on non-x86 targets

Summary: This test case is blatantly x86-specific, so skip it on other targets.

Reviewers: kcc, eugenis, earthdok, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6216

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221778 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] [mips] added support of asan for mips64/mips64el, patch by Kumar Sukhani

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221800 91177308-0d34-0410-b5e6-96231b3b80d8
Add a test for PR21528 to make sure ASan C++ symbolization doesn't regress

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221814 91177308-0d34-0410-b5e6-96231b3b80d8
PR21518: Use unsigned arithmetic for trapping add/sub functions.

The code in {add,sub}v.i3 routines does not trap when it should, because
it performs the actual add/subtract operation in signed arithmetic,
rather than unsigned.

Patch by Francois-Xavie Coudert!

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221826 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Fix large allocator test case to cope with 64k pages

Summary: My PowerPC64 Linux box has 64k pages. The test assumes 4k pages. Fix it.

Reviewers: glider, eugenis, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6228

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221875 91177308-0d34-0410-b5e6-96231b3b80d8
InstrProf: support PowerPC64

Summary:
I don't know anything about profiling but it seems to work out of the
box on PowerPC64. At least "make check-profile" works.

A few tests needed tweaking because PowerPC64 IR declares main with
"define signext i32 @main" instead of just "define i32 @main".

This also fixes the asan asan_and_llvm_coverage_test test, which
compiles with -coverage so requires that a profiling version of
libclang_rt has been built.

Reviewers: dexonsmith, kcc, samsonov

Reviewed By: samsonov

Subscribers: samsonov, llvm-commits

Differential Revision: http://reviews.llvm.org/D6233

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221877 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Switch to AsanInitFromRtl in .preinit_array.

There is no functionality change due to a check in AsanActivate.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221882 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Add process basename to log name and error message to simplify analysis of sanitized systems logs.

Reviewed at http://reviews.llvm.org/D5724


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221896 91177308-0d34-0410-b5e6-96231b3b80d8
Removed r221896, it seems to break build in various ways.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221912 91177308-0d34-0410-b5e6-96231b3b80d8
[CMake] Detect if -Wfoo is supported instead of -Wno-foo, as GCC occasionally silently discards unknown -Wno-foo flags.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221925 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Really fix zero_page_pc test for PowerPC

Summary:
As a follow-up to D6167, this patch fixes the test to account for
another difference between PowerPC and x86 systems.

On x86 if you branch to an invalid address, you get a SIGSEGV with PC
set to the invalid address (and si_addr in the siginfo struct also set
to the same address).

On PowerPC, you get a SIGSEGV with PC pointing at the branch
instruction, but si_addr set to the invalid address.

You can see this difference if you run the test case under gdb.

Reviewers: kcc, glider, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6226

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221929 91177308-0d34-0410-b5e6-96231b3b80d8
Fix -Wcast-qual warnings in sanitizers

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221936 91177308-0d34-0410-b5e6-96231b3b80d8
[Profile] Always build profile runtime library with -fPIC.

This change removes libclang_rt.profile-pic-<arch>.a version of
profile runtime. Instead, it's sufficient to always build
libclang_rt.profile-<arch>.a with -fPIC, as it can be linked into
both executables and shared objects.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221952 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Revert r221882.

This code is not part of ASan runtime (as it may be linked into a different
DSO), and thus can not call non-exported functions.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221986 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] Extend a comment in SlowUnwind.

This better explains a change in r221520.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222000 91177308-0d34-0410-b5e6-96231b3b80d8