[llvm-commits] [compiler-rt] r171034 - in /compiler-rt/trunk/lib/tsan/lit_tests: fd_close_norace.cc fd_dup_norace.cc fd_pipe_norace.cc fd_socket_connect_norace.cc fd_socket_norace.cc fd_socketpair_norace.cc ignore_race.cc java_alloc.cc java_lock.cc java_lock_move.cc java_rwlock.cc test_output.sh

Dmitry Vyukov dvyukov at google.com
Mon Dec 24 06:02:34 PST 2012


Author: dvyukov
Date: Mon Dec 24 08:02:34 2012
New Revision: 171034

URL: http://llvm.org/viewvc/llvm-project?rev=171034&view=rev
Log:
tsan: work around FileCheck feature that it does not accept empty input

Modified:
    compiler-rt/trunk/lib/tsan/lit_tests/fd_close_norace.cc
    compiler-rt/trunk/lib/tsan/lit_tests/fd_dup_norace.cc
    compiler-rt/trunk/lib/tsan/lit_tests/fd_pipe_norace.cc
    compiler-rt/trunk/lib/tsan/lit_tests/fd_socket_connect_norace.cc
    compiler-rt/trunk/lib/tsan/lit_tests/fd_socket_norace.cc
    compiler-rt/trunk/lib/tsan/lit_tests/fd_socketpair_norace.cc
    compiler-rt/trunk/lib/tsan/lit_tests/ignore_race.cc
    compiler-rt/trunk/lib/tsan/lit_tests/java_alloc.cc
    compiler-rt/trunk/lib/tsan/lit_tests/java_lock.cc
    compiler-rt/trunk/lib/tsan/lit_tests/java_lock_move.cc
    compiler-rt/trunk/lib/tsan/lit_tests/java_rwlock.cc
    compiler-rt/trunk/lib/tsan/lit_tests/test_output.sh

Modified: compiler-rt/trunk/lib/tsan/lit_tests/fd_close_norace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/fd_close_norace.cc?rev=171034&r1=171033&r2=171034&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/fd_close_norace.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/fd_close_norace.cc Mon Dec 24 08:02:34 2012
@@ -25,6 +25,7 @@
   pthread_create(&t[1], NULL, Thread2, NULL);
   pthread_join(t[0], NULL);
   pthread_join(t[1], NULL);
+  printf("OK\n");
 }
 
 // CHECK-NOT: WARNING: ThreadSanitizer: data race

Modified: compiler-rt/trunk/lib/tsan/lit_tests/fd_dup_norace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/fd_dup_norace.cc?rev=171034&r1=171033&r2=171034&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/fd_dup_norace.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/fd_dup_norace.cc Mon Dec 24 08:02:34 2012
@@ -28,6 +28,7 @@
   pthread_create(&t[1], NULL, Thread2, NULL);
   pthread_join(t[0], NULL);
   pthread_join(t[1], NULL);
+  printf("OK\n");
 }
 
 // CHECK-NOT: WARNING: ThreadSanitizer: data race

Modified: compiler-rt/trunk/lib/tsan/lit_tests/fd_pipe_norace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/fd_pipe_norace.cc?rev=171034&r1=171033&r2=171034&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/fd_pipe_norace.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/fd_pipe_norace.cc Mon Dec 24 08:02:34 2012
@@ -27,6 +27,7 @@
   pthread_create(&t[1], NULL, Thread2, NULL);
   pthread_join(t[0], NULL);
   pthread_join(t[1], NULL);
+  printf("OK\n");
 }
 
 // CHECK-NOT: WARNING: ThreadSanitizer: data race

Modified: compiler-rt/trunk/lib/tsan/lit_tests/fd_socket_connect_norace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/fd_socket_connect_norace.cc?rev=171034&r1=171033&r2=171034&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/fd_socket_connect_norace.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/fd_socket_connect_norace.cc Mon Dec 24 08:02:34 2012
@@ -38,6 +38,7 @@
   pthread_join(t, 0);
   close(c);
   close(s);
+  printf("OK\n");
 }
 
 // CHECK-NOT: WARNING: ThreadSanitizer: data race

Modified: compiler-rt/trunk/lib/tsan/lit_tests/fd_socket_norace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/fd_socket_norace.cc?rev=171034&r1=171033&r2=171034&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/fd_socket_norace.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/fd_socket_norace.cc Mon Dec 24 08:02:34 2012
@@ -45,6 +45,7 @@
   close(c);
   close(s);
   pthread_join(t, 0);
+  printf("OK\n");
 }
 
 // CHECK-NOT: WARNING: ThreadSanitizer: data race

Modified: compiler-rt/trunk/lib/tsan/lit_tests/fd_socketpair_norace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/fd_socketpair_norace.cc?rev=171034&r1=171033&r2=171034&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/fd_socketpair_norace.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/fd_socketpair_norace.cc Mon Dec 24 08:02:34 2012
@@ -31,6 +31,7 @@
   pthread_create(&t[1], NULL, Thread2, NULL);
   pthread_join(t[0], NULL);
   pthread_join(t[1], NULL);
+  printf("OK\n");
 }
 
 // CHECK-NOT: WARNING: ThreadSanitizer: data race

Modified: compiler-rt/trunk/lib/tsan/lit_tests/ignore_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/ignore_race.cc?rev=171034&r1=171033&r2=171034&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/ignore_race.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/ignore_race.cc Mon Dec 24 08:02:34 2012
@@ -25,7 +25,7 @@
   sleep(1);
   Global = 43;
   pthread_join(t, 0);
-  return 0;
+  printf("OK\n");
 }
 
 // CHECK-NOT: WARNING: ThreadSanitizer: data race

Modified: compiler-rt/trunk/lib/tsan/lit_tests/java_alloc.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/java_alloc.cc?rev=171034&r1=171033&r2=171034&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/java_alloc.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/java_alloc.cc Mon Dec 24 08:02:34 2012
@@ -25,6 +25,7 @@
   pthread_create(&th, 0, Thread, (void*)(jheap + kHeapSize / 4));
   stress(jheap);
   pthread_join(th, 0);
+  printf("OK\n");
   return __tsan_java_fini();
 }
 

Modified: compiler-rt/trunk/lib/tsan/lit_tests/java_lock.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/java_lock.cc?rev=171034&r1=171033&r2=171034&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/java_lock.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/java_lock.cc Mon Dec 24 08:02:34 2012
@@ -26,6 +26,7 @@
   __tsan_java_mutex_unlock(lockaddr);
   pthread_join(th, 0);
   __tsan_java_free((jptr)jheap, kBlockSize);
+  printf("OK\n");
   return __tsan_java_fini();
 }
 

Modified: compiler-rt/trunk/lib/tsan/lit_tests/java_lock_move.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/java_lock_move.cc?rev=171034&r1=171033&r2=171034&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/java_lock_move.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/java_lock_move.cc Mon Dec 24 08:02:34 2012
@@ -33,6 +33,7 @@
   __tsan_java_move(varaddr, varaddr2, kBlockSize);
   pthread_join(th, 0);
   __tsan_java_free(varaddr2, kBlockSize);
+  printf("OK\n");
   return __tsan_java_fini();
 }
 

Modified: compiler-rt/trunk/lib/tsan/lit_tests/java_rwlock.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/java_rwlock.cc?rev=171034&r1=171033&r2=171034&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/java_rwlock.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/java_rwlock.cc Mon Dec 24 08:02:34 2012
@@ -26,6 +26,7 @@
   __tsan_java_mutex_unlock(lockaddr);
   pthread_join(th, 0);
   __tsan_java_free((jptr)jheap, kBlockSize);
+  printf("OK\n");
   return __tsan_java_fini();
 }
 

Modified: compiler-rt/trunk/lib/tsan/lit_tests/test_output.sh
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/test_output.sh?rev=171034&r1=171033&r2=171034&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/test_output.sh (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/test_output.sh Mon Dec 24 08:02:34 2012
@@ -22,9 +22,6 @@
   $COMPILER $SRC $CFLAGS -c -o $OBJ
   $COMPILER $OBJ $LDFLAGS -o $EXE
   RES=$($EXE 2>&1 || true)
-  if [ "$3" != "" ]; then
-    printf "%s\n" "$RES"
-  fi
   printf "%s\n" "$RES" | FileCheck $SRC
   if [ "$3" == "" ]; then
     rm -f $EXE $OBJ





More information about the llvm-commits mailing list