From e243d452852870d4942a12029f4c05defefa7fad Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Mon, 7 Dec 2015 22:43:30 +0000 Subject: [PATCH] [TSan] Use llvm-objdump+FileCheck instead of standalone .sh script. llvm-svn: 254959 --- compiler-rt/test/CMakeLists.txt | 4 ++-- compiler-rt/test/tsan/Linux/check_memcpy.cc | 6 ++++- compiler-rt/test/tsan/Linux/check_memcpy.sh | 26 --------------------- 3 files changed, 7 insertions(+), 29 deletions(-) delete mode 100755 compiler-rt/test/tsan/Linux/check_memcpy.sh diff --git a/compiler-rt/test/CMakeLists.txt b/compiler-rt/test/CMakeLists.txt index 684b409bb8f7..e5c51c8cd474 100644 --- a/compiler-rt/test/CMakeLists.txt +++ b/compiler-rt/test/CMakeLists.txt @@ -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() diff --git a/compiler-rt/test/tsan/Linux/check_memcpy.cc b/compiler-rt/test/tsan/Linux/check_memcpy.cc index 86f2455fc3dc..8ad04c07cf51 100644 --- a/compiler-rt/test/tsan/Linux/check_memcpy.cc +++ b/compiler-rt/test/tsan/Linux/check_memcpy.cc @@ -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)>}} + diff --git a/compiler-rt/test/tsan/Linux/check_memcpy.sh b/compiler-rt/test/tsan/Linux/check_memcpy.sh deleted file mode 100755 index 2b5f21fa882c..000000000000 --- a/compiler-rt/test/tsan/Linux/check_memcpy.sh +++ /dev/null @@ -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