summaryrefslogtreecommitdiff
path: root/test/ubsan_minimal
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2018-01-17 12:26:04 +0000
committerKamil Rytarowski <n54@gmx.com>2018-01-17 12:26:04 +0000
commitc91431d33cee551f97693cee3f1dcb1158ea8a1b (patch)
tree0d911a470b1c4f2a43a231ae7872c0073a100771 /test/ubsan_minimal
parentff43dd5fc957bb4082338b3b1fa3f9385a9ded43 (diff)
[Sanitizers, test] Fix sanitizer tests on Solaris (PR 33274)
Summary: This patch (on top of the previous two (https://reviews.llvm.org/D40898 and https://reviews.llvm.org/D40899) complete the compiler-rt side of the the Solaris sanitizer port. It contains the following sets of changes: * For the time being, the port is for 32-bit x86 only, so reject the various tests on x86_64. * When compiling as C++, <setjmp.h> resp. <iso/setjmp_iso.h> only declares _setjmp and _longjmp inside namespace std. * MAP_FILE is a Windows feature. While e.g. Linux <sys/mman.h> provides a no-op compat define, Solaris does not. * test/asan/TestCases/Posix/coverage.cc was initially failing like this: /vol/gcc/src/llvm/llvm/local/projects/compiler-rt/lib/sanitizer_common/scripts/sancov.py: 4 files merged; 2 PCs total rm: cannot remove '/var/gcc/llvm/local/projects/compiler-rt/test/asan/I386SunOSConfig/TestCases/Posix/Output/coverage': Invalid argument Further digging revealed that the rm was trying to remove the running test's working directory which failed as observed. cd'ing out of the dir before let the test pass. * Two tests needed a declaration of alloca. I've now copied the existing code from test/asan/TestCases/alloca_constant_size.cc, but it may be more profitable and maintainable to have a common testsuite header where such code is collected. * Similarly, Solaris' printf %p format doesn't include the leading 0x. * In test/asan/TestCases/malloc-no-intercept.c, I had to undef __EXTENSIONS__ (predefined by clang for no apparent reason) to avoid conflicting declarations for memalign. * test/ubsan/TestCases/Float/cast-overflow.cpp has different platform dependent ways to define BYTE_ORDER and friends. Why not just use __BYTE_ORDER__ and friends as predefined by clang and gcc? Patch by Rainer Orth. Reviewers: kcc, alekseyshl Reviewed By: alekseyshl Subscribers: srhines, kubamracek, mgorny, krytarowski, fedor.sergeev, JDevlieghere, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40900 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@322635 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ubsan_minimal')
-rw-r--r--test/ubsan_minimal/CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ubsan_minimal/CMakeLists.txt b/test/ubsan_minimal/CMakeLists.txt
index 712654e94..5da5fcd02 100644
--- a/test/ubsan_minimal/CMakeLists.txt
+++ b/test/ubsan_minimal/CMakeLists.txt
@@ -4,6 +4,9 @@ set(UBSAN_TEST_ARCH ${UBSAN_SUPPORTED_ARCH})
if(APPLE)
darwin_filter_host_archs(UBSAN_SUPPORTED_ARCH UBSAN_TEST_ARCH)
endif()
+if(OS_NAME MATCHES "SunOS")
+ list(REMOVE_ITEM UBSAN_TEST_ARCH x86_64)
+endif()
set(UBSAN_TESTSUITES)
set(UBSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})