mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-31 06:04:58 +00:00
[TSan] Use llvm-objdump+FileCheck instead of standalone .sh script.
llvm-svn: 254959
This commit is contained in:
parent
efef8ef8f3
commit
e243d45285
@ -19,8 +19,8 @@ if(NOT ANDROID)
|
||||
if(NOT COMPILER_RT_STANDALONE_BUILD)
|
||||
# Use LLVM utils and Clang from the same build tree.
|
||||
list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS
|
||||
clang clang-headers FileCheck count not llvm-config llvm-nm llvm-symbolizer
|
||||
compiler-rt-headers)
|
||||
clang clang-headers FileCheck count not llvm-config llvm-nm llvm-objdump
|
||||
llvm-symbolizer compiler-rt-headers)
|
||||
if (COMPILER_RT_HAS_PROFILE)
|
||||
list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS profile)
|
||||
endif()
|
||||
|
@ -3,9 +3,13 @@
|
||||
// check_memcpy.sh script.
|
||||
|
||||
// RUN: %clangxx_tsan -O1 %s -o %t
|
||||
// RUN: %S/check_memcpy.sh %t
|
||||
// RUN: llvm-objdump -d %t | FileCheck %s
|
||||
|
||||
int main() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// CHECK-NOT: callq {{.*<(__interceptor_)?mem(cpy|set)>}}
|
||||
// tail calls:
|
||||
// CHECK-NOT: jmpq {{.*<(__interceptor_)?mem(cpy|set)>}}
|
||||
|
||||
|
@ -1,26 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script that ensures that TSan runtime does not contain compiler-emitted
|
||||
# memcpy and memset calls.
|
||||
|
||||
set -eu
|
||||
|
||||
if [[ "$#" != 1 ]]; then
|
||||
echo "Usage: $0 /path/to/binary/built/with/tsan"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
EXE=$1
|
||||
|
||||
NCALL=$(objdump -d $EXE | egrep "callq .*<__interceptor_mem(cpy|set)>" | wc -l)
|
||||
if [ "$NCALL" != "0" ]; then
|
||||
echo FAIL: found $NCALL memcpy/memset calls
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# tail calls
|
||||
NCALL=$(objdump -d $EXE | egrep "jmpq .*<__interceptor_mem(cpy|set)>" | wc -l)
|
||||
if [ "$NCALL" != "0" ]; then
|
||||
echo FAIL: found $NCALL memcpy/memset calls
|
||||
exit 1
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user