[compiler-rt] r202145 - Update sanitizers' bash scripts.

Alexey Samsonov samsonov at google.com
Tue Feb 25 04:09:26 PST 2014


Author: samsonov
Date: Tue Feb 25 06:09:25 2014
New Revision: 202145

URL: http://llvm.org/viewvc/llvm-project?rev=202145&view=rev
Log:
Update sanitizers' bash scripts.

* Fix bash scripts to work on FreeBSD (patch by Viktor Kutuzov)
* Update locations of lit tests in check_lint script.

Modified:
    compiler-rt/trunk/lib/dfsan/scripts/check_custom_wrappers.sh
    compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh
    compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc

Modified: compiler-rt/trunk/lib/dfsan/scripts/check_custom_wrappers.sh
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/dfsan/scripts/check_custom_wrappers.sh?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- compiler-rt/trunk/lib/dfsan/scripts/check_custom_wrappers.sh (original)
+++ compiler-rt/trunk/lib/dfsan/scripts/check_custom_wrappers.sh Tue Feb 25 06:09:25 2014
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 DFSAN_DIR=$(dirname "$0")/../
 DFSAN_CUSTOM_TESTS=${DFSAN_DIR}/../../test/dfsan/custom.c

Modified: compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh (original)
+++ compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh Tue Feb 25 06:09:25 2014
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
 
@@ -19,7 +19,7 @@ LLVM_LINT_FILTER=-,+whitespace
 COMMON_LINT_FILTER=-build/include,-build/header_guard,-legal/copyright,-whitespace/comments,-readability/casting,\
 -build/namespaces
 ASAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/int
-ASAN_TEST_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/sizeof,-runtime/int,-runtime/printf
+ASAN_TEST_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/sizeof,-runtime/int,-runtime/printf,-runtime/threadsafe_fn
 ASAN_LIT_TEST_LINT_FILTER=${ASAN_TEST_LINT_FILTER},-whitespace/line_length
 TSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER}
 TSAN_TEST_LINT_FILTER=${TSAN_RTL_LINT_FILTER},-runtime/threadsafe_fn,-runtime/int
@@ -55,6 +55,7 @@ run_lint ${LLVM_LINT_FILTER} --filter=${
   lib/Transforms/Utils/SpecialCaseList.cpp &
 
 COMPILER_RT=projects/compiler-rt
+LIT_TESTS=${COMPILER_RT}/test
 # Headers
 SANITIZER_INCLUDES=${COMPILER_RT}/include/sanitizer
 run_lint ${SANITIZER_INCLUDES_LINT_FILTER} ${SANITIZER_INCLUDES}/*.h &
@@ -72,14 +73,14 @@ run_lint ${ASAN_RTL_LINT_FILTER} ${INTER
 ASAN_RTL=${COMPILER_RT}/lib/asan
 run_lint ${ASAN_RTL_LINT_FILTER} ${ASAN_RTL}/*.{cc,h} &
 run_lint ${ASAN_TEST_LINT_FILTER} ${ASAN_RTL}/tests/*.{cc,h} &
-run_lint ${ASAN_LIT_TEST_LINT_FILTER} ${ASAN_RTL}/lit_tests/*/*.cc &
+run_lint ${ASAN_LIT_TEST_LINT_FILTER} ${LIT_TESTS}/asan/*/*.cc &
 
 # TSan
 TSAN_RTL=${COMPILER_RT}/lib/tsan
 run_lint ${TSAN_RTL_LINT_FILTER} ${TSAN_RTL}/rtl/*.{cc,h} &
 run_lint ${TSAN_TEST_LINT_FILTER} ${TSAN_RTL}/tests/rtl/*.{cc,h} \
                                   ${TSAN_RTL}/tests/unit/*.cc &
-run_lint ${TSAN_LIT_TEST_LINT_FILTER} ${TSAN_RTL}/lit_tests/*.cc &
+run_lint ${TSAN_LIT_TEST_LINT_FILTER} ${LIT_TESTS}/tsan/*.cc &
 
 # MSan
 MSAN_RTL=${COMPILER_RT}/lib/msan
@@ -87,9 +88,8 @@ run_lint ${MSAN_RTL_LINT_FILTER} ${MSAN_
 
 # LSan
 LSAN_RTL=${COMPILER_RT}/lib/lsan
-run_lint ${LSAN_RTL_LINT_FILTER} ${LSAN_RTL}/*.{cc,h} \
-                                 ${LSAN_RTL}/tests/*.{cc,h} &
-run_lint ${LSAN_LIT_TEST_LINT_FILTER} ${LSAN_RTL}/lit_tests/*/*.cc &
+run_lint ${LSAN_RTL_LINT_FILTER} ${LSAN_RTL}/*.{cc,h}
+run_lint ${LSAN_LIT_TEST_LINT_FILTER} ${LIT_TESTS}/lsan/*/*.cc &
 
 # DFSan
 DFSAN_RTL=${COMPILER_RT}/lib/dfsan

Modified: compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc (original)
+++ compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc Tue Feb 25 06:09:25 2014
@@ -71,7 +71,7 @@ class PthreadRWLock {
 
 class LockTest {
  public:
-  LockTest(size_t n) : n_(n), locks_(new LockType[n]) { }
+  explicit LockTest(size_t n) : n_(n), locks_(new LockType[n]) { }
   ~LockTest() { delete [] locks_; }
   void L(size_t i) {
     assert(i < n_);
@@ -282,7 +282,7 @@ class LockTest {
   LockType *locks_;
 };
 
-int main () {
+int main() {
   { LockTest t(5); t.Test1(); }
   { LockTest t(5); t.Test2(); }
   { LockTest t(5); t.Test3(); }





More information about the llvm-commits mailing list