[compiler-rt] r262476 - [RT] Make tsan tests more portable
Renato Golin via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 2 03:10:03 PST 2016
Author: rengolin
Date: Wed Mar 2 05:10:02 2016
New Revision: 262476
URL: http://llvm.org/viewvc/llvm-project?rev=262476&view=rev
Log:
[RT] Make tsan tests more portable
by avoiding potential races when scanning stdout and stderr output.
Patch by Maxim Kuvyrkov.
Modified:
compiler-rt/trunk/test/tsan/Linux/user_malloc.cc
compiler-rt/trunk/test/tsan/aligned_vs_unaligned_race.cc
compiler-rt/trunk/test/tsan/benign_race.cc
compiler-rt/trunk/test/tsan/blacklist.cc
compiler-rt/trunk/test/tsan/blacklist2.cc
compiler-rt/trunk/test/tsan/dl_iterate_phdr.cc
compiler-rt/trunk/test/tsan/fd_close_norace.cc
compiler-rt/trunk/test/tsan/fd_close_norace2.cc
compiler-rt/trunk/test/tsan/fd_dup_norace.cc
compiler-rt/trunk/test/tsan/fd_dup_norace2.cc
compiler-rt/trunk/test/tsan/fd_dup_race.cc
compiler-rt/trunk/test/tsan/fd_pipe_norace.cc
compiler-rt/trunk/test/tsan/fd_socket_connect_norace.cc
compiler-rt/trunk/test/tsan/fd_socket_norace.cc
compiler-rt/trunk/test/tsan/fd_socketpair_norace.cc
compiler-rt/trunk/test/tsan/ignore_race.cc
compiler-rt/trunk/test/tsan/inlined_memcpy_race.cc
compiler-rt/trunk/test/tsan/inlined_memcpy_race2.cc
compiler-rt/trunk/test/tsan/interface_atomic_test.c
compiler-rt/trunk/test/tsan/java_alloc.cc
compiler-rt/trunk/test/tsan/java_heap_init.cc
compiler-rt/trunk/test/tsan/java_lock_move.cc
compiler-rt/trunk/test/tsan/java_lock_rec.cc
compiler-rt/trunk/test/tsan/java_lock_rec_race.cc
compiler-rt/trunk/test/tsan/java_move_overlap.cc
compiler-rt/trunk/test/tsan/java_move_overlap_race.cc
compiler-rt/trunk/test/tsan/java_rwlock.cc
compiler-rt/trunk/test/tsan/longjmp.cc
compiler-rt/trunk/test/tsan/longjmp2.cc
compiler-rt/trunk/test/tsan/longjmp3.cc
compiler-rt/trunk/test/tsan/longjmp4.cc
compiler-rt/trunk/test/tsan/malloc_overflow.cc
compiler-rt/trunk/test/tsan/race_on_speculative_load.cc
compiler-rt/trunk/test/tsan/static_init1.cc
compiler-rt/trunk/test/tsan/static_init2.cc
compiler-rt/trunk/test/tsan/static_init4.cc
compiler-rt/trunk/test/tsan/static_init5.cc
compiler-rt/trunk/test/tsan/static_init6.cc
compiler-rt/trunk/test/tsan/sunrpc.cc
compiler-rt/trunk/test/tsan/suppressions_global.cc
compiler-rt/trunk/test/tsan/suppressions_race.cc
compiler-rt/trunk/test/tsan/suppressions_race2.cc
compiler-rt/trunk/test/tsan/thread_detach.c
compiler-rt/trunk/test/tsan/thread_detach2.c
compiler-rt/trunk/test/tsan/thread_leak.c
compiler-rt/trunk/test/tsan/thread_leak2.c
compiler-rt/trunk/test/tsan/thread_leak4.c
compiler-rt/trunk/test/tsan/tsan-vs-gvn.cc
compiler-rt/trunk/test/tsan/unaligned_norace.cc
compiler-rt/trunk/test/tsan/vfork.cc
compiler-rt/trunk/test/tsan/virtual_inheritance_compile_bug.cc
Modified: compiler-rt/trunk/test/tsan/Linux/user_malloc.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Linux/user_malloc.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/Linux/user_malloc.cc (original)
+++ compiler-rt/trunk/test/tsan/Linux/user_malloc.cc Wed Mar 2 05:10:02 2016
@@ -8,7 +8,7 @@ extern "C" void __interceptor_free(void
extern "C" void *malloc(unsigned long size) {
static int first = 0;
if (__sync_lock_test_and_set(&first, 1) == 0)
- printf("user malloc\n");
+ fprintf(stderr, "user malloc\n");
return __interceptor_malloc(size);
}
Modified: compiler-rt/trunk/test/tsan/aligned_vs_unaligned_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/aligned_vs_unaligned_race.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/aligned_vs_unaligned_race.cc (original)
+++ compiler-rt/trunk/test/tsan/aligned_vs_unaligned_race.cc Wed Mar 2 05:10:02 2016
@@ -28,7 +28,7 @@ int main() {
pthread_create(&t[1], NULL, Thread2, NULL);
pthread_join(t[0], NULL);
pthread_join(t[1], NULL);
- printf("Pass\n");
+ fprintf(stderr, "Pass\n");
// CHECK: ThreadSanitizer: data race
// CHECK: Pass
return 0;
Modified: compiler-rt/trunk/test/tsan/benign_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/benign_race.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/benign_race.cc (original)
+++ compiler-rt/trunk/test/tsan/benign_race.cc Wed Mar 2 05:10:02 2016
@@ -33,7 +33,7 @@ int main() {
Global = 43;
WTFGlobal = 143;
pthread_join(t, 0);
- printf("OK\n");
+ fprintf(stderr, "OK\n");
}
// CHECK-NOT: WARNING: ThreadSanitizer: data race
Modified: compiler-rt/trunk/test/tsan/blacklist.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/blacklist.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/blacklist.cc (original)
+++ compiler-rt/trunk/test/tsan/blacklist.cc Wed Mar 2 05:10:02 2016
@@ -23,7 +23,7 @@ int main() {
pthread_create(&t[1], NULL, Blacklisted_Thread2, NULL);
pthread_join(t[0], NULL);
pthread_join(t[1], NULL);
- printf("PASS\n");
+ fprintf(stderr, "PASS\n");
return 0;
}
Modified: compiler-rt/trunk/test/tsan/blacklist2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/blacklist2.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/blacklist2.cc (original)
+++ compiler-rt/trunk/test/tsan/blacklist2.cc Wed Mar 2 05:10:02 2016
@@ -44,6 +44,6 @@ int main() {
pthread_create(&t[1], NULL, Blacklisted_Thread2, NULL);
pthread_join(t[0], NULL);
pthread_join(t[1], NULL);
- printf("PASS\n");
+ fprintf(stderr, "PASS\n");
return 0;
}
Modified: compiler-rt/trunk/test/tsan/dl_iterate_phdr.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/dl_iterate_phdr.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/dl_iterate_phdr.cc (original)
+++ compiler-rt/trunk/test/tsan/dl_iterate_phdr.cc Wed Mar 2 05:10:02 2016
@@ -47,7 +47,7 @@ int main(int argc, char *argv[]) {
dlclose(lib);
}
pthread_join(th, 0);
- printf("DONE\n");
+ fprintf(stderr, "DONE\n");
return 0;
}
Modified: compiler-rt/trunk/test/tsan/fd_close_norace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_close_norace.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_close_norace.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_close_norace.cc Wed Mar 2 05:10:02 2016
@@ -25,7 +25,7 @@ int main() {
pthread_create(&t[1], NULL, Thread2, NULL);
pthread_join(t[0], NULL);
pthread_join(t[1], NULL);
- printf("OK\n");
+ fprintf(stderr, "OK\n");
}
// CHECK-NOT: WARNING: ThreadSanitizer: data race
Modified: compiler-rt/trunk/test/tsan/fd_close_norace2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_close_norace2.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_close_norace2.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_close_norace2.cc Wed Mar 2 05:10:02 2016
@@ -23,7 +23,7 @@ int main() {
while (write(pipes[1], &t, 1) != 1) {
}
pthread_join(t, 0);
- printf("OK\n");
+ fprintf(stderr, "OK\n");
}
// CHECK-NOT: WARNING: ThreadSanitizer: data race
Modified: compiler-rt/trunk/test/tsan/fd_dup_norace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_dup_norace.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_dup_norace.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_dup_norace.cc Wed Mar 2 05:10:02 2016
@@ -28,7 +28,7 @@ int main() {
pthread_create(&t[1], NULL, Thread2, NULL);
pthread_join(t[0], NULL);
pthread_join(t[1], NULL);
- printf("OK\n");
+ fprintf(stderr, "OK\n");
}
// CHECK-NOT: WARNING: ThreadSanitizer: data race
Modified: compiler-rt/trunk/test/tsan/fd_dup_norace2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_dup_norace2.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_dup_norace2.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_dup_norace2.cc Wed Mar 2 05:10:02 2016
@@ -53,7 +53,7 @@ int main() {
exit(printf("close failed\n"));
if (close(fd2) == -1)
exit(printf("close failed\n"));
- printf("DONE\n");
+ fprintf(stderr, "DONE\n");
}
// CHECK-NOT: WARNING: ThreadSanitizer: data race
Modified: compiler-rt/trunk/test/tsan/fd_dup_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_dup_race.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_dup_race.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_dup_race.cc Wed Mar 2 05:10:02 2016
@@ -27,7 +27,7 @@ int main() {
exit(printf("dup2 failed\n"));
barrier_wait(&barrier);
pthread_join(th, 0);
- printf("DONE\n");
+ fprintf(stderr, "DONE\n");
}
// CHECK: WARNING: ThreadSanitizer: data race
Modified: compiler-rt/trunk/test/tsan/fd_pipe_norace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_pipe_norace.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_pipe_norace.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_pipe_norace.cc Wed Mar 2 05:10:02 2016
@@ -27,7 +27,7 @@ int main() {
pthread_create(&t[1], NULL, Thread2, NULL);
pthread_join(t[0], NULL);
pthread_join(t[1], NULL);
- printf("OK\n");
+ fprintf(stderr, "OK\n");
}
// CHECK-NOT: WARNING: ThreadSanitizer: data race
Modified: compiler-rt/trunk/test/tsan/fd_socket_connect_norace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_socket_connect_norace.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_socket_connect_norace.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_socket_connect_norace.cc Wed Mar 2 05:10:02 2016
@@ -38,7 +38,7 @@ int main() {
pthread_join(t, 0);
close(c);
close(s);
- printf("OK\n");
+ fprintf(stderr, "OK\n");
}
// CHECK-NOT: WARNING: ThreadSanitizer: data race
Modified: compiler-rt/trunk/test/tsan/fd_socket_norace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_socket_norace.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_socket_norace.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_socket_norace.cc Wed Mar 2 05:10:02 2016
@@ -45,7 +45,7 @@ int main() {
close(c);
close(s);
pthread_join(t, 0);
- printf("OK\n");
+ fprintf(stderr, "OK\n");
}
// CHECK-NOT: WARNING: ThreadSanitizer: data race
Modified: compiler-rt/trunk/test/tsan/fd_socketpair_norace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_socketpair_norace.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_socketpair_norace.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_socketpair_norace.cc Wed Mar 2 05:10:02 2016
@@ -31,7 +31,7 @@ int main() {
pthread_create(&t[1], NULL, Thread2, NULL);
pthread_join(t[0], NULL);
pthread_join(t[1], NULL);
- printf("OK\n");
+ fprintf(stderr, "OK\n");
}
// CHECK-NOT: WARNING: ThreadSanitizer: data race
Modified: compiler-rt/trunk/test/tsan/ignore_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_race.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/ignore_race.cc (original)
+++ compiler-rt/trunk/test/tsan/ignore_race.cc Wed Mar 2 05:10:02 2016
@@ -25,7 +25,7 @@ int main() {
barrier_wait(&barrier);
Global = 43;
pthread_join(t, 0);
- printf("OK\n");
+ fprintf(stderr, "OK\n");
}
// CHECK-NOT: WARNING: ThreadSanitizer: data race
Modified: compiler-rt/trunk/test/tsan/inlined_memcpy_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/inlined_memcpy_race.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/inlined_memcpy_race.cc (original)
+++ compiler-rt/trunk/test/tsan/inlined_memcpy_race.cc Wed Mar 2 05:10:02 2016
@@ -24,7 +24,7 @@ int main() {
pthread_create(&t[1], NULL, MemSetThread, x);
pthread_join(t[0], NULL);
pthread_join(t[1], NULL);
- printf("PASS\n");
+ fprintf(stderr, "PASS\n");
return 0;
}
Modified: compiler-rt/trunk/test/tsan/inlined_memcpy_race2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/inlined_memcpy_race2.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/inlined_memcpy_race2.cc (original)
+++ compiler-rt/trunk/test/tsan/inlined_memcpy_race2.cc Wed Mar 2 05:10:02 2016
@@ -25,7 +25,7 @@ int main() {
pthread_join(t[0], NULL);
pthread_join(t[1], NULL);
- printf("PASS\n");
+ fprintf(stderr, "PASS\n");
return 0;
}
Modified: compiler-rt/trunk/test/tsan/interface_atomic_test.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/interface_atomic_test.c?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/interface_atomic_test.c (original)
+++ compiler-rt/trunk/test/tsan/interface_atomic_test.c Wed Mar 2 05:10:02 2016
@@ -9,7 +9,7 @@ int main() {
int res = __tsan_atomic32_load(&a, __tsan_memory_order_acquire);
if (res == 100) {
// CHECK: PASS
- printf("PASS\n");
+ fprintf(stderr, "PASS\n");
return 0;
}
return 1;
Modified: compiler-rt/trunk/test/tsan/java_alloc.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_alloc.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/java_alloc.cc (original)
+++ compiler-rt/trunk/test/tsan/java_alloc.cc Wed Mar 2 05:10:02 2016
@@ -26,10 +26,10 @@ int main() {
stress(jheap);
pthread_join(th, 0);
if (__tsan_java_fini() != 0) {
- printf("FAILED\n");
+ fprintf(stderr, "FAILED\n");
return 1;
}
- printf("DONE\n");
+ fprintf(stderr, "DONE\n");
return 0;
}
Modified: compiler-rt/trunk/test/tsan/java_heap_init.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_heap_init.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/java_heap_init.cc (original)
+++ compiler-rt/trunk/test/tsan/java_heap_init.cc Wed Mar 2 05:10:02 2016
@@ -20,7 +20,7 @@ int main() {
return printf("second mmap failed with %d\n", errno);
__tsan_java_init(jheap, kHeapSize);
__tsan_java_move(jheap + 16, jheap, 16);
- printf("DONE\n");
+ fprintf(stderr, "DONE\n");
return __tsan_java_fini();
}
Modified: compiler-rt/trunk/test/tsan/java_lock_move.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_lock_move.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/java_lock_move.cc (original)
+++ compiler-rt/trunk/test/tsan/java_lock_move.cc Wed Mar 2 05:10:02 2016
@@ -35,7 +35,7 @@ int main() {
barrier_wait(&barrier);
pthread_join(th, 0);
__tsan_java_free(varaddr2, kBlockSize);
- printf("DONE\n");
+ fprintf(stderr, "DONE\n");
return __tsan_java_fini();
}
Modified: compiler-rt/trunk/test/tsan/java_lock_rec.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_lock_rec.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/java_lock_rec.cc (original)
+++ compiler-rt/trunk/test/tsan/java_lock_rec.cc Wed Mar 2 05:10:02 2016
@@ -10,14 +10,14 @@ void *Thread(void *p) {
*(int*)varaddr = 42;
int rec = __tsan_java_mutex_unlock_rec(lockaddr);
if (rec != 2) {
- printf("FAILED 0 rec=%d\n", rec);
+ fprintf(stderr, "FAILED 0 rec=%d\n", rec);
exit(1);
}
barrier_wait(&barrier);
barrier_wait(&barrier);
__tsan_java_mutex_lock_rec(lockaddr, rec);
if (*(int*)varaddr != 43) {
- printf("FAILED 3 var=%d\n", *(int*)varaddr);
+ fprintf(stderr, "FAILED 3 var=%d\n", *(int*)varaddr);
exit(1);
}
__tsan_java_mutex_unlock(lockaddr);
@@ -40,7 +40,7 @@ int main() {
barrier_wait(&barrier);
__tsan_java_mutex_lock(lockaddr);
if (*(int*)varaddr != 42) {
- printf("FAILED 1 var=%d\n", *(int*)varaddr);
+ fprintf(stderr, "FAILED 1 var=%d\n", *(int*)varaddr);
exit(1);
}
*(int*)varaddr = 43;
@@ -48,7 +48,7 @@ int main() {
barrier_wait(&barrier);
pthread_join(th, 0);
__tsan_java_free(jheap, kBlockSize);
- printf("DONE\n");
+ fprintf(stderr, "DONE\n");
return __tsan_java_fini();
}
Modified: compiler-rt/trunk/test/tsan/java_lock_rec_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_lock_rec_race.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/java_lock_rec_race.cc (original)
+++ compiler-rt/trunk/test/tsan/java_lock_rec_race.cc Wed Mar 2 05:10:02 2016
@@ -10,7 +10,7 @@ void *Thread(void *p) {
__tsan_java_mutex_lock(lockaddr);
int rec = __tsan_java_mutex_unlock_rec(lockaddr);
if (rec != 3) {
- printf("FAILED 0 rec=%d\n", rec);
+ fprintf(stderr, "FAILED 0 rec=%d\n", rec);
exit(1);
}
*(int*)varaddr = 42;
@@ -42,7 +42,7 @@ int main() {
barrier_wait(&barrier);
pthread_join(th, 0);
__tsan_java_free(jheap, kBlockSize);
- printf("DONE\n");
+ fprintf(stderr, "DONE\n");
return __tsan_java_fini();
}
Modified: compiler-rt/trunk/test/tsan/java_move_overlap.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_move_overlap.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/java_move_overlap.cc (original)
+++ compiler-rt/trunk/test/tsan/java_move_overlap.cc Wed Mar 2 05:10:02 2016
@@ -66,7 +66,7 @@ int main(int argc, char **argv) {
barrier_wait(&barrier);
pthread_join(th, 0);
__tsan_java_free(varaddr1_new, kBlockSize);
- printf("DONE\n");
+ fprintf(stderr, "DONE\n");
return __tsan_java_fini();
}
Modified: compiler-rt/trunk/test/tsan/java_move_overlap_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_move_overlap_race.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/java_move_overlap_race.cc (original)
+++ compiler-rt/trunk/test/tsan/java_move_overlap_race.cc Wed Mar 2 05:10:02 2016
@@ -46,7 +46,7 @@ int main(int argc, char **argv) {
barrier_wait(&barrier);
pthread_join(th, 0);
__tsan_java_free(varaddr1_new, kBlockSize);
- printf("DONE\n");
+ fprintf(stderr, "DONE\n");
return __tsan_java_fini();
}
Modified: compiler-rt/trunk/test/tsan/java_rwlock.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_rwlock.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/java_rwlock.cc (original)
+++ compiler-rt/trunk/test/tsan/java_rwlock.cc Wed Mar 2 05:10:02 2016
@@ -29,7 +29,7 @@ int main() {
barrier_wait(&barrier);
pthread_join(th, 0);
__tsan_java_free(jheap, kBlockSize);
- printf("DONE\n");
+ fprintf(stderr, "DONE\n");
return __tsan_java_fini();
}
Modified: compiler-rt/trunk/test/tsan/longjmp.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/longjmp.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/longjmp.cc (original)
+++ compiler-rt/trunk/test/tsan/longjmp.cc Wed Mar 2 05:10:02 2016
@@ -14,11 +14,11 @@ int foo(jmp_buf env) {
int main() {
jmp_buf env;
if (setjmp(env) == 42) {
- printf("JUMPED\n");
+ fprintf(stderr, "JUMPED\n");
return 0;
}
foo(env);
- printf("FAILED\n");
+ fprintf(stderr, "FAILED\n");
return 0;
}
Modified: compiler-rt/trunk/test/tsan/longjmp2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/longjmp2.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/longjmp2.cc (original)
+++ compiler-rt/trunk/test/tsan/longjmp2.cc Wed Mar 2 05:10:02 2016
@@ -16,11 +16,11 @@ int main() {
sigjmp_buf env;
printf("env=%p\n", env);
if (sigsetjmp(env, 1) == 42) {
- printf("JUMPED\n");
+ printf(stderr, "JUMPED\n");
return 0;
}
foo(env);
- printf("FAILED\n");
+ fprintf(stderr, "FAILED\n");
return 0;
}
Modified: compiler-rt/trunk/test/tsan/longjmp3.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/longjmp3.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/longjmp3.cc (original)
+++ compiler-rt/trunk/test/tsan/longjmp3.cc Wed Mar 2 05:10:02 2016
@@ -34,7 +34,7 @@ void mymain() {
return;
}
foo(env);
- printf("FAILED\n");
+ fprintf(stderr, "FAILED\n");
}
int main() {
Modified: compiler-rt/trunk/test/tsan/longjmp4.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/longjmp4.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/longjmp4.cc (original)
+++ compiler-rt/trunk/test/tsan/longjmp4.cc Wed Mar 2 05:10:02 2016
@@ -37,7 +37,7 @@ void mymain() {
return;
}
foo(env);
- printf("FAILED\n");
+ fprintf(stderr, "FAILED\n");
}
int main() {
Modified: compiler-rt/trunk/test/tsan/malloc_overflow.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/malloc_overflow.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/malloc_overflow.cc (original)
+++ compiler-rt/trunk/test/tsan/malloc_overflow.cc Wed Mar 2 05:10:02 2016
@@ -6,17 +6,17 @@
int main() {
void *p = malloc((size_t)-1);
if (p != 0)
- printf("FAIL malloc(-1) = %p\n", p);
+ fprintf(stderr, "FAIL malloc(-1) = %p\n", p);
p = malloc((size_t)-1 / 2);
if (p != 0)
- printf("FAIL malloc(-1/2) = %p\n", p);
+ fprintf(stderr, "FAIL malloc(-1/2) = %p\n", p);
p = calloc((size_t)-1, (size_t)-1);
if (p != 0)
- printf("FAIL calloc(-1, -1) = %p\n", p);
+ fprintf(stderr, "FAIL calloc(-1, -1) = %p\n", p);
p = calloc((size_t)-1 / 2, (size_t)-1 / 2);
if (p != 0)
- printf("FAIL calloc(-1/2, -1/2) = %p\n", p);
- printf("OK\n");
+ fprintf(stderr, "FAIL calloc(-1/2, -1/2) = %p\n", p);
+ fprintf(stderr, "OK\n");
}
// CHECK-NOT: FAIL
Modified: compiler-rt/trunk/test/tsan/race_on_speculative_load.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_on_speculative_load.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/race_on_speculative_load.cc (original)
+++ compiler-rt/trunk/test/tsan/race_on_speculative_load.cc Wed Mar 2 05:10:02 2016
@@ -24,7 +24,7 @@ int main() {
g = 1;
barrier_wait(&barrier);
pthread_join(t, 0);
- printf("PASS\n");
+ fprintf(stderr, "PASS\n");
// CHECK-NOT: ThreadSanitizer: data race
// CHECK: PASS
}
Modified: compiler-rt/trunk/test/tsan/static_init1.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/static_init1.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/static_init1.cc (original)
+++ compiler-rt/trunk/test/tsan/static_init1.cc Wed Mar 2 05:10:02 2016
@@ -21,7 +21,7 @@ int main() {
pthread_create(&t[1], 0, Thread, 0);
pthread_join(t[0], 0);
pthread_join(t[1], 0);
- printf("PASS\n");
+ fprintf(stderr, "PASS\n");
}
// CHECK-NOT: WARNING: ThreadSanitizer: data race
Modified: compiler-rt/trunk/test/tsan/static_init2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/static_init2.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/static_init2.cc (original)
+++ compiler-rt/trunk/test/tsan/static_init2.cc Wed Mar 2 05:10:02 2016
@@ -27,7 +27,7 @@ int main() {
pthread_create(&t[1], 0, Thread, 0);
pthread_join(t[0], 0);
pthread_join(t[1], 0);
- printf("PASS\n");
+ fprintf(stderr, "PASS\n");
}
// CHECK-NOT: WARNING: ThreadSanitizer: data race
Modified: compiler-rt/trunk/test/tsan/static_init4.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/static_init4.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/static_init4.cc (original)
+++ compiler-rt/trunk/test/tsan/static_init4.cc Wed Mar 2 05:10:02 2016
@@ -31,7 +31,7 @@ int main() {
pthread_create(&t[1], 0, Thread1, 0);
pthread_join(t[0], 0);
pthread_join(t[1], 0);
- printf("PASS\n");
+ fprintf(stderr, "PASS\n");
}
// CHECK-NOT: WARNING: ThreadSanitizer: data race
Modified: compiler-rt/trunk/test/tsan/static_init5.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/static_init5.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/static_init5.cc (original)
+++ compiler-rt/trunk/test/tsan/static_init5.cc Wed Mar 2 05:10:02 2016
@@ -36,7 +36,7 @@ int main() {
pthread_create(&t[1], 0, Thread1, 0);
pthread_join(t[0], 0);
pthread_join(t[1], 0);
- printf("PASS\n");
+ fprintf(stderr, "PASS\n");
}
// CHECK-NOT: WARNING: ThreadSanitizer: data race
Modified: compiler-rt/trunk/test/tsan/static_init6.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/static_init6.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/static_init6.cc (original)
+++ compiler-rt/trunk/test/tsan/static_init6.cc Wed Mar 2 05:10:02 2016
@@ -36,7 +36,7 @@ int main() {
pthread_create(&t[1], 0, Thread1, 0);
pthread_join(t[0], 0);
pthread_join(t[1], 0);
- printf("PASS\n");
+ fprintf(stderr, "PASS\n");
}
// CHECK-NOT: WARNING: ThreadSanitizer: data race
Modified: compiler-rt/trunk/test/tsan/sunrpc.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/sunrpc.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/sunrpc.cc (original)
+++ compiler-rt/trunk/test/tsan/sunrpc.cc Wed Mar 2 05:10:02 2016
@@ -19,7 +19,7 @@ int main(int argc, char *argv[]) {
pthread_create(&th[1], 0, thr, 0);
pthread_join(th[0], 0);
pthread_join(th[1], 0);
- printf("DONE\n");
+ fprintf(stderr, "DONE\n");
// CHECK: DONE
return 0;
}
Modified: compiler-rt/trunk/test/tsan/suppressions_global.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppressions_global.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/suppressions_global.cc (original)
+++ compiler-rt/trunk/test/tsan/suppressions_global.cc Wed Mar 2 05:10:02 2016
@@ -20,7 +20,7 @@ int main() {
pthread_create(&t[1], NULL, Thread2, NULL);
pthread_join(t[0], NULL);
pthread_join(t[1], NULL);
- printf("OK\n");
+ fprintf(stderr, "OK\n");
return 0;
}
Modified: compiler-rt/trunk/test/tsan/suppressions_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppressions_race.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/suppressions_race.cc (original)
+++ compiler-rt/trunk/test/tsan/suppressions_race.cc Wed Mar 2 05:10:02 2016
@@ -22,7 +22,7 @@ int main() {
pthread_create(&t[1], NULL, Thread2, NULL);
pthread_join(t[0], NULL);
pthread_join(t[1], NULL);
- printf("OK\n");
+ fprintf(stderr, "OK\n");
return 0;
}
Modified: compiler-rt/trunk/test/tsan/suppressions_race2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppressions_race2.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/suppressions_race2.cc (original)
+++ compiler-rt/trunk/test/tsan/suppressions_race2.cc Wed Mar 2 05:10:02 2016
@@ -22,7 +22,7 @@ int main() {
pthread_create(&t[1], NULL, Thread2, NULL);
pthread_join(t[0], NULL);
pthread_join(t[1], NULL);
- printf("OK\n");
+ fprintf(stderr, "OK\n");
return 0;
}
Modified: compiler-rt/trunk/test/tsan/thread_detach.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/thread_detach.c?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/thread_detach.c (original)
+++ compiler-rt/trunk/test/tsan/thread_detach.c Wed Mar 2 05:10:02 2016
@@ -12,7 +12,7 @@ int main() {
pthread_create(&t, 0, Thread, 0);
barrier_wait(&barrier);
pthread_detach(t);
- printf("PASS\n");
+ fprintf(stderr, "PASS\n");
return 0;
}
Modified: compiler-rt/trunk/test/tsan/thread_detach2.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/thread_detach2.c?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/thread_detach2.c (original)
+++ compiler-rt/trunk/test/tsan/thread_detach2.c Wed Mar 2 05:10:02 2016
@@ -20,7 +20,7 @@ int main() {
pthread_create(&t, 0, Thread, 0);
pthread_detach(t);
barrier_wait(&barrier);
- printf("PASS\n");
+ fprintf(stderr, "PASS\n");
return 0;
}
Modified: compiler-rt/trunk/test/tsan/thread_leak.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/thread_leak.c?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/thread_leak.c (original)
+++ compiler-rt/trunk/test/tsan/thread_leak.c Wed Mar 2 05:10:02 2016
@@ -10,7 +10,7 @@ int main() {
pthread_t t;
pthread_create(&t, 0, Thread, 0);
pthread_join(t, 0);
- printf("PASS\n");
+ fprintf(stderr, "PASS\n");
return 0;
}
Modified: compiler-rt/trunk/test/tsan/thread_leak2.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/thread_leak2.c?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/thread_leak2.c (original)
+++ compiler-rt/trunk/test/tsan/thread_leak2.c Wed Mar 2 05:10:02 2016
@@ -10,7 +10,7 @@ int main() {
pthread_t t;
pthread_create(&t, 0, Thread, 0);
pthread_detach(t);
- printf("PASS\n");
+ fprintf(stderr, "PASS\n");
return 0;
}
Modified: compiler-rt/trunk/test/tsan/thread_leak4.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/thread_leak4.c?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/thread_leak4.c (original)
+++ compiler-rt/trunk/test/tsan/thread_leak4.c Wed Mar 2 05:10:02 2016
@@ -9,7 +9,7 @@ void *Thread(void *x) {
int main() {
pthread_t t;
pthread_create(&t, 0, Thread, 0);
- printf("DONE\n");
+ fprintf(stderr, "DONE\n");
return 0;
}
Modified: compiler-rt/trunk/test/tsan/tsan-vs-gvn.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/tsan-vs-gvn.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/tsan-vs-gvn.cc (original)
+++ compiler-rt/trunk/test/tsan/tsan-vs-gvn.cc Wed Mar 2 05:10:02 2016
@@ -31,7 +31,7 @@ int main() {
pthread_create(&t[1], NULL, Thread2, NULL);
pthread_join(t[0], NULL);
pthread_join(t[1], NULL);
- printf("PASS\n");
+ fprintf(stderr, "PASS\n");
}
// CHECK-NOT: WARNING: ThreadSanitizer: data race
Modified: compiler-rt/trunk/test/tsan/unaligned_norace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/unaligned_norace.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/unaligned_norace.cc (original)
+++ compiler-rt/trunk/test/tsan/unaligned_norace.cc Wed Mar 2 05:10:02 2016
@@ -77,7 +77,7 @@ int main() {
pthread_create(&th, 0, Thread, 0);
Test(true);
pthread_join(th, 0);
- printf("OK\n");
+ fprintf(stderr, "OK\n");
}
// CHECK-NOT: WARNING: ThreadSanitizer:
Modified: compiler-rt/trunk/test/tsan/vfork.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/vfork.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/vfork.cc (original)
+++ compiler-rt/trunk/test/tsan/vfork.cc Wed Mar 2 05:10:02 2016
@@ -27,7 +27,7 @@ int main() {
pipe(fds);
int pid = vfork();
if (pid < 0) {
- printf("FAIL to vfork\n");
+ fprintf(stderr, "FAIL to vfork\n");
exit(1);
}
if (pid == 0) { // child
@@ -44,7 +44,7 @@ int main() {
pthread_create(&t[1], NULL, Thread2, NULL);
pthread_join(t[0], NULL);
pthread_join(t[1], NULL);
- printf("DONE\n");
+ fprintf(stderr, "DONE\n");
}
// CHECK-NOT: WARNING: ThreadSanitizer: data race
Modified: compiler-rt/trunk/test/tsan/virtual_inheritance_compile_bug.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/virtual_inheritance_compile_bug.cc?rev=262476&r1=262475&r2=262476&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/virtual_inheritance_compile_bug.cc (original)
+++ compiler-rt/trunk/test/tsan/virtual_inheritance_compile_bug.cc Wed Mar 2 05:10:02 2016
@@ -10,6 +10,6 @@ struct DDD: CCC, BBB { DDD(); }; // NOL
DDD::DDD() { }
int main() {
DDD d;
- printf("OK\n");
+ fprintf(stderr, "OK\n");
}
// CHECK: OK
More information about the llvm-commits
mailing list