Commit Graph

6736 Commits

Author SHA1 Message Date
Xinliang David Li 5f58c27d79 Fix test failure on darwin-i386
llvm-svn: 263065
2016-03-09 21:45:37 +00:00
Xinliang David Li d4312d8af0 Fix a minor bug in test
llvm-svn: 263028
2016-03-09 17:13:18 +00:00
Filipe Cabecinhas 1ecfbdefcd [test/sanitizer-common] Linux/sanitizer_set_death_callback_test.cc -> Posix/sanitizer_set_death_callback_test.cc
llvm-svn: 263018
2016-03-09 15:39:49 +00:00
Filipe Cabecinhas 42bba2eb2a [test/sanitizer-common] Move getpass.cc from Linux into Posix
llvm-svn: 263017
2016-03-09 15:39:43 +00:00
Logan Chien 5b7b9e946c Add ARM EHABI support to gcc_personality_v0.
Until now the only exception APIs supported by gcc_personality_v0
are DWARF EH and SJLJ. This adds support for ARM EHABI as well.

This is achieved by
a) changing the function signature on ARM EHABI,
b) unwinding the stack before returning _URC_CONTINUE_UNWIND.

See "Exception Handling ABI for the ARM Architecture" for details
(http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038b/IHI0038B_ehabi.pdf).

Patch by Timon Van Overveldt.

llvm-svn: 263010
2016-03-09 13:20:17 +00:00
Mohit K. Bhakkad 78e3b0e2a9 [DFSan] Fix test_inet_pton for big endian archs
Reviewers: samsonov

Subscribers: ed, jaydeep, sagar, llvm-commits

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

llvm-svn: 263001
2016-03-09 08:00:37 +00:00
Mohit K. Bhakkad 9e168987b9 [Compiler-rt][MIPS] Defining macros for MIPS archs
Reviewers: samsonov

Subscribers: filcab, jaydeep, sagar, llvm-commits

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

llvm-svn: 263000
2016-03-09 07:57:20 +00:00
Filipe Cabecinhas facd697007 [Fix r262788] Fix missed prototype with the old llvm* name.
llvm-svn: 262927
2016-03-08 14:22:13 +00:00
Filipe Cabecinhas 3e7cafe267 [sanitizer-common] Use @LINE in test.
llvm-svn: 262828
2016-03-07 13:44:20 +00:00
Filipe Cabecinhas 19aeaf76df [Fix r262785] Fix missing declaration when COMPILER_RT_BOOL_CMPXCHG was used but InstrProfilingUtil.h wasn't included.
Also fixed declaration which still had the pre-r262788 name.

llvm-svn: 262827
2016-03-07 13:42:17 +00:00
Bill Seurer 67a1830c6a [powerpc] mark setuid.c and setuid2.c as unsupported
setuid(0) hangs on powerpc64 big endian.  When this is fixed remove
the unsupported flag.

https://llvm.org/bugs/show_bug.cgi?id=25799

llvm-svn: 262814
2016-03-07 01:30:02 +00:00
Xinliang David Li 09fecac354 cleanup: remove dead preprocessing branch /nfc
llvm-svn: 262792
2016-03-06 04:56:55 +00:00
Xinliang David Li 44fd38856c [PGO] cleanup: move one support method into InstrProfilingUtil.h /NFC
llvm-svn: 262791
2016-03-06 04:52:45 +00:00
Xinliang David Li cf1a8d6912 [PGO] internal API name cleanups (for better consistency)
llvm-svn: 262788
2016-03-06 04:18:13 +00:00
Xinliang David Li cf2f829be6 Minor cleanup
move a function def to InstrProfilingUtil.c

llvm-svn: 262785
2016-03-06 00:55:20 +00:00
Vedant Kumar e55855f362 [GCDA] Unlock arc file before closing it
The GCDA writer closed the arc file before unlocking it. This causes an
EBADF while unlocking the file, and opens us up to racy behavior.

Fixes PR26847.

llvm-svn: 262779
2016-03-05 20:10:25 +00:00
Filipe Cabecinhas b08c76f5f8 [cmake] Address Samsonov's post-commit review of r262723
Reviewers: samsonov

Subscribers: llvm-commits

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

llvm-svn: 262770
2016-03-05 10:01:04 +00:00
Xinliang David Li 31f251f1f0 [PGO] Add API to check compatibility of profile data in buffer
This is needed by client which uses in-process merge API.

llvm-svn: 262736
2016-03-04 18:58:30 +00:00
Xinliang David Li 6534a8a837 Fix api visibility
llvm-svn: 262734
2016-03-04 18:33:49 +00:00
Filipe Cabecinhas 6448fe632a [ubsan/float-cast-overflow] Make the test also work with C++11 narrowing
llvm-svn: 262733
2016-03-04 18:33:44 +00:00
Filipe Cabecinhas 8144d3b091 [ubsan/cmake] Make sure we end up adding -frtti to ubsan_type_hash_itanium.cc, even if -fno-rtti is the default for the platform
llvm-svn: 262723
2016-03-04 17:02:06 +00:00
Mohit K. Bhakkad b87b2ecb4b [Compiler-rt][safestack] Enable for MIPS
Reviewers: samsonov

Subscribers: jaydeep, sagar, llvm-commits

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

llvm-svn: 262690
2016-03-04 06:15:59 +00:00
Bill Seurer 03ff36bfba [powerpc] pacify lint for java_race_pc.cc
Fix blank lines.

llvm-svn: 262689
2016-03-04 06:02:52 +00:00
Alexey Samsonov 4362a994d2 [TSan] Fix compiler warning in Go sanity test.
llvm-svn: 262680
2016-03-04 00:56:15 +00:00
Alexey Samsonov c8f2c957e0 [asan] Fix odr_c_test failure with gold linker
Summary:
Adds another global to asan's odr_c_test to help force the target global to
not lie at the start of bss with the gold linker where it is always
aligned.

Patch by Derek Bruening!

llvm-svn: 262678
2016-03-04 00:41:39 +00:00
Bill Seurer 63350ecd32 [powerpc] activate java_race_pc.cc on powerpc64le
The test case compiler-rt/test/tsan/java_race_pc.cc fails on powerpc64
big endian but not little endian.

Add missing blank line.

llvm-svn: 262675
2016-03-04 00:22:40 +00:00
Bill Seurer 7b3c72a397 [powerpc] activate java_race_pc.cc on powerpc64le
The test case compiler-rt/test/tsan/java_race_pc.cc fails on powerpc64
big endian but not little endian.

llvm-svn: 262669
2016-03-03 23:07:43 +00:00
Xinliang David Li dd12e9a8c0 [PGO] Add API for profile merge from buffer
Differential Revision: http://reviews.llvm.org/D17831

llvm-svn: 262644
2016-03-03 18:54:46 +00:00
Filipe Cabecinhas 3fb319c3cf [test/ubsan/coverage-levels] Fix file references in UBSAN_OPTIONS
llvm-svn: 262632
2016-03-03 17:37:35 +00:00
Mohit K. Bhakkad 2a4985c929 [LSan] Enable use_registers test for MIPS
Reviewers: samsonov

Subscribers: jaydeep, sagar, llvm-commits

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

llvm-svn: 262581
2016-03-03 05:05:20 +00:00
Sean Silva 6470f7615c Add some minimal portability code paths for PS4.
Summary:
Hi David, SCE folks,

What is implemented in this patch is enough for the upstream libprofile to
work for PGO with the PS4 game codebase I tested ("game7" for you SCE
folks; this is with a standalone build of compiler-rt).

The first change, which is simple, is to stub out gethostname. PS4
doesn't have a simple analog for this that doesn't bring in extra
OS libraries, so for now we do not support `%h` expansion.
This is consistent with internal B#136272.

The second change implies future work, but is a simple change at present.
PS4 does not have `getenv`, so for now we will introduce a shim.
This obviously makes it impossible for many of the tests to be run since
they require setting `LLVM_PROFILE_FILE=`.

I see two paths forward:

1. In the tests we are already wrapping execution with `%run` and so by
   setting a PS4-specific expansion for `%run` we can pass the information
   in another way We can adapt the getenv shim as appropriate.
   We will need to experiment with this internally.
   Maggie, Phillip, Filipe? Any ideas? Maybe ping me internally since we
   may need to get into some PS4 vagaries. I'm thinking a fake getenv
   library that uses some side channel for communication.

2. Another possibility which is more verbose is to use a separate clang
   invocation with `-profile-generate=<filename>` to set the filename in
   each test.
   This might require redundant clang invocations though which may be
   undesirable for upstream. David, thoughts?
   Also, this is a fairly libprofile-specific workaround, so it e.g.
   doesn't help Filipe's ASan work.
   Overall, this approach sounds like a bit of a hack to me.

Small detail:
InstrProfilingPort.h seems like the natural place for the getenv shim,
but GCDAProfiling.c needs it as well. InstrProfilingUtil.h is currently
the only header common between InstrProfilingFile.c and GCDAProfiling.c.
I can move the shim to InstrProfilingPort.h and add an include to
GCDAProfiling.c as per your preference David.

Reviewers: davidxl, MaggieYi, phillip.power, filcab

Subscribers: simon.f.whittaker, slingn, probinson, llvm-commits

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

llvm-svn: 262527
2016-03-02 22:05:46 +00:00
Xinliang David Li 783fb1f642 Fix minor bug in test
llvm-svn: 262514
2016-03-02 20:59:11 +00:00
Sagar Thakur 8f3381ed31 [TSAN] Fix test java_race_pc
Incremented the pc for each architecture in accordance with StackTrace:GetPreviousInstructionPC

Reviewers: samsonov, dvyukov
Subscribers: llvm-commits, mohit.bhakkad, jaydeep
Differential: http://reviews.llvm.org/D17802
llvm-svn: 262483
2016-03-02 13:53:22 +00:00
Renato Golin 54d6eaa363 Revert "[RT] Make tsan tests more portable"
This reverts commit r262476, as it broken the AArch64 VMA42 buildbot.

llvm-svn: 262479
2016-03-02 11:54:07 +00:00
Renato Golin ba29b5794c [RT] Make tsan tests more portable
by avoiding potential races when scanning stdout and stderr output.

Patch by Maxim Kuvyrkov.

llvm-svn: 262476
2016-03-02 11:10:02 +00:00
Filipe Cabecinhas e92ab2fbd3 [test/vptr-non-unique-typeinfo] Address Samsonov's post-commit review
Reviewers: samsonov

Subscribers: llvm-commits

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

llvm-svn: 262469
2016-03-02 08:30:40 +00:00
Dmitry Vyukov a029b79e1a tsan: describe heap/data locations in Go
llvm-svn: 262343
2016-03-01 15:38:12 +00:00
Dmitry Vyukov f5fcdd268f sanitizer_common: silence compiler warning
llvm-svn: 262342
2016-03-01 15:36:42 +00:00
Mohit K. Bhakkad 1d1493219c [Compiler-rt][MIPS] Correct Dynamic Thread Vector offset for MIPS
Reviewers: samsonov

Subscribers: dsanders, jaydeep, sagar, llvm-commits

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

llvm-svn: 262303
2016-03-01 05:56:33 +00:00
Mohit K. Bhakkad 94aa4d7e83 [Compiler-rt][MSan] fix param_tls_limit test for platforms where big arguments are sliced in smaller ones
Reviewers: eugenis

Subscribers: dsanders, jaydeep, sagar, llvm-commits

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

llvm-svn: 262302
2016-03-01 05:53:30 +00:00
Evgeniy Stepanov e5ec0623d1 [asan] Retry failed adb commands in android tests.
Add limited retries for push/pull adb commands in android tests.
May help with the adb flakiness.

llvm-svn: 262283
2016-03-01 01:16:03 +00:00
Evgeniy Stepanov aafe4b63d9 [asan] Fix new[]/delete mismatch in tests.
This code is actually never executed because all RUN lines trigger an
earlier heap-use-after-free, but there is still a compiler warning.

llvm-svn: 262276
2016-03-01 00:38:39 +00:00
Reid Kleckner 1456e2581a Avoid use of -fsanitize=vptr in MSVC env, it is not yet supported
llvm-svn: 262251
2016-02-29 20:38:35 +00:00
Maxim Ostapenko d0257b7bf1 [asan] Fix UB in test/asan/TestCases/Linux/recvfrom.cc testcase.
llvm-svn: 262210
2016-02-29 08:56:26 +00:00
Mohit K. Bhakkad 2d14d3b529 Update the link of issue
llvm-svn: 262209
2016-02-29 08:22:55 +00:00
Maxim Ostapenko 8d8f919cf5 [asan] Re-enable test/asan/TestCases/Linux/recvfrom.cc testcase.
This testcase failed on sanitizer-x86_64-linux buildbot in large parallel build due to race on
port 1234 between AddressSanitizer-i386-linux and AddressSanitizer-x86_64-linux instances of recvfrom.cc.
This patch tries to resolve the issue by relying on kernel to choose available port instead of hardcoding
its number in testcase.

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

llvm-svn: 262204
2016-02-29 07:47:35 +00:00
Xinliang David Li 80d4b898d1 Test cleanups
llvm-svn: 262162
2016-02-28 00:54:28 +00:00
Xinliang David Li adbb7b7b57 [PGO] add a test for available_externally functions
llvm-svn: 262161
2016-02-28 00:45:13 +00:00
Filipe Cabecinhas b7692bc3e9 [UBSan] Fix isDerivedFromAtOffset on iOS ARM64
Summary:
iOS on ARM64 doesn't unique RTTI.
Ref: clang's iOS64CXXABI::shouldRTTIBeUnique()

Due to this, pointer-equality will not necessarily work in this
architecture, across dylib boundaries.

dynamic_cast<>() will (as expected) still work, since Apple ships with
one prepared for this, but we can't rely on the type names being
pointer-equal.

I've limited the expensive strcmp check to the specific architecture
which needs it.

Example which triggers this bug:

lib.h:
  struct X {
    virtual ~X() {}
  };
  X *libCall();

lib.mm:
  X *libCall() {
    return new X;
  }

prog.mm:
  int main() {
    X *px = libCall();
    delete px;
  }

Expected output: Nothing
Actual output:
<unknown>: runtime error: member call on address 0x00017001ef50 which does not point to an object of type 'X'
0x00017001ef50: note: object is of type 'X'
 00 00 00 00  60 00 0f 00 01 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for ‘X’

Reviewers: kubabrecka, samsonov, eugenis, rsmith

Subscribers: aemerson, llvm-commits, rengolin

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

llvm-svn: 262147
2016-02-27 19:57:44 +00:00
Alexey Samsonov 2eff7f788a [CMake] Fix a typo in add_compiler_rt_library.
llvm-svn: 262063
2016-02-26 20:59:40 +00:00