[compiler-rt] r367656 - compiler-rt: Rename .cc file in test/tsan to .cpp
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 2 00:18:09 PDT 2019
Author: maskray
Date: Fri Aug 2 00:18:07 2019
New Revision: 367656
URL: http://llvm.org/viewvc/llvm-project?rev=367656&view=rev
Log:
compiler-rt: Rename .cc file in test/tsan to .cpp
Like r367463, but for test/tsan.
Added:
compiler-rt/trunk/test/tsan/Darwin/debug_external.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Darwin/debug_external.cc
compiler-rt/trunk/test/tsan/Darwin/dlopen.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Darwin/dlopen.cc
compiler-rt/trunk/test/tsan/Darwin/external-dups.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Darwin/external-dups.cc
compiler-rt/trunk/test/tsan/Darwin/external-ignore-noninstrumented.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Darwin/external-ignore-noninstrumented.cc
compiler-rt/trunk/test/tsan/Darwin/external-lib.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Darwin/external-lib.cc
compiler-rt/trunk/test/tsan/Darwin/external-noninstrumented-module.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Darwin/external-noninstrumented-module.cc
compiler-rt/trunk/test/tsan/Darwin/external-swift-debugging.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Darwin/external-swift-debugging.cc
compiler-rt/trunk/test/tsan/Darwin/external-swift.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Darwin/external-swift.cc
compiler-rt/trunk/test/tsan/Darwin/external.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Darwin/external.cc
compiler-rt/trunk/test/tsan/Darwin/malloc-stack-logging.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Darwin/malloc-stack-logging.cc
compiler-rt/trunk/test/tsan/Darwin/osspinlock-norace.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Darwin/osspinlock-norace.cc
compiler-rt/trunk/test/tsan/Darwin/realloc-zero.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Darwin/realloc-zero.cc
compiler-rt/trunk/test/tsan/Darwin/signals-blocked.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Darwin/signals-blocked.cc
compiler-rt/trunk/test/tsan/Darwin/symbolizer-atos.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Darwin/symbolizer-atos.cc
compiler-rt/trunk/test/tsan/Darwin/symbolizer-dladdr.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Darwin/symbolizer-dladdr.cc
compiler-rt/trunk/test/tsan/Linux/check_preinit.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Linux/check_preinit.cc
compiler-rt/trunk/test/tsan/Linux/double_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Linux/double_race.cc
compiler-rt/trunk/test/tsan/Linux/mutex_robust.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Linux/mutex_robust.cc
compiler-rt/trunk/test/tsan/Linux/mutex_robust2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Linux/mutex_robust2.cc
compiler-rt/trunk/test/tsan/Linux/pie_no_aslr.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Linux/pie_no_aslr.cc
compiler-rt/trunk/test/tsan/Linux/user_fopen.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Linux/user_fopen.cc
compiler-rt/trunk/test/tsan/Linux/user_malloc.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/Linux/user_malloc.cc
compiler-rt/trunk/test/tsan/aligned_vs_unaligned_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/aligned_vs_unaligned_race.cc
compiler-rt/trunk/test/tsan/annotate_happens_before.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/annotate_happens_before.cc
compiler-rt/trunk/test/tsan/atexit.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/atexit.cc
compiler-rt/trunk/test/tsan/atexit2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/atexit2.cc
compiler-rt/trunk/test/tsan/atexit3.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/atexit3.cc
compiler-rt/trunk/test/tsan/atomic_free.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/atomic_free.cc
compiler-rt/trunk/test/tsan/atomic_free2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/atomic_free2.cc
compiler-rt/trunk/test/tsan/atomic_free3.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/atomic_free3.cc
compiler-rt/trunk/test/tsan/atomic_hle.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/atomic_hle.cc
compiler-rt/trunk/test/tsan/atomic_norace.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/atomic_norace.cc
compiler-rt/trunk/test/tsan/atomic_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/atomic_race.cc
compiler-rt/trunk/test/tsan/atomic_stack.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/atomic_stack.cc
compiler-rt/trunk/test/tsan/atomic_store.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/atomic_store.cc
compiler-rt/trunk/test/tsan/barrier.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/barrier.cc
compiler-rt/trunk/test/tsan/bench_acquire_only.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/bench_acquire_only.cc
compiler-rt/trunk/test/tsan/bench_acquire_release.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/bench_acquire_release.cc
compiler-rt/trunk/test/tsan/bench_local_mutex.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/bench_local_mutex.cc
compiler-rt/trunk/test/tsan/bench_mutex.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/bench_mutex.cc
compiler-rt/trunk/test/tsan/bench_release_only.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/bench_release_only.cc
compiler-rt/trunk/test/tsan/bench_rwmutex.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/bench_rwmutex.cc
compiler-rt/trunk/test/tsan/bench_shadow_flush.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/bench_shadow_flush.cc
compiler-rt/trunk/test/tsan/bench_single_writer.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/bench_single_writer.cc
compiler-rt/trunk/test/tsan/bench_ten_mutexes.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/bench_ten_mutexes.cc
compiler-rt/trunk/test/tsan/benign_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/benign_race.cc
compiler-rt/trunk/test/tsan/blacklist.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/blacklist.cc
compiler-rt/trunk/test/tsan/blacklist2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/blacklist2.cc
compiler-rt/trunk/test/tsan/cond_destruction.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/cond_destruction.cc
compiler-rt/trunk/test/tsan/cond_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/cond_race.cc
compiler-rt/trunk/test/tsan/custom_mutex0.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/custom_mutex0.cc
compiler-rt/trunk/test/tsan/custom_mutex1.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/custom_mutex1.cc
compiler-rt/trunk/test/tsan/custom_mutex2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/custom_mutex2.cc
compiler-rt/trunk/test/tsan/custom_mutex3.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/custom_mutex3.cc
compiler-rt/trunk/test/tsan/custom_mutex4.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/custom_mutex4.cc
compiler-rt/trunk/test/tsan/custom_mutex5.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/custom_mutex5.cc
compiler-rt/trunk/test/tsan/cxa_guard_acquire.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/cxa_guard_acquire.cc
compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc
compiler-rt/trunk/test/tsan/debug_alloc_stack.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/debug_alloc_stack.cc
compiler-rt/trunk/test/tsan/debug_locate.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/debug_locate.cc
compiler-rt/trunk/test/tsan/debugging.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/debugging.cc
compiler-rt/trunk/test/tsan/deep_stack1.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/deep_stack1.cc
compiler-rt/trunk/test/tsan/default_options.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/default_options.cc
compiler-rt/trunk/test/tsan/dl_iterate_phdr.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/dl_iterate_phdr.cc
compiler-rt/trunk/test/tsan/dlclose.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/dlclose.cc
compiler-rt/trunk/test/tsan/exceptions.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/exceptions.cc
compiler-rt/trunk/test/tsan/fd_close_norace.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fd_close_norace.cc
compiler-rt/trunk/test/tsan/fd_close_norace2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fd_close_norace2.cc
compiler-rt/trunk/test/tsan/fd_dup_norace.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fd_dup_norace.cc
compiler-rt/trunk/test/tsan/fd_dup_norace2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fd_dup_norace2.cc
compiler-rt/trunk/test/tsan/fd_dup_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fd_dup_race.cc
compiler-rt/trunk/test/tsan/fd_location.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fd_location.cc
compiler-rt/trunk/test/tsan/fd_pipe_norace.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fd_pipe_norace.cc
compiler-rt/trunk/test/tsan/fd_pipe_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fd_pipe_race.cc
compiler-rt/trunk/test/tsan/fd_socket_connect_norace.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fd_socket_connect_norace.cc
compiler-rt/trunk/test/tsan/fd_socket_norace.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fd_socket_norace.cc
compiler-rt/trunk/test/tsan/fd_socketpair_norace.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fd_socketpair_norace.cc
compiler-rt/trunk/test/tsan/fd_stdout_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fd_stdout_race.cc
compiler-rt/trunk/test/tsan/fd_tid_recycled.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fd_tid_recycled.cc
compiler-rt/trunk/test/tsan/fiber_asm.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fiber_asm.cc
compiler-rt/trunk/test/tsan/fiber_from_thread.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fiber_from_thread.cc
compiler-rt/trunk/test/tsan/fiber_longjmp.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fiber_longjmp.cc
compiler-rt/trunk/test/tsan/fiber_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fiber_race.cc
compiler-rt/trunk/test/tsan/fiber_simple.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fiber_simple.cc
compiler-rt/trunk/test/tsan/fiber_two_threads.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fiber_two_threads.cc
compiler-rt/trunk/test/tsan/fork_atexit.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fork_atexit.cc
compiler-rt/trunk/test/tsan/fork_deadlock.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fork_deadlock.cc
compiler-rt/trunk/test/tsan/fork_multithreaded.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fork_multithreaded.cc
compiler-rt/trunk/test/tsan/fork_multithreaded3.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/fork_multithreaded3.cc
compiler-rt/trunk/test/tsan/getline_nohang.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/getline_nohang.cc
compiler-rt/trunk/test/tsan/global_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/global_race.cc
compiler-rt/trunk/test/tsan/global_race2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/global_race2.cc
compiler-rt/trunk/test/tsan/global_race3.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/global_race3.cc
compiler-rt/trunk/test/tsan/halt_on_error.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/halt_on_error.cc
compiler-rt/trunk/test/tsan/heap_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/heap_race.cc
compiler-rt/trunk/test/tsan/ignore_free.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/ignore_free.cc
compiler-rt/trunk/test/tsan/ignore_lib0.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/ignore_lib0.cc
compiler-rt/trunk/test/tsan/ignore_lib0.cpp.supp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/ignore_lib0.cc.supp
compiler-rt/trunk/test/tsan/ignore_lib1.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/ignore_lib1.cc
compiler-rt/trunk/test/tsan/ignore_lib1.cpp.supp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/ignore_lib1.cc.supp
compiler-rt/trunk/test/tsan/ignore_lib2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/ignore_lib2.cc
compiler-rt/trunk/test/tsan/ignore_lib2.cpp.supp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/ignore_lib2.cc.supp
compiler-rt/trunk/test/tsan/ignore_lib3.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/ignore_lib3.cc
compiler-rt/trunk/test/tsan/ignore_lib3.cpp.supp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/ignore_lib3.cc.supp
compiler-rt/trunk/test/tsan/ignore_lib4.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/ignore_lib4.cc
compiler-rt/trunk/test/tsan/ignore_lib5.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/ignore_lib5.cc
compiler-rt/trunk/test/tsan/ignore_lib5.cpp.supp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/ignore_lib5.cc.supp
compiler-rt/trunk/test/tsan/ignore_malloc.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/ignore_malloc.cc
compiler-rt/trunk/test/tsan/ignore_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/ignore_race.cc
compiler-rt/trunk/test/tsan/ignore_sync.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/ignore_sync.cc
compiler-rt/trunk/test/tsan/ignored-interceptors-mmap.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/ignored-interceptors-mmap.cc
compiler-rt/trunk/test/tsan/inlined_memcpy_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/inlined_memcpy_race.cc
compiler-rt/trunk/test/tsan/inlined_memcpy_race2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/inlined_memcpy_race2.cc
compiler-rt/trunk/test/tsan/java_alloc.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/java_alloc.cc
compiler-rt/trunk/test/tsan/java_finalizer.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/java_finalizer.cc
compiler-rt/trunk/test/tsan/java_find.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/java_find.cc
compiler-rt/trunk/test/tsan/java_heap_init.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/java_heap_init.cc
compiler-rt/trunk/test/tsan/java_lock.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/java_lock.cc
compiler-rt/trunk/test/tsan/java_lock_move.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/java_lock_move.cc
compiler-rt/trunk/test/tsan/java_lock_rec.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/java_lock_rec.cc
compiler-rt/trunk/test/tsan/java_lock_rec_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/java_lock_rec_race.cc
compiler-rt/trunk/test/tsan/java_move_overlap.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/java_move_overlap.cc
compiler-rt/trunk/test/tsan/java_move_overlap_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/java_move_overlap_race.cc
compiler-rt/trunk/test/tsan/java_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/java_race.cc
compiler-rt/trunk/test/tsan/java_race_move.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/java_race_move.cc
compiler-rt/trunk/test/tsan/java_race_pc.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/java_race_pc.cc
compiler-rt/trunk/test/tsan/java_rwlock.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/java_rwlock.cc
compiler-rt/trunk/test/tsan/java_symbolization.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/java_symbolization.cc
compiler-rt/trunk/test/tsan/java_symbolization_legacy.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/java_symbolization_legacy.cc
compiler-rt/trunk/test/tsan/java_volatile.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/java_volatile.cc
compiler-rt/trunk/test/tsan/large_malloc_meta.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/large_malloc_meta.cc
compiler-rt/trunk/test/tsan/libcxx/std_shared_ptr.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/libcxx/std_shared_ptr.cc
compiler-rt/trunk/test/tsan/libdispatch/groups-destructor.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/libdispatch/groups-destructor.cc
compiler-rt/trunk/test/tsan/libdispatch/sync-block-copy.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/libdispatch/sync-block-copy.cc
compiler-rt/trunk/test/tsan/load_shared_lib.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/load_shared_lib.cc
compiler-rt/trunk/test/tsan/longjmp.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/longjmp.cc
compiler-rt/trunk/test/tsan/longjmp2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/longjmp2.cc
compiler-rt/trunk/test/tsan/longjmp3.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/longjmp3.cc
compiler-rt/trunk/test/tsan/longjmp4.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/longjmp4.cc
compiler-rt/trunk/test/tsan/malloc_overflow.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/malloc_overflow.cc
compiler-rt/trunk/test/tsan/malloc_stack.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/malloc_stack.cc
compiler-rt/trunk/test/tsan/map32bit.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/map32bit.cc
compiler-rt/trunk/test/tsan/memcmp_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/memcmp_race.cc
compiler-rt/trunk/test/tsan/memcpy_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/memcpy_race.cc
compiler-rt/trunk/test/tsan/mmap_large.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mmap_large.cc
compiler-rt/trunk/test/tsan/mmap_stress.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mmap_stress.cc
compiler-rt/trunk/test/tsan/mop_with_offset.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mop_with_offset.cc
compiler-rt/trunk/test/tsan/mop_with_offset2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mop_with_offset2.cc
compiler-rt/trunk/test/tsan/must_deadlock.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/must_deadlock.cc
compiler-rt/trunk/test/tsan/mutex_annotations.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mutex_annotations.cc
compiler-rt/trunk/test/tsan/mutex_bad_read_lock.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mutex_bad_read_lock.cc
compiler-rt/trunk/test/tsan/mutex_bad_read_unlock.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mutex_bad_read_unlock.cc
compiler-rt/trunk/test/tsan/mutex_bad_unlock.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mutex_bad_unlock.cc
compiler-rt/trunk/test/tsan/mutex_destroy_locked.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mutex_destroy_locked.cc
compiler-rt/trunk/test/tsan/mutex_destroy_locked2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mutex_destroy_locked2.cc
compiler-rt/trunk/test/tsan/mutex_double_lock.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mutex_double_lock.cc
compiler-rt/trunk/test/tsan/mutex_lock_destroyed.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mutex_lock_destroyed.cc
compiler-rt/trunk/test/tsan/mutexset1.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mutexset1.cc
compiler-rt/trunk/test/tsan/mutexset2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mutexset2.cc
compiler-rt/trunk/test/tsan/mutexset3.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mutexset3.cc
compiler-rt/trunk/test/tsan/mutexset4.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mutexset4.cc
compiler-rt/trunk/test/tsan/mutexset5.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mutexset5.cc
compiler-rt/trunk/test/tsan/mutexset6.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mutexset6.cc
compiler-rt/trunk/test/tsan/mutexset7.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mutexset7.cc
compiler-rt/trunk/test/tsan/mutexset8.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/mutexset8.cc
compiler-rt/trunk/test/tsan/pie_test.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/pie_test.cc
compiler-rt/trunk/test/tsan/pthread_key.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/pthread_key.cc
compiler-rt/trunk/test/tsan/race_on_fputs.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/race_on_fputs.cc
compiler-rt/trunk/test/tsan/race_on_heap.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/race_on_heap.cc
compiler-rt/trunk/test/tsan/race_on_puts.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/race_on_puts.cc
compiler-rt/trunk/test/tsan/race_on_read.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/race_on_read.cc
compiler-rt/trunk/test/tsan/race_on_speculative_load.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/race_on_speculative_load.cc
compiler-rt/trunk/test/tsan/race_on_write.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/race_on_write.cc
compiler-rt/trunk/test/tsan/race_stress.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/race_stress.cc
compiler-rt/trunk/test/tsan/race_top_suppression.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/race_top_suppression.cc
compiler-rt/trunk/test/tsan/race_top_suppression1.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/race_top_suppression1.cc
compiler-rt/trunk/test/tsan/race_with_finished_thread.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/race_with_finished_thread.cc
compiler-rt/trunk/test/tsan/real_deadlock_detector_stress_test.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/real_deadlock_detector_stress_test.cc
compiler-rt/trunk/test/tsan/restore_stack.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/restore_stack.cc
compiler-rt/trunk/test/tsan/signal_block.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/signal_block.cc
compiler-rt/trunk/test/tsan/signal_cond.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/signal_cond.cc
compiler-rt/trunk/test/tsan/signal_errno.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/signal_errno.cc
compiler-rt/trunk/test/tsan/signal_longjmp.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/signal_longjmp.cc
compiler-rt/trunk/test/tsan/signal_malloc.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/signal_malloc.cc
compiler-rt/trunk/test/tsan/signal_pause.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/signal_pause.cc
compiler-rt/trunk/test/tsan/signal_recursive.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/signal_recursive.cc
compiler-rt/trunk/test/tsan/signal_reset.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/signal_reset.cc
compiler-rt/trunk/test/tsan/signal_sync.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/signal_sync.cc
compiler-rt/trunk/test/tsan/signal_sync2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/signal_sync2.cc
compiler-rt/trunk/test/tsan/signal_thread.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/signal_thread.cc
compiler-rt/trunk/test/tsan/signal_write.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/signal_write.cc
compiler-rt/trunk/test/tsan/sigsuspend.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/sigsuspend.cc
compiler-rt/trunk/test/tsan/simple_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/simple_race.cc
compiler-rt/trunk/test/tsan/simple_stack2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/simple_stack2.cc
compiler-rt/trunk/test/tsan/sleep_sync.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/sleep_sync.cc
compiler-rt/trunk/test/tsan/sleep_sync2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/sleep_sync2.cc
compiler-rt/trunk/test/tsan/stack_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/stack_race.cc
compiler-rt/trunk/test/tsan/stack_race2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/stack_race2.cc
compiler-rt/trunk/test/tsan/stack_sync_reuse.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/stack_sync_reuse.cc
compiler-rt/trunk/test/tsan/static_init1.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/static_init1.cc
compiler-rt/trunk/test/tsan/static_init2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/static_init2.cc
compiler-rt/trunk/test/tsan/static_init3.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/static_init3.cc
compiler-rt/trunk/test/tsan/static_init4.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/static_init4.cc
compiler-rt/trunk/test/tsan/static_init5.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/static_init5.cc
compiler-rt/trunk/test/tsan/static_init6.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/static_init6.cc
compiler-rt/trunk/test/tsan/strerror_r.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/strerror_r.cc
compiler-rt/trunk/test/tsan/sunrpc.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/sunrpc.cc
compiler-rt/trunk/test/tsan/suppress_same_address.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/suppress_same_address.cc
compiler-rt/trunk/test/tsan/suppress_same_stacks.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/suppress_same_stacks.cc
compiler-rt/trunk/test/tsan/suppressions_global.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/suppressions_global.cc
compiler-rt/trunk/test/tsan/suppressions_global.cpp.supp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/suppressions_global.cc.supp
compiler-rt/trunk/test/tsan/suppressions_mutex.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/suppressions_mutex.cc
compiler-rt/trunk/test/tsan/suppressions_mutex.cpp.supp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/suppressions_mutex.cc.supp
compiler-rt/trunk/test/tsan/suppressions_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/suppressions_race.cc
compiler-rt/trunk/test/tsan/suppressions_race.cpp.supp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/suppressions_race.cc.supp
compiler-rt/trunk/test/tsan/suppressions_race2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/suppressions_race2.cc
compiler-rt/trunk/test/tsan/suppressions_race2.cpp.supp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/suppressions_race2.cc.supp
compiler-rt/trunk/test/tsan/thread_end_with_ignore.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/thread_end_with_ignore.cc
compiler-rt/trunk/test/tsan/thread_end_with_ignore2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/thread_end_with_ignore2.cc
compiler-rt/trunk/test/tsan/thread_end_with_ignore3.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/thread_end_with_ignore3.cc
compiler-rt/trunk/test/tsan/thread_name.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/thread_name.cc
compiler-rt/trunk/test/tsan/thread_name2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/thread_name2.cc
compiler-rt/trunk/test/tsan/tls_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/tls_race.cc
compiler-rt/trunk/test/tsan/tls_race2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/tls_race2.cc
compiler-rt/trunk/test/tsan/tsan-vs-gvn.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/tsan-vs-gvn.cc
compiler-rt/trunk/test/tsan/unaligned_norace.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/unaligned_norace.cc
compiler-rt/trunk/test/tsan/unaligned_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/unaligned_race.cc
compiler-rt/trunk/test/tsan/vfork.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/vfork.cc
compiler-rt/trunk/test/tsan/virtual_inheritance_compile_bug.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/virtual_inheritance_compile_bug.cc
compiler-rt/trunk/test/tsan/vptr_benign_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/vptr_benign_race.cc
compiler-rt/trunk/test/tsan/vptr_harmful_race.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/vptr_harmful_race.cc
compiler-rt/trunk/test/tsan/vptr_harmful_race2.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/vptr_harmful_race2.cc
compiler-rt/trunk/test/tsan/vptr_harmful_race3.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/vptr_harmful_race3.cc
compiler-rt/trunk/test/tsan/vptr_harmful_race4.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/vptr_harmful_race4.cc
compiler-rt/trunk/test/tsan/write_in_reader_lock.cpp
- copied, changed from r367653, compiler-rt/trunk/test/tsan/write_in_reader_lock.cc
Removed:
compiler-rt/trunk/test/tsan/Darwin/debug_external.cc
compiler-rt/trunk/test/tsan/Darwin/dlopen.cc
compiler-rt/trunk/test/tsan/Darwin/external-dups.cc
compiler-rt/trunk/test/tsan/Darwin/external-ignore-noninstrumented.cc
compiler-rt/trunk/test/tsan/Darwin/external-lib.cc
compiler-rt/trunk/test/tsan/Darwin/external-noninstrumented-module.cc
compiler-rt/trunk/test/tsan/Darwin/external-swift-debugging.cc
compiler-rt/trunk/test/tsan/Darwin/external-swift.cc
compiler-rt/trunk/test/tsan/Darwin/external.cc
compiler-rt/trunk/test/tsan/Darwin/malloc-stack-logging.cc
compiler-rt/trunk/test/tsan/Darwin/osspinlock-norace.cc
compiler-rt/trunk/test/tsan/Darwin/realloc-zero.cc
compiler-rt/trunk/test/tsan/Darwin/signals-blocked.cc
compiler-rt/trunk/test/tsan/Darwin/symbolizer-atos.cc
compiler-rt/trunk/test/tsan/Darwin/symbolizer-dladdr.cc
compiler-rt/trunk/test/tsan/Linux/check_preinit.cc
compiler-rt/trunk/test/tsan/Linux/double_race.cc
compiler-rt/trunk/test/tsan/Linux/mutex_robust.cc
compiler-rt/trunk/test/tsan/Linux/mutex_robust2.cc
compiler-rt/trunk/test/tsan/Linux/pie_no_aslr.cc
compiler-rt/trunk/test/tsan/Linux/user_fopen.cc
compiler-rt/trunk/test/tsan/Linux/user_malloc.cc
compiler-rt/trunk/test/tsan/aligned_vs_unaligned_race.cc
compiler-rt/trunk/test/tsan/annotate_happens_before.cc
compiler-rt/trunk/test/tsan/atexit.cc
compiler-rt/trunk/test/tsan/atexit2.cc
compiler-rt/trunk/test/tsan/atexit3.cc
compiler-rt/trunk/test/tsan/atomic_free.cc
compiler-rt/trunk/test/tsan/atomic_free2.cc
compiler-rt/trunk/test/tsan/atomic_free3.cc
compiler-rt/trunk/test/tsan/atomic_hle.cc
compiler-rt/trunk/test/tsan/atomic_norace.cc
compiler-rt/trunk/test/tsan/atomic_race.cc
compiler-rt/trunk/test/tsan/atomic_stack.cc
compiler-rt/trunk/test/tsan/atomic_store.cc
compiler-rt/trunk/test/tsan/barrier.cc
compiler-rt/trunk/test/tsan/bench_acquire_only.cc
compiler-rt/trunk/test/tsan/bench_acquire_release.cc
compiler-rt/trunk/test/tsan/bench_local_mutex.cc
compiler-rt/trunk/test/tsan/bench_mutex.cc
compiler-rt/trunk/test/tsan/bench_release_only.cc
compiler-rt/trunk/test/tsan/bench_rwmutex.cc
compiler-rt/trunk/test/tsan/bench_shadow_flush.cc
compiler-rt/trunk/test/tsan/bench_single_writer.cc
compiler-rt/trunk/test/tsan/bench_ten_mutexes.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/cond_destruction.cc
compiler-rt/trunk/test/tsan/cond_race.cc
compiler-rt/trunk/test/tsan/custom_mutex0.cc
compiler-rt/trunk/test/tsan/custom_mutex1.cc
compiler-rt/trunk/test/tsan/custom_mutex2.cc
compiler-rt/trunk/test/tsan/custom_mutex3.cc
compiler-rt/trunk/test/tsan/custom_mutex4.cc
compiler-rt/trunk/test/tsan/custom_mutex5.cc
compiler-rt/trunk/test/tsan/cxa_guard_acquire.cc
compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc
compiler-rt/trunk/test/tsan/debug_alloc_stack.cc
compiler-rt/trunk/test/tsan/debug_locate.cc
compiler-rt/trunk/test/tsan/debugging.cc
compiler-rt/trunk/test/tsan/deep_stack1.cc
compiler-rt/trunk/test/tsan/default_options.cc
compiler-rt/trunk/test/tsan/dl_iterate_phdr.cc
compiler-rt/trunk/test/tsan/dlclose.cc
compiler-rt/trunk/test/tsan/exceptions.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_location.cc
compiler-rt/trunk/test/tsan/fd_pipe_norace.cc
compiler-rt/trunk/test/tsan/fd_pipe_race.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/fd_stdout_race.cc
compiler-rt/trunk/test/tsan/fd_tid_recycled.cc
compiler-rt/trunk/test/tsan/fiber_asm.cc
compiler-rt/trunk/test/tsan/fiber_from_thread.cc
compiler-rt/trunk/test/tsan/fiber_longjmp.cc
compiler-rt/trunk/test/tsan/fiber_race.cc
compiler-rt/trunk/test/tsan/fiber_simple.cc
compiler-rt/trunk/test/tsan/fiber_two_threads.cc
compiler-rt/trunk/test/tsan/fork_atexit.cc
compiler-rt/trunk/test/tsan/fork_deadlock.cc
compiler-rt/trunk/test/tsan/fork_multithreaded.cc
compiler-rt/trunk/test/tsan/fork_multithreaded3.cc
compiler-rt/trunk/test/tsan/getline_nohang.cc
compiler-rt/trunk/test/tsan/global_race.cc
compiler-rt/trunk/test/tsan/global_race2.cc
compiler-rt/trunk/test/tsan/global_race3.cc
compiler-rt/trunk/test/tsan/halt_on_error.cc
compiler-rt/trunk/test/tsan/heap_race.cc
compiler-rt/trunk/test/tsan/ignore_free.cc
compiler-rt/trunk/test/tsan/ignore_lib0.cc
compiler-rt/trunk/test/tsan/ignore_lib0.cc.supp
compiler-rt/trunk/test/tsan/ignore_lib1.cc
compiler-rt/trunk/test/tsan/ignore_lib1.cc.supp
compiler-rt/trunk/test/tsan/ignore_lib2.cc
compiler-rt/trunk/test/tsan/ignore_lib2.cc.supp
compiler-rt/trunk/test/tsan/ignore_lib3.cc
compiler-rt/trunk/test/tsan/ignore_lib3.cc.supp
compiler-rt/trunk/test/tsan/ignore_lib4.cc
compiler-rt/trunk/test/tsan/ignore_lib5.cc
compiler-rt/trunk/test/tsan/ignore_lib5.cc.supp
compiler-rt/trunk/test/tsan/ignore_malloc.cc
compiler-rt/trunk/test/tsan/ignore_race.cc
compiler-rt/trunk/test/tsan/ignore_sync.cc
compiler-rt/trunk/test/tsan/ignored-interceptors-mmap.cc
compiler-rt/trunk/test/tsan/inlined_memcpy_race.cc
compiler-rt/trunk/test/tsan/inlined_memcpy_race2.cc
compiler-rt/trunk/test/tsan/java_alloc.cc
compiler-rt/trunk/test/tsan/java_finalizer.cc
compiler-rt/trunk/test/tsan/java_find.cc
compiler-rt/trunk/test/tsan/java_heap_init.cc
compiler-rt/trunk/test/tsan/java_lock.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_race.cc
compiler-rt/trunk/test/tsan/java_race_move.cc
compiler-rt/trunk/test/tsan/java_race_pc.cc
compiler-rt/trunk/test/tsan/java_rwlock.cc
compiler-rt/trunk/test/tsan/java_symbolization.cc
compiler-rt/trunk/test/tsan/java_symbolization_legacy.cc
compiler-rt/trunk/test/tsan/java_volatile.cc
compiler-rt/trunk/test/tsan/large_malloc_meta.cc
compiler-rt/trunk/test/tsan/libcxx/std_shared_ptr.cc
compiler-rt/trunk/test/tsan/libdispatch/groups-destructor.cc
compiler-rt/trunk/test/tsan/libdispatch/sync-block-copy.cc
compiler-rt/trunk/test/tsan/load_shared_lib.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/malloc_stack.cc
compiler-rt/trunk/test/tsan/map32bit.cc
compiler-rt/trunk/test/tsan/memcmp_race.cc
compiler-rt/trunk/test/tsan/memcpy_race.cc
compiler-rt/trunk/test/tsan/mmap_large.cc
compiler-rt/trunk/test/tsan/mmap_stress.cc
compiler-rt/trunk/test/tsan/mop_with_offset.cc
compiler-rt/trunk/test/tsan/mop_with_offset2.cc
compiler-rt/trunk/test/tsan/must_deadlock.cc
compiler-rt/trunk/test/tsan/mutex_annotations.cc
compiler-rt/trunk/test/tsan/mutex_bad_read_lock.cc
compiler-rt/trunk/test/tsan/mutex_bad_read_unlock.cc
compiler-rt/trunk/test/tsan/mutex_bad_unlock.cc
compiler-rt/trunk/test/tsan/mutex_destroy_locked.cc
compiler-rt/trunk/test/tsan/mutex_destroy_locked2.cc
compiler-rt/trunk/test/tsan/mutex_double_lock.cc
compiler-rt/trunk/test/tsan/mutex_lock_destroyed.cc
compiler-rt/trunk/test/tsan/mutexset1.cc
compiler-rt/trunk/test/tsan/mutexset2.cc
compiler-rt/trunk/test/tsan/mutexset3.cc
compiler-rt/trunk/test/tsan/mutexset4.cc
compiler-rt/trunk/test/tsan/mutexset5.cc
compiler-rt/trunk/test/tsan/mutexset6.cc
compiler-rt/trunk/test/tsan/mutexset7.cc
compiler-rt/trunk/test/tsan/mutexset8.cc
compiler-rt/trunk/test/tsan/pie_test.cc
compiler-rt/trunk/test/tsan/pthread_key.cc
compiler-rt/trunk/test/tsan/race_on_fputs.cc
compiler-rt/trunk/test/tsan/race_on_heap.cc
compiler-rt/trunk/test/tsan/race_on_puts.cc
compiler-rt/trunk/test/tsan/race_on_read.cc
compiler-rt/trunk/test/tsan/race_on_speculative_load.cc
compiler-rt/trunk/test/tsan/race_on_write.cc
compiler-rt/trunk/test/tsan/race_stress.cc
compiler-rt/trunk/test/tsan/race_top_suppression.cc
compiler-rt/trunk/test/tsan/race_top_suppression1.cc
compiler-rt/trunk/test/tsan/race_with_finished_thread.cc
compiler-rt/trunk/test/tsan/real_deadlock_detector_stress_test.cc
compiler-rt/trunk/test/tsan/restore_stack.cc
compiler-rt/trunk/test/tsan/signal_block.cc
compiler-rt/trunk/test/tsan/signal_cond.cc
compiler-rt/trunk/test/tsan/signal_errno.cc
compiler-rt/trunk/test/tsan/signal_longjmp.cc
compiler-rt/trunk/test/tsan/signal_malloc.cc
compiler-rt/trunk/test/tsan/signal_pause.cc
compiler-rt/trunk/test/tsan/signal_recursive.cc
compiler-rt/trunk/test/tsan/signal_reset.cc
compiler-rt/trunk/test/tsan/signal_sync.cc
compiler-rt/trunk/test/tsan/signal_sync2.cc
compiler-rt/trunk/test/tsan/signal_thread.cc
compiler-rt/trunk/test/tsan/signal_write.cc
compiler-rt/trunk/test/tsan/sigsuspend.cc
compiler-rt/trunk/test/tsan/simple_race.cc
compiler-rt/trunk/test/tsan/simple_stack2.cc
compiler-rt/trunk/test/tsan/sleep_sync.cc
compiler-rt/trunk/test/tsan/sleep_sync2.cc
compiler-rt/trunk/test/tsan/stack_race.cc
compiler-rt/trunk/test/tsan/stack_race2.cc
compiler-rt/trunk/test/tsan/stack_sync_reuse.cc
compiler-rt/trunk/test/tsan/static_init1.cc
compiler-rt/trunk/test/tsan/static_init2.cc
compiler-rt/trunk/test/tsan/static_init3.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/strerror_r.cc
compiler-rt/trunk/test/tsan/sunrpc.cc
compiler-rt/trunk/test/tsan/suppress_same_address.cc
compiler-rt/trunk/test/tsan/suppress_same_stacks.cc
compiler-rt/trunk/test/tsan/suppressions_global.cc
compiler-rt/trunk/test/tsan/suppressions_global.cc.supp
compiler-rt/trunk/test/tsan/suppressions_mutex.cc
compiler-rt/trunk/test/tsan/suppressions_mutex.cc.supp
compiler-rt/trunk/test/tsan/suppressions_race.cc
compiler-rt/trunk/test/tsan/suppressions_race.cc.supp
compiler-rt/trunk/test/tsan/suppressions_race2.cc
compiler-rt/trunk/test/tsan/suppressions_race2.cc.supp
compiler-rt/trunk/test/tsan/thread_end_with_ignore.cc
compiler-rt/trunk/test/tsan/thread_end_with_ignore2.cc
compiler-rt/trunk/test/tsan/thread_end_with_ignore3.cc
compiler-rt/trunk/test/tsan/thread_name.cc
compiler-rt/trunk/test/tsan/thread_name2.cc
compiler-rt/trunk/test/tsan/tls_race.cc
compiler-rt/trunk/test/tsan/tls_race2.cc
compiler-rt/trunk/test/tsan/tsan-vs-gvn.cc
compiler-rt/trunk/test/tsan/unaligned_norace.cc
compiler-rt/trunk/test/tsan/unaligned_race.cc
compiler-rt/trunk/test/tsan/vfork.cc
compiler-rt/trunk/test/tsan/virtual_inheritance_compile_bug.cc
compiler-rt/trunk/test/tsan/vptr_benign_race.cc
compiler-rt/trunk/test/tsan/vptr_harmful_race.cc
compiler-rt/trunk/test/tsan/vptr_harmful_race2.cc
compiler-rt/trunk/test/tsan/vptr_harmful_race3.cc
compiler-rt/trunk/test/tsan/vptr_harmful_race4.cc
compiler-rt/trunk/test/tsan/write_in_reader_lock.cc
Modified:
compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh
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=367656&r1=367655&r2=367656&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh (original)
+++ compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh Fri Aug 2 00:18:07 2019
@@ -94,7 +94,7 @@ run_lint ${TSAN_RTL_LINT_FILTER} ${TSAN_
run_lint ${TSAN_TEST_LINT_FILTER} ${TSAN_RTL}/tests/rtl/*.cpp \
${TSAN_RTL}/tests/rtl/*.h \
${TSAN_RTL}/tests/unit/*.cpp &
-run_lint ${TSAN_LIT_TEST_LINT_FILTER} ${LIT_TESTS}/tsan/*.cc &
+run_lint ${TSAN_LIT_TEST_LINT_FILTER} ${LIT_TESTS}/tsan/*.cpp &
# MSan
MSAN_RTL=${COMPILER_RT}/lib/msan
Removed: compiler-rt/trunk/test/tsan/Darwin/debug_external.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/debug_external.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Darwin/debug_external.cc (original)
+++ compiler-rt/trunk/test/tsan/Darwin/debug_external.cc (removed)
@@ -1,64 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t
-// RUN: %deflake %run %t 2>&1 | FileCheck %s
-
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "../test.h"
-
-extern "C" {
-void __tsan_on_report(void *report);
-int __tsan_get_report_loc(void *report, unsigned long idx, const char **type,
- void **addr, void **start,
- unsigned long *size, int *tid, int *fd,
- int *suppressable, void **trace,
- unsigned long trace_size);
-int __tsan_get_report_loc_object_type(void *report, unsigned long idx,
- const char **object_type);
-}
-
-void *Thread(void *arg) {
- barrier_wait(&barrier);
- *((long *)arg) = 42;
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- void *tag = __tsan_external_register_tag("MyObject");
- long *obj = (long *)malloc(sizeof(long));
- fprintf(stderr, "obj = %p\n", obj);
- // CHECK: obj = [[ADDR:0x[0-9a-f]+]]
- __tsan_external_assign_tag(obj, tag);
-
- pthread_t t;
- pthread_create(&t, 0, Thread, obj);
- *obj = 41;
- barrier_wait(&barrier);
- pthread_join(t, 0);
- fprintf(stderr, "Done.\n");
- return 0;
-}
-
-void __tsan_on_report(void *report) {
- const char *type;
- void *addr;
- void *start;
- unsigned long size;
- int tid, fd, suppressable;
- void *trace[16] = {0};
- __tsan_get_report_loc(report, 0, &type, &addr, &start, &size, &tid, &fd,
- &suppressable, trace, 16);
- fprintf(stderr, "type = %s, start = %p, size = %ld\n", type, start, size);
- // CHECK: type = heap, start = [[ADDR]], size = 8
-
- const char *object_type;
- __tsan_get_report_loc_object_type(report, 0, &object_type);
- fprintf(stderr, "object_type = %s\n", object_type);
- // CHECK: object_type = MyObject
-}
-
-// CHECK: Done.
-// CHECK: ThreadSanitizer: reported 1 warnings
Copied: compiler-rt/trunk/test/tsan/Darwin/debug_external.cpp (from r367653, compiler-rt/trunk/test/tsan/Darwin/debug_external.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/debug_external.cpp?p2=compiler-rt/trunk/test/tsan/Darwin/debug_external.cpp&p1=compiler-rt/trunk/test/tsan/Darwin/debug_external.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/Darwin/dlopen.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/dlopen.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Darwin/dlopen.cc (original)
+++ compiler-rt/trunk/test/tsan/Darwin/dlopen.cc (removed)
@@ -1,43 +0,0 @@
-// Checks that on OS X 10.11+ (where we do not re-exec anymore, because
-// interceptors work automatically), dlopen'ing a TSanified library from a
-// non-instrumented program exits with a user-friendly message.
-
-// REQUIRES: osx-autointerception
-
-// XFAIL: ios
-
-// RUN: %clangxx_tsan %s -o %t.so -shared -DSHARED_LIB
-// RUN: %clangxx_tsan -fno-sanitize=thread %s -o %t
-
-// RUN: TSAN_DYLIB_PATH=`%clangxx_tsan %s -### 2>&1 \
-// RUN: | grep "libclang_rt.tsan_osx_dynamic.dylib" \
-// RUN: | sed -e 's/.*"\(.*libclang_rt.tsan_osx_dynamic.dylib\)".*/\1/'`
-
-// Launching a non-instrumented binary that dlopen's an instrumented library should fail.
-// RUN: not %run %t %t.so 2>&1 | FileCheck %s --check-prefix=CHECK-FAIL
-// Launching a non-instrumented binary with an explicit DYLD_INSERT_LIBRARIES should work.
-// RUN: DYLD_INSERT_LIBRARIES=$TSAN_DYLIB_PATH %run %t %t.so 2>&1 | FileCheck %s
-
-#include <dlfcn.h>
-#include <pthread.h>
-#include <stdio.h>
-
-#if defined(SHARED_LIB)
-extern "C" void foo() {
- fprintf(stderr, "Hello world.\n");
-}
-#else // defined(SHARED_LIB)
-int main(int argc, char *argv[]) {
- void *handle = dlopen(argv[1], RTLD_NOW);
- fprintf(stderr, "handle = %p\n", handle);
- void (*foo)() = (void (*)())dlsym(handle, "foo");
- fprintf(stderr, "foo = %p\n", foo);
- foo();
-}
-#endif // defined(SHARED_LIB)
-
-// CHECK: Hello world.
-// CHECK-NOT: ERROR: Interceptors are not working.
-
-// CHECK-FAIL-NOT: Hello world.
-// CHECK-FAIL: ERROR: Interceptors are not working.
Copied: compiler-rt/trunk/test/tsan/Darwin/dlopen.cpp (from r367653, compiler-rt/trunk/test/tsan/Darwin/dlopen.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/dlopen.cpp?p2=compiler-rt/trunk/test/tsan/Darwin/dlopen.cpp&p1=compiler-rt/trunk/test/tsan/Darwin/dlopen.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/Darwin/external-dups.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/external-dups.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Darwin/external-dups.cc (original)
+++ compiler-rt/trunk/test/tsan/Darwin/external-dups.cc (removed)
@@ -1,58 +0,0 @@
-// RUN: %clangxx_tsan %s -o %t
-// RUN: %deflake %run %t 2>&1 | FileCheck %s
-
-#include <thread>
-
-#import "../test.h"
-
-void *tag;
-
-__attribute__((no_sanitize("thread")))
-void ExternalWrite(void *addr) {
- __tsan_external_write(addr, __builtin_return_address(0), tag);
-}
-
-int main(int argc, char *argv[]) {
- barrier_init(&barrier, 2);
- tag = __tsan_external_register_tag("HelloWorld");
- fprintf(stderr, "Start.\n");
- // CHECK: Start.
-
- for (int i = 0; i < 4; i++) {
- void *opaque_object = malloc(16);
- std::thread t1([opaque_object] {
- ExternalWrite(opaque_object);
- barrier_wait(&barrier);
- });
- std::thread t2([opaque_object] {
- barrier_wait(&barrier);
- ExternalWrite(opaque_object);
- });
- // CHECK: WARNING: ThreadSanitizer: race on HelloWorld
- t1.join();
- t2.join();
- }
-
- fprintf(stderr, "First phase done.\n");
- // CHECK: First phase done.
-
- for (int i = 0; i < 4; i++) {
- void *opaque_object = malloc(16);
- std::thread t1([opaque_object] {
- ExternalWrite(opaque_object);
- barrier_wait(&barrier);
- });
- std::thread t2([opaque_object] {
- barrier_wait(&barrier);
- ExternalWrite(opaque_object);
- });
- // CHECK: WARNING: ThreadSanitizer: race on HelloWorld
- t1.join();
- t2.join();
- }
-
- fprintf(stderr, "Second phase done.\n");
- // CHECK: Second phase done.
-}
-
-// CHECK: ThreadSanitizer: reported 2 warnings
Copied: compiler-rt/trunk/test/tsan/Darwin/external-dups.cpp (from r367653, compiler-rt/trunk/test/tsan/Darwin/external-dups.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/external-dups.cpp?p2=compiler-rt/trunk/test/tsan/Darwin/external-dups.cpp&p1=compiler-rt/trunk/test/tsan/Darwin/external-dups.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/Darwin/external-ignore-noninstrumented.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/external-ignore-noninstrumented.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Darwin/external-ignore-noninstrumented.cc (original)
+++ compiler-rt/trunk/test/tsan/Darwin/external-ignore-noninstrumented.cc (removed)
@@ -1,19 +0,0 @@
-// RUN: %clangxx_tsan -shared %p/external-lib.cc -fno-sanitize=thread -DUSE_TSAN_CALLBACKS \
-// RUN: -o %t-lib.dylib -install_name @rpath/`basename %t-lib.dylib`
-
-// RUN: %clangxx_tsan -shared %p/external-noninstrumented-module.cc %t-lib.dylib -fno-sanitize=thread \
-// RUN: -o %t-module.dylib -install_name @rpath/`basename %t-module.dylib`
-
-// RUN: %clangxx_tsan %s %t-module.dylib -o %t
-// RUN: %run %t 2>&1 | FileCheck %s
-
-#include <stdio.h>
-
-extern "C" void NonInstrumentedModule();
-int main(int argc, char *argv[]) {
- NonInstrumentedModule();
- fprintf(stderr, "Done.\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer
-// CHECK: Done.
Copied: compiler-rt/trunk/test/tsan/Darwin/external-ignore-noninstrumented.cpp (from r367653, compiler-rt/trunk/test/tsan/Darwin/external-ignore-noninstrumented.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/external-ignore-noninstrumented.cpp?p2=compiler-rt/trunk/test/tsan/Darwin/external-ignore-noninstrumented.cpp&p1=compiler-rt/trunk/test/tsan/Darwin/external-ignore-noninstrumented.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/Darwin/external-ignore-noninstrumented.cc (original)
+++ compiler-rt/trunk/test/tsan/Darwin/external-ignore-noninstrumented.cpp Fri Aug 2 00:18:07 2019
@@ -1,7 +1,7 @@
-// RUN: %clangxx_tsan -shared %p/external-lib.cc -fno-sanitize=thread -DUSE_TSAN_CALLBACKS \
+// RUN: %clangxx_tsan -shared %p/external-lib.cpp -fno-sanitize=thread -DUSE_TSAN_CALLBACKS \
// RUN: -o %t-lib.dylib -install_name @rpath/`basename %t-lib.dylib`
-// RUN: %clangxx_tsan -shared %p/external-noninstrumented-module.cc %t-lib.dylib -fno-sanitize=thread \
+// RUN: %clangxx_tsan -shared %p/external-noninstrumented-module.cpp %t-lib.dylib -fno-sanitize=thread \
// RUN: -o %t-module.dylib -install_name @rpath/`basename %t-module.dylib`
// RUN: %clangxx_tsan %s %t-module.dylib -o %t
Removed: compiler-rt/trunk/test/tsan/Darwin/external-lib.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/external-lib.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Darwin/external-lib.cc (original)
+++ compiler-rt/trunk/test/tsan/Darwin/external-lib.cc (removed)
@@ -1,68 +0,0 @@
-// This file is used from other tests.
-// RUN: true
-
-#include <dlfcn.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-struct MyObject;
-typedef MyObject *MyObjectRef;
-extern "C" {
- void InitializeLibrary();
- MyObject *ObjectCreate();
- long ObjectRead(MyObject *);
- void ObjectWrite(MyObject *, long);
- void ObjectWriteAnother(MyObject *, long);
-}
-
-struct MyObject {
- long _val;
- long _another;
-};
-
-#if defined(USE_TSAN_CALLBACKS)
-static void *tag;
-void *(*callback_register_tag)(const char *object_type);
-void *(*callback_assign_tag)(void *addr, void *tag);
-void (*callback_read)(void *addr, void *caller_pc, void *tag);
-void (*callback_write)(void *addr, void *caller_pc, void *tag);
-#endif
-
-void InitializeLibrary() {
-#if defined(USE_TSAN_CALLBACKS)
- callback_register_tag = (decltype(callback_register_tag))dlsym(RTLD_DEFAULT, "__tsan_external_register_tag");
- callback_assign_tag = (decltype(callback_assign_tag))dlsym(RTLD_DEFAULT, "__tsan_external_assign_tag");
- callback_read = (decltype(callback_read))dlsym(RTLD_DEFAULT, "__tsan_external_read");
- callback_write = (decltype(callback_write))dlsym(RTLD_DEFAULT, "__tsan_external_write");
- tag = callback_register_tag("MyLibrary::MyObject");
-#endif
-}
-
-MyObject *ObjectCreate() {
- MyObject *ref = (MyObject *)malloc(sizeof(MyObject));
-#if defined(USE_TSAN_CALLBACKS)
- callback_assign_tag(ref, tag);
-#endif
- return ref;
-}
-
-long ObjectRead(MyObject *ref) {
-#if defined(USE_TSAN_CALLBACKS)
- callback_read(ref, __builtin_return_address(0), tag);
-#endif
- return ref->_val;
-}
-
-void ObjectWrite(MyObject *ref, long val) {
-#if defined(USE_TSAN_CALLBACKS)
- callback_write(ref, __builtin_return_address(0), tag);
-#endif
- ref->_val = val;
-}
-
-void ObjectWriteAnother(MyObject *ref, long val) {
-#if defined(USE_TSAN_CALLBACKS)
- callback_write(ref, __builtin_return_address(0), tag);
-#endif
- ref->_another = val;
-}
Copied: compiler-rt/trunk/test/tsan/Darwin/external-lib.cpp (from r367653, compiler-rt/trunk/test/tsan/Darwin/external-lib.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/external-lib.cpp?p2=compiler-rt/trunk/test/tsan/Darwin/external-lib.cpp&p1=compiler-rt/trunk/test/tsan/Darwin/external-lib.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/Darwin/external-noninstrumented-module.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/external-noninstrumented-module.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Darwin/external-noninstrumented-module.cc (original)
+++ compiler-rt/trunk/test/tsan/Darwin/external-noninstrumented-module.cc (removed)
@@ -1,27 +0,0 @@
-// This file is used from other tests.
-// RUN: true
-
-#include <thread>
-
-#include <stdio.h>
-#include <stdlib.h>
-
-struct MyObject;
-typedef MyObject *MyObjectRef;
-extern "C" {
- void InitializeLibrary();
- MyObject *ObjectCreate();
- long ObjectRead(MyObject *);
- void ObjectWrite(MyObject *, long);
- void ObjectWriteAnother(MyObject *, long);
-}
-
-extern "C" void NonInstrumentedModule() {
- InitializeLibrary();
-
- MyObjectRef ref = ObjectCreate();
- std::thread t1([ref]{ ObjectWrite(ref, 42); });
- std::thread t2([ref]{ ObjectWrite(ref, 43); });
- t1.join();
- t2.join();
-}
Copied: compiler-rt/trunk/test/tsan/Darwin/external-noninstrumented-module.cpp (from r367653, compiler-rt/trunk/test/tsan/Darwin/external-noninstrumented-module.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/external-noninstrumented-module.cpp?p2=compiler-rt/trunk/test/tsan/Darwin/external-noninstrumented-module.cpp&p1=compiler-rt/trunk/test/tsan/Darwin/external-noninstrumented-module.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/Darwin/external-swift-debugging.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/external-swift-debugging.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Darwin/external-swift-debugging.cc (original)
+++ compiler-rt/trunk/test/tsan/Darwin/external-swift-debugging.cc (removed)
@@ -1,68 +0,0 @@
-// RUN: %clangxx_tsan %s -o %t
-// RUN: %deflake %run %t 2>&1 | FileCheck %s
-
-#include <thread>
-
-#import "../test.h"
-
-
-extern "C" {
-int __tsan_get_report_data(void *report, const char **description, int *count,
- int *stack_count, int *mop_count, int *loc_count,
- int *mutex_count, int *thread_count,
- int *unique_tid_count, void **sleep_trace,
- unsigned long trace_size);
-int __tsan_get_report_tag(void *report, unsigned long *tag);
-}
-
-__attribute__((no_sanitize("thread"), noinline))
-void ExternalWrite(void *addr) {
- void *kSwiftAccessRaceTag = (void *)0x1;
- __tsan_external_write(addr, nullptr, kSwiftAccessRaceTag);
-}
-
-int main(int argc, char *argv[]) {
- barrier_init(&barrier, 2);
- fprintf(stderr, "Start.\n");
- // CHECK: Start.
-
- void *opaque_object = malloc(16);
- std::thread t1([opaque_object] {
- ExternalWrite(opaque_object);
- barrier_wait(&barrier);
- });
- std::thread t2([opaque_object] {
- barrier_wait(&barrier);
- ExternalWrite(opaque_object);
- });
- // CHECK: WARNING: ThreadSanitizer: Swift access race
- // CHECK: Modifying access of Swift variable at {{.*}} by thread {{.*}}
- // CHECK: Previous modifying access of Swift variable at {{.*}} by thread {{.*}}
- // CHECK: SUMMARY: ThreadSanitizer: Swift access race
- t1.join();
- t2.join();
-
- fprintf(stderr, "Done.\n");
-}
-
-extern "C"
-void __tsan_on_report(void *report) {
- const char *description;
- int count;
- int stack_count, mop_count, loc_count, mutex_count, thread_count,
- unique_tid_count;
- void *sleep_trace[16] = {0};
- __tsan_get_report_data(report, &description, &count, &stack_count, &mop_count,
- &loc_count, &mutex_count, &thread_count,
- &unique_tid_count, sleep_trace, 16);
- fprintf(stderr, "report type = '%s', count = %d\n", description, count);
- // CHECK: report type = 'external-race', count = 0
-
- unsigned long tag;
- __tsan_get_report_tag(report, &tag);
- fprintf(stderr, "tag = %ld\n", tag);
- // CHECK: tag = 1
-}
-
-// CHECK: Done.
-// CHECK: ThreadSanitizer: reported 1 warnings
Copied: compiler-rt/trunk/test/tsan/Darwin/external-swift-debugging.cpp (from r367653, compiler-rt/trunk/test/tsan/Darwin/external-swift-debugging.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/external-swift-debugging.cpp?p2=compiler-rt/trunk/test/tsan/Darwin/external-swift-debugging.cpp&p1=compiler-rt/trunk/test/tsan/Darwin/external-swift-debugging.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/Darwin/external-swift.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/external-swift.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Darwin/external-swift.cc (original)
+++ compiler-rt/trunk/test/tsan/Darwin/external-swift.cc (removed)
@@ -1,92 +0,0 @@
-// RUN: %clangxx_tsan %s -o %t
-// RUN: %deflake %run %t 2>&1 | FileCheck %s
-
-#include <thread>
-
-#import "../test.h"
-
-extern "C" {
-void __tsan_write8(void *addr);
-}
-
-static void *tag = (void *)0x1;
-
-__attribute__((no_sanitize("thread")))
-void ExternalWrite(void *addr) {
- __tsan_external_write(addr, nullptr, tag);
-}
-
-__attribute__((no_sanitize("thread")))
-void RegularWrite(void *addr) {
- __tsan_write8(addr);
-}
-
-int main(int argc, char *argv[]) {
- barrier_init(&barrier, 2);
- fprintf(stderr, "Start.\n");
- // CHECK: Start.
-
- {
- void *opaque_object = malloc(16);
- std::thread t1([opaque_object] {
- ExternalWrite(opaque_object);
- barrier_wait(&barrier);
- });
- std::thread t2([opaque_object] {
- barrier_wait(&barrier);
- ExternalWrite(opaque_object);
- });
- // CHECK: WARNING: ThreadSanitizer: Swift access race
- // CHECK: Modifying access of Swift variable at {{.*}} by thread {{.*}}
- // CHECK: Previous modifying access of Swift variable at {{.*}} by thread {{.*}}
- // CHECK: SUMMARY: ThreadSanitizer: Swift access race
- t1.join();
- t2.join();
- }
-
- fprintf(stderr, "external+external test done.\n");
- // CHECK: external+external test done.
-
- {
- void *opaque_object = malloc(16);
- std::thread t1([opaque_object] {
- ExternalWrite(opaque_object);
- barrier_wait(&barrier);
- });
- std::thread t2([opaque_object] {
- barrier_wait(&barrier);
- RegularWrite(opaque_object);
- });
- // CHECK: WARNING: ThreadSanitizer: Swift access race
- // CHECK: Write of size 8 at {{.*}} by thread {{.*}}
- // CHECK: Previous modifying access of Swift variable at {{.*}} by thread {{.*}}
- // CHECK: SUMMARY: ThreadSanitizer: Swift access race
- t1.join();
- t2.join();
- }
-
- fprintf(stderr, "external+regular test done.\n");
- // CHECK: external+regular test done.
-
- {
- void *opaque_object = malloc(16);
- std::thread t1([opaque_object] {
- RegularWrite(opaque_object);
- barrier_wait(&barrier);
- });
- std::thread t2([opaque_object] {
- barrier_wait(&barrier);
- ExternalWrite(opaque_object);
- });
- // CHECK: WARNING: ThreadSanitizer: Swift access race
- // CHECK: Modifying access of Swift variable at {{.*}} by thread {{.*}}
- // CHECK: Previous write of size 8 at {{.*}} by thread {{.*}}
- // CHECK: SUMMARY: ThreadSanitizer: Swift access race
- t1.join();
- t2.join();
- }
-
- fprintf(stderr, "regular+external test done.\n");
- // CHECK: regular+external test done.
-}
-
Copied: compiler-rt/trunk/test/tsan/Darwin/external-swift.cpp (from r367653, compiler-rt/trunk/test/tsan/Darwin/external-swift.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/external-swift.cpp?p2=compiler-rt/trunk/test/tsan/Darwin/external-swift.cpp&p1=compiler-rt/trunk/test/tsan/Darwin/external-swift.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/Darwin/external.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/external.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Darwin/external.cc (original)
+++ compiler-rt/trunk/test/tsan/Darwin/external.cc (removed)
@@ -1,105 +0,0 @@
-// RUN: %clangxx_tsan %p/external-lib.cc -shared \
-// RUN: -o %t-lib-instrumented.dylib \
-// RUN: -install_name @rpath/`basename %t-lib-instrumented.dylib`
-
-// RUN: %clangxx_tsan %p/external-lib.cc -shared -fno-sanitize=thread \
-// RUN: -o %t-lib-noninstrumented.dylib \
-// RUN: -install_name @rpath/`basename %t-lib-noninstrumented.dylib`
-
-// RUN: %clangxx_tsan %p/external-lib.cc -shared -fno-sanitize=thread -DUSE_TSAN_CALLBACKS \
-// RUN: -o %t-lib-noninstrumented-callbacks.dylib \
-// RUN: -install_name @rpath/`basename %t-lib-noninstrumented-callbacks.dylib`
-
-// RUN: %clangxx_tsan %s %t-lib-instrumented.dylib -o %t-lib-instrumented
-// RUN: %clangxx_tsan %s %t-lib-noninstrumented.dylib -o %t-lib-noninstrumented
-// RUN: %clangxx_tsan %s %t-lib-noninstrumented-callbacks.dylib -o %t-lib-noninstrumented-callbacks
-
-// RUN: %deflake %run %t-lib-instrumented 2>&1 \
-// RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=TEST1
-// RUN: %run %t-lib-noninstrumented 2>&1 \
-// RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=TEST2
-// RUN: %deflake %run %t-lib-noninstrumented-callbacks 2>&1 \
-// RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=TEST3
-
-#include <thread>
-
-#include <stdio.h>
-#include <stdlib.h>
-
-struct MyObject;
-typedef MyObject *MyObjectRef;
-extern "C" {
- void InitializeLibrary();
- MyObject *ObjectCreate();
- long ObjectRead(MyObject *);
- void ObjectWrite(MyObject *, long);
- void ObjectWriteAnother(MyObject *, long);
-}
-
-int main(int argc, char *argv[]) {
- InitializeLibrary();
-
- {
- MyObjectRef ref = ObjectCreate();
- std::thread t1([ref]{ ObjectRead(ref); });
- std::thread t2([ref]{ ObjectRead(ref); });
- t1.join();
- t2.join();
- }
-
- // CHECK-NOT: WARNING: ThreadSanitizer
-
- fprintf(stderr, "RR test done\n");
- // CHECK: RR test done
-
- {
- MyObjectRef ref = ObjectCreate();
- std::thread t1([ref]{ ObjectRead(ref); });
- std::thread t2([ref]{ ObjectWrite(ref, 66); });
- t1.join();
- t2.join();
- }
-
- // TEST1: WARNING: ThreadSanitizer: data race
- // TEST1: {{Write|Read}} of size 8 at
- // TEST1: Previous {{write|read}} of size 8 at
- // TEST1: Location is heap block of size 16 at
-
- // TEST2-NOT: WARNING: ThreadSanitizer
-
- // TEST3: WARNING: ThreadSanitizer: race on MyLibrary::MyObject
- // TEST3: {{Modifying|read-only}} access of MyLibrary::MyObject at
- // TEST3: {{ObjectWrite|ObjectRead}}
- // TEST3: Previous {{modifying|read-only}} access of MyLibrary::MyObject at
- // TEST3: {{ObjectWrite|ObjectRead}}
- // TEST3: Location is MyLibrary::MyObject of size 16 at
- // TEST3: {{ObjectCreate}}
- // TEST3: SUMMARY: ThreadSanitizer: race on MyLibrary::MyObject {{.*}} in {{ObjectWrite|ObjectRead}}
-
- fprintf(stderr, "RW test done\n");
- // CHECK: RW test done
-
- {
- MyObjectRef ref = ObjectCreate();
- std::thread t1([ref]{ ObjectWrite(ref, 76); });
- std::thread t2([ref]{ ObjectWriteAnother(ref, 77); });
- t1.join();
- t2.join();
- }
-
- // TEST1-NOT: WARNING: ThreadSanitizer: data race
-
- // TEST2-NOT: WARNING: ThreadSanitizer
-
- // TEST3: WARNING: ThreadSanitizer: race on MyLibrary::MyObject
- // TEST3: Modifying access of MyLibrary::MyObject at
- // TEST3: {{ObjectWrite|ObjectWriteAnother}}
- // TEST3: Previous modifying access of MyLibrary::MyObject at
- // TEST3: {{ObjectWrite|ObjectWriteAnother}}
- // TEST3: Location is MyLibrary::MyObject of size 16 at
- // TEST3: {{ObjectCreate}}
- // TEST3: SUMMARY: ThreadSanitizer: race on MyLibrary::MyObject {{.*}} in {{ObjectWrite|ObjectWriteAnother}}
-
- fprintf(stderr, "WW test done\n");
- // CHECK: WW test done
-}
Copied: compiler-rt/trunk/test/tsan/Darwin/external.cpp (from r367653, compiler-rt/trunk/test/tsan/Darwin/external.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/external.cpp?p2=compiler-rt/trunk/test/tsan/Darwin/external.cpp&p1=compiler-rt/trunk/test/tsan/Darwin/external.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/Darwin/external.cc (original)
+++ compiler-rt/trunk/test/tsan/Darwin/external.cpp Fri Aug 2 00:18:07 2019
@@ -1,12 +1,12 @@
-// RUN: %clangxx_tsan %p/external-lib.cc -shared \
+// RUN: %clangxx_tsan %p/external-lib.cpp -shared \
// RUN: -o %t-lib-instrumented.dylib \
// RUN: -install_name @rpath/`basename %t-lib-instrumented.dylib`
-// RUN: %clangxx_tsan %p/external-lib.cc -shared -fno-sanitize=thread \
+// RUN: %clangxx_tsan %p/external-lib.cpp -shared -fno-sanitize=thread \
// RUN: -o %t-lib-noninstrumented.dylib \
// RUN: -install_name @rpath/`basename %t-lib-noninstrumented.dylib`
-// RUN: %clangxx_tsan %p/external-lib.cc -shared -fno-sanitize=thread -DUSE_TSAN_CALLBACKS \
+// RUN: %clangxx_tsan %p/external-lib.cpp -shared -fno-sanitize=thread -DUSE_TSAN_CALLBACKS \
// RUN: -o %t-lib-noninstrumented-callbacks.dylib \
// RUN: -install_name @rpath/`basename %t-lib-noninstrumented-callbacks.dylib`
Removed: compiler-rt/trunk/test/tsan/Darwin/malloc-stack-logging.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/malloc-stack-logging.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Darwin/malloc-stack-logging.cc (original)
+++ compiler-rt/trunk/test/tsan/Darwin/malloc-stack-logging.cc (removed)
@@ -1,24 +0,0 @@
-// Test that MallocStackLogging=1 doesn't crash. MallocStackLogging turns on
-// callbacks from mmap/munmap libc function into libmalloc. Darwin-specific
-// ThreadState initialization needs to avoid calling the library functions (and
-// use syscalls directly) to make sure other interceptors aren't called.
-
-// RUN: %clangxx_tsan -O1 %s -o %t
-// RUN: MallocStackLogging=1 %run %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-void *foo(void *p) {
- return NULL;
-}
-
-int main() {
- pthread_t t;
- pthread_create(&t, NULL, foo, NULL);
- pthread_join(t, NULL);
- fprintf(stderr, "Done.\n");
- return 0;
-}
-
-// CHECK: Done.
Copied: compiler-rt/trunk/test/tsan/Darwin/malloc-stack-logging.cpp (from r367653, compiler-rt/trunk/test/tsan/Darwin/malloc-stack-logging.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/malloc-stack-logging.cpp?p2=compiler-rt/trunk/test/tsan/Darwin/malloc-stack-logging.cpp&p1=compiler-rt/trunk/test/tsan/Darwin/malloc-stack-logging.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/Darwin/osspinlock-norace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/osspinlock-norace.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Darwin/osspinlock-norace.cc (original)
+++ compiler-rt/trunk/test/tsan/Darwin/osspinlock-norace.cc (removed)
@@ -1,34 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdint.h>
-#include <stdio.h>
-
-typedef int32_t OSSpinLock;
-extern "C" void OSSpinLockLock(OSSpinLock *);
-extern "C" void OSSpinLockUnlock(OSSpinLock *);
-
-int Global;
-OSSpinLock lock;
-
-void *Thread(void *x) {
- OSSpinLockLock(&lock);
- Global++;
- OSSpinLockUnlock(&lock);
- return NULL;
-}
-
-int main() {
- fprintf(stderr, "Hello world.\n");
-
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread, NULL);
- pthread_create(&t[1], NULL, Thread, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
-
- fprintf(stderr, "Done.\n");
-}
-
-// CHECK: Hello world.
-// CHECK: Done.
-// CHECK-NOT: WARNING: ThreadSanitizer
Copied: compiler-rt/trunk/test/tsan/Darwin/osspinlock-norace.cpp (from r367653, compiler-rt/trunk/test/tsan/Darwin/osspinlock-norace.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/osspinlock-norace.cpp?p2=compiler-rt/trunk/test/tsan/Darwin/osspinlock-norace.cpp&p1=compiler-rt/trunk/test/tsan/Darwin/osspinlock-norace.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/Darwin/realloc-zero.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/realloc-zero.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Darwin/realloc-zero.cc (original)
+++ compiler-rt/trunk/test/tsan/Darwin/realloc-zero.cc (removed)
@@ -1,20 +0,0 @@
-// Test that realloc(nullptr, 0) return a non-NULL pointer.
-
-// RUN: %clang_tsan %s -o %t
-// RUN: %run %t 2>&1 | FileCheck %s
-
-#include <malloc/malloc.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-
-int main() {
- void *p = realloc(NULL, 0);
- if (!p) {
- abort();
- }
- fprintf(stderr, "Okay.\n");
- return 0;
-}
-
-// CHECK: Okay.
Copied: compiler-rt/trunk/test/tsan/Darwin/realloc-zero.cpp (from r367653, compiler-rt/trunk/test/tsan/Darwin/realloc-zero.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/realloc-zero.cpp?p2=compiler-rt/trunk/test/tsan/Darwin/realloc-zero.cpp&p1=compiler-rt/trunk/test/tsan/Darwin/realloc-zero.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/Darwin/signals-blocked.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/signals-blocked.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Darwin/signals-blocked.cc (original)
+++ compiler-rt/trunk/test/tsan/Darwin/signals-blocked.cc (removed)
@@ -1,75 +0,0 @@
-// RUN: %clangxx_tsan %s -o %t && %run %t 2>&1 | FileCheck %s
-
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <errno.h>
-
-volatile bool signal_delivered;
-
-static void handler(int sig) {
- if (sig == SIGALRM)
- signal_delivered = true;
-}
-
-static void* thr(void *p) {
- sigset_t sigset;
- sigemptyset(&sigset);
- sigaddset(&sigset, SIGALRM);
- int ret = pthread_sigmask(SIG_UNBLOCK, &sigset, NULL);
- if (ret) abort();
-
- struct sigaction act = {};
- act.sa_handler = &handler;
- if (sigaction(SIGALRM, &act, 0)) {
- perror("sigaction");
- exit(1);
- }
-
- itimerval t;
- t.it_value.tv_sec = 0;
- t.it_value.tv_usec = 10000;
- t.it_interval = t.it_value;
- if (setitimer(ITIMER_REAL, &t, 0)) {
- perror("setitimer");
- exit(1);
- }
-
- while (!signal_delivered) {
- usleep(1000);
- }
-
- t.it_value.tv_usec = 0;
- if (setitimer(ITIMER_REAL, &t, 0)) {
- perror("setitimer");
- exit(1);
- }
-
- fprintf(stderr, "SIGNAL DELIVERED\n");
-
- return 0;
-}
-
-int main() {
- sigset_t sigset;
- sigemptyset(&sigset);
- sigaddset(&sigset, SIGALRM);
- int ret = pthread_sigmask(SIG_BLOCK, &sigset, NULL);
- if (ret) abort();
-
- pthread_t th;
- pthread_create(&th, 0, thr, 0);
- pthread_join(th, 0);
-
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer:
-// CHECK: SIGNAL DELIVERED
-// CHECK: DONE
-// CHECK-NOT: WARNING: ThreadSanitizer:
Copied: compiler-rt/trunk/test/tsan/Darwin/signals-blocked.cpp (from r367653, compiler-rt/trunk/test/tsan/Darwin/signals-blocked.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/signals-blocked.cpp?p2=compiler-rt/trunk/test/tsan/Darwin/signals-blocked.cpp&p1=compiler-rt/trunk/test/tsan/Darwin/signals-blocked.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/Darwin/symbolizer-atos.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/symbolizer-atos.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Darwin/symbolizer-atos.cc (original)
+++ compiler-rt/trunk/test/tsan/Darwin/symbolizer-atos.cc (removed)
@@ -1,26 +0,0 @@
-// RUN: %clangxx_tsan %s -o %t
-// RUN: %env_tsan_opts=verbosity=2:external_symbolizer_path=/usr/bin/atos %deflake %run %t | FileCheck %s
-#include "../test.h"
-
-int GlobalData[10];
-
-void *Thread(void *a) {
- barrier_wait(&barrier);
- GlobalData[2] = 42;
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- print_address("addr=", 1, GlobalData);
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- GlobalData[2] = 43;
- barrier_wait(&barrier);
- pthread_join(t, 0);
-}
-
-// CHECK: Using atos at user-specified path: /usr/bin/atos
-// CHECK: addr=[[ADDR:0x[0-9,a-f]+]]
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Location is global 'GlobalData' at [[ADDR]] ({{.*}}+0x{{[0-9,a-f]+}})
Copied: compiler-rt/trunk/test/tsan/Darwin/symbolizer-atos.cpp (from r367653, compiler-rt/trunk/test/tsan/Darwin/symbolizer-atos.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/symbolizer-atos.cpp?p2=compiler-rt/trunk/test/tsan/Darwin/symbolizer-atos.cpp&p1=compiler-rt/trunk/test/tsan/Darwin/symbolizer-atos.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/Darwin/symbolizer-dladdr.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/symbolizer-dladdr.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Darwin/symbolizer-dladdr.cc (original)
+++ compiler-rt/trunk/test/tsan/Darwin/symbolizer-dladdr.cc (removed)
@@ -1,27 +0,0 @@
-// RUN: %clangxx_tsan %s -o %t
-// RUN: %env_tsan_opts=verbosity=2:external_symbolizer_path= %deflake %run %t | FileCheck %s
-#include "../test.h"
-
-int GlobalData[10];
-
-void *Thread(void *a) {
- barrier_wait(&barrier);
- GlobalData[2] = 42;
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- print_address("addr=", 1, GlobalData);
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- GlobalData[2] = 43;
- barrier_wait(&barrier);
- pthread_join(t, 0);
-}
-
-// CHECK: External symbolizer is explicitly disabled.
-// CHECK: Using dladdr symbolizer.
-// CHECK: addr=[[ADDR:0x[0-9,a-f]+]]
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Location is global 'GlobalData' at [[ADDR]] ({{.*}}+0x{{[0-9,a-f]+}})
Copied: compiler-rt/trunk/test/tsan/Darwin/symbolizer-dladdr.cpp (from r367653, compiler-rt/trunk/test/tsan/Darwin/symbolizer-dladdr.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/symbolizer-dladdr.cpp?p2=compiler-rt/trunk/test/tsan/Darwin/symbolizer-dladdr.cpp&p1=compiler-rt/trunk/test/tsan/Darwin/symbolizer-dladdr.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/Linux/check_preinit.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Linux/check_preinit.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Linux/check_preinit.cc (original)
+++ compiler-rt/trunk/test/tsan/Linux/check_preinit.cc (removed)
@@ -1,60 +0,0 @@
-// RUN: %clang_tsan -fno-sanitize=thread -shared -fPIC -O1 -DBUILD_SO=1 %s -o \
-// RUN: %t.so && \
-// RUN: %clang_tsan -O1 %s %t.so -o %t && %run %t 2>&1 | FileCheck %s
-// RUN: llvm-objdump -t %t | FileCheck %s --check-prefix=CHECK-DUMP
-// CHECK-DUMP: {{[.]preinit_array.*__local_tsan_preinit}}
-
-// SANITIZER_CAN_USE_PREINIT_ARRAY is undefined on android.
-// UNSUPPORTED: android
-
-// Test checks if __tsan_init is called from .preinit_array.
-// Without initialization from .preinit_array, __tsan_init will be called from
-// constructors of the binary which are called after constructors of shared
-// library.
-
-#include <stdio.h>
-
-#if BUILD_SO
-
-// "volatile" is needed to avoid compiler optimize-out constructors.
-volatile int counter = 0;
-volatile int lib_constructor_call = 0;
-volatile int tsan_init_call = 0;
-
-__attribute__ ((constructor))
-void LibConstructor() {
- lib_constructor_call = ++counter;
-};
-
-#else // BUILD_SO
-
-extern int counter;
-extern int lib_constructor_call;
-extern int tsan_init_call;
-
-volatile int bin_constructor_call = 0;
-
-__attribute__ ((constructor))
-void BinConstructor() {
- bin_constructor_call = ++counter;
-};
-
-namespace __tsan {
-
-void OnInitialize() {
- tsan_init_call = ++counter;
-}
-
-}
-
-int main() {
- // CHECK: TSAN_INIT 1
- // CHECK: LIB_CONSTRUCTOR 2
- // CHECK: BIN_CONSTRUCTOR 3
- printf("TSAN_INIT %d\n", tsan_init_call);
- printf("LIB_CONSTRUCTOR %d\n", lib_constructor_call);
- printf("BIN_CONSTRUCTOR %d\n", bin_constructor_call);
- return 0;
-}
-
-#endif // BUILD_SO
Copied: compiler-rt/trunk/test/tsan/Linux/check_preinit.cpp (from r367653, compiler-rt/trunk/test/tsan/Linux/check_preinit.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Linux/check_preinit.cpp?p2=compiler-rt/trunk/test/tsan/Linux/check_preinit.cpp&p1=compiler-rt/trunk/test/tsan/Linux/check_preinit.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/Linux/double_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Linux/double_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Linux/double_race.cc (original)
+++ compiler-rt/trunk/test/tsan/Linux/double_race.cc (removed)
@@ -1,52 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
-#include "../test.h"
-#include <memory.h>
-
-// A reproducer for a known issue.
-// See reference to double_race.cc in tsan_rtl_report.cpp for an explanation.
-
-char buf[16];
-volatile int nreport;
-
-void __sanitizer_report_error_summary(const char *summary) {
- nreport++;
-}
-
-const int kEventPCBits = 61;
-
-extern "C" bool __tsan_symbolize_external(unsigned long pc, char *func_buf,
- unsigned long func_siz,
- char *file_buf,
- unsigned long file_siz, int *line,
- int *col) {
- if (pc >> kEventPCBits) {
- printf("bad PC passed to __tsan_symbolize_external: %lx\n", pc);
- _exit(1);
- }
- return true;
-}
-
-void *Thread(void *arg) {
- barrier_wait(&barrier);
- memset(buf, 2, sizeof(buf));
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- memset(buf, 1, sizeof(buf));
- barrier_wait(&barrier);
- pthread_join(t, 0);
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Write of size 8 at {{.*}} by thread T1:
-// CHECK: #0 memset
-// CHECK: #1 Thread
-// CHECK-NOT: bad PC passed to __tsan_symbolize_external
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Write of size 8 at {{.*}} by thread T1:
-// CHECK: #0 Thread
Copied: compiler-rt/trunk/test/tsan/Linux/double_race.cpp (from r367653, compiler-rt/trunk/test/tsan/Linux/double_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Linux/double_race.cpp?p2=compiler-rt/trunk/test/tsan/Linux/double_race.cpp&p1=compiler-rt/trunk/test/tsan/Linux/double_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/Linux/double_race.cc (original)
+++ compiler-rt/trunk/test/tsan/Linux/double_race.cpp Fri Aug 2 00:18:07 2019
@@ -3,7 +3,7 @@
#include <memory.h>
// A reproducer for a known issue.
-// See reference to double_race.cc in tsan_rtl_report.cpp for an explanation.
+// See reference to double_race.cpp in tsan_rtl_report.cpp for an explanation.
char buf[16];
volatile int nreport;
Removed: compiler-rt/trunk/test/tsan/Linux/mutex_robust.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Linux/mutex_robust.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Linux/mutex_robust.cc (original)
+++ compiler-rt/trunk/test/tsan/Linux/mutex_robust.cc (removed)
@@ -1,36 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <errno.h>
-
-pthread_mutex_t m;
-
-void *thr(void *p) {
- pthread_mutex_lock(&m);
- return 0;
-}
-
-int main() {
- pthread_mutexattr_t a;
- pthread_mutexattr_init(&a);
- pthread_mutexattr_setrobust(&a, PTHREAD_MUTEX_ROBUST);
- pthread_mutex_init(&m, &a);
- pthread_t th;
- pthread_create(&th, 0, thr, 0);
- sleep(1);
- if (pthread_mutex_lock(&m) != EOWNERDEAD) {
- fprintf(stderr, "not EOWNERDEAD\n");
- exit(1);
- }
- pthread_join(th, 0);
- fprintf(stderr, "DONE\n");
-}
-
-// This is a correct code, and tsan must not bark.
-// CHECK-NOT: WARNING: ThreadSanitizer
-// CHECK-NOT: EOWNERDEAD
-// CHECK: DONE
-// CHECK-NOT: WARNING: ThreadSanitizer
-
Copied: compiler-rt/trunk/test/tsan/Linux/mutex_robust.cpp (from r367653, compiler-rt/trunk/test/tsan/Linux/mutex_robust.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Linux/mutex_robust.cpp?p2=compiler-rt/trunk/test/tsan/Linux/mutex_robust.cpp&p1=compiler-rt/trunk/test/tsan/Linux/mutex_robust.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/Linux/mutex_robust2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Linux/mutex_robust2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Linux/mutex_robust2.cc (original)
+++ compiler-rt/trunk/test/tsan/Linux/mutex_robust2.cc (removed)
@@ -1,41 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include <pthread.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <errno.h>
-
-pthread_mutex_t m;
-int x;
-
-void *thr(void *p) {
- pthread_mutex_lock(&m);
- x = 42;
- return 0;
-}
-
-int main() {
- pthread_mutexattr_t a;
- pthread_mutexattr_init(&a);
- pthread_mutexattr_setrobust(&a, PTHREAD_MUTEX_ROBUST);
- pthread_mutex_init(&m, &a);
- pthread_t th;
- pthread_create(&th, 0, thr, 0);
- sleep(1);
- if (pthread_mutex_trylock(&m) != EOWNERDEAD) {
- fprintf(stderr, "not EOWNERDEAD\n");
- exit(1);
- }
- x = 43;
- pthread_join(th, 0);
- fprintf(stderr, "DONE\n");
-}
-
-// This is a false positive, tsan must not bark at the data race.
-// But currently it does.
-// CHECK-NOT: WARNING: ThreadSanitizer WARNING: double lock of mutex
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK-NOT: EOWNERDEAD
-// CHECK: DONE
-// CHECK-NOT: WARNING: ThreadSanitizer
-
Copied: compiler-rt/trunk/test/tsan/Linux/mutex_robust2.cpp (from r367653, compiler-rt/trunk/test/tsan/Linux/mutex_robust2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Linux/mutex_robust2.cpp?p2=compiler-rt/trunk/test/tsan/Linux/mutex_robust2.cpp&p1=compiler-rt/trunk/test/tsan/Linux/mutex_robust2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/Linux/pie_no_aslr.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Linux/pie_no_aslr.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Linux/pie_no_aslr.cc (original)
+++ compiler-rt/trunk/test/tsan/Linux/pie_no_aslr.cc (removed)
@@ -1,6 +0,0 @@
-// RUN: %clang_tsan %s -pie -fPIE -o %t && %run setarch x86_64 -R %t
-// REQUIRES: x86_64-target-arch
-
-int main() {
- return 0;
-}
Copied: compiler-rt/trunk/test/tsan/Linux/pie_no_aslr.cpp (from r367653, compiler-rt/trunk/test/tsan/Linux/pie_no_aslr.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Linux/pie_no_aslr.cpp?p2=compiler-rt/trunk/test/tsan/Linux/pie_no_aslr.cpp&p1=compiler-rt/trunk/test/tsan/Linux/pie_no_aslr.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/Linux/user_fopen.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Linux/user_fopen.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Linux/user_fopen.cc (original)
+++ compiler-rt/trunk/test/tsan/Linux/user_fopen.cc (removed)
@@ -1,34 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <stdio.h>
-#include <stdlib.h>
-
-// Defined by tsan.
-extern "C" FILE *__interceptor_fopen(const char *file, const char *mode);
-extern "C" int __interceptor_fileno(FILE *f);
-
-extern "C" FILE *fopen(const char *file, const char *mode) {
- static int first = 0;
- if (__sync_lock_test_and_set(&first, 1) == 0)
- printf("user fopen\n");
- return __interceptor_fopen(file, mode);
-}
-
-extern "C" int fileno(FILE *f) {
- static int first = 0;
- if (__sync_lock_test_and_set(&first, 1) == 0)
- printf("user fileno\n");
- return 1;
-}
-
-int main() {
- FILE *f = fopen("/dev/zero", "r");
- if (f) {
- char buf;
- fread(&buf, 1, 1, f);
- fclose(f);
- }
-}
-
-// CHECK: user fopen
-// CHECK-NOT: ThreadSanitizer
-
Copied: compiler-rt/trunk/test/tsan/Linux/user_fopen.cpp (from r367653, compiler-rt/trunk/test/tsan/Linux/user_fopen.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Linux/user_fopen.cpp?p2=compiler-rt/trunk/test/tsan/Linux/user_fopen.cpp&p1=compiler-rt/trunk/test/tsan/Linux/user_fopen.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/Linux/user_malloc.cc (original)
+++ compiler-rt/trunk/test/tsan/Linux/user_malloc.cc (removed)
@@ -1,35 +0,0 @@
-// RUN: %clangxx_tsan -c -O1 -fno-sanitize=thread %s -o %t.o
-// RUN: %clangxx_tsan -O1 %s %t.o -o %t && %run %t 2>&1 | FileCheck %s
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#if !__has_feature(thread_sanitizer)
-
-// Defined by tsan.
-extern "C" void *__interceptor_malloc(unsigned long size);
-extern "C" void __interceptor_free(void *p);
-extern "C" void *malloc(unsigned long size) {
- static int first = 0;
- if (__sync_lock_test_and_set(&first, 1) == 0)
- fprintf(stderr, "user malloc\n");
- return __interceptor_malloc(size);
-}
-
-extern "C" void free(void *p) {
- __interceptor_free(p);
-}
-
-#else
-
-int main() {
- volatile char *p = (char*)malloc(10);
- p[0] = 0;
- free((void*)p);
-}
-
-#endif
-
-// CHECK: user malloc
-// CHECK-NOT: ThreadSanitizer
-
Copied: compiler-rt/trunk/test/tsan/Linux/user_malloc.cpp (from r367653, compiler-rt/trunk/test/tsan/Linux/user_malloc.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Linux/user_malloc.cpp?p2=compiler-rt/trunk/test/tsan/Linux/user_malloc.cpp&p1=compiler-rt/trunk/test/tsan/Linux/user_malloc.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/aligned_vs_unaligned_race.cc (original)
+++ compiler-rt/trunk/test/tsan/aligned_vs_unaligned_race.cc (removed)
@@ -1,35 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
-// Race between an aligned access and an unaligned access, which
-// touches the same memory region.
-#include "test.h"
-#include <stdint.h>
-
-uint64_t Global[2];
-
-void *Thread1(void *x) {
- Global[1]++;
- barrier_wait(&barrier);
- return NULL;
-}
-
-void *Thread2(void *x) {
- barrier_wait(&barrier);
- char *p1 = reinterpret_cast<char *>(&Global[0]);
- struct __attribute__((packed, aligned(1))) u_uint64_t { uint64_t val; };
- u_uint64_t *p4 = reinterpret_cast<u_uint64_t *>(p1 + 1);
- (*p4).val++;
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- fprintf(stderr, "Pass\n");
- // CHECK: ThreadSanitizer: data race
- // CHECK: Pass
- return 0;
-}
Copied: compiler-rt/trunk/test/tsan/aligned_vs_unaligned_race.cpp (from r367653, 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.cpp?p2=compiler-rt/trunk/test/tsan/aligned_vs_unaligned_race.cpp&p1=compiler-rt/trunk/test/tsan/aligned_vs_unaligned_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/annotate_happens_before.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/annotate_happens_before.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/annotate_happens_before.cc (original)
+++ compiler-rt/trunk/test/tsan/annotate_happens_before.cc (removed)
@@ -1,57 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "test.h"
-
-/*
-Annotations usage example.
-
-Tsan does not see synchronization in barrier_wait.
-ANNOTATE_HAPPENS_BEFORE/AFTER communicate the synchronization to tsan
-and prevent the race report.
-
-If the compiler does not support __has_feature macro, then you can build with
-CFLAGS="-fsanitize=thread -DTHREAD_SANITIZER" and then use
-#ifdef THREAD_SANITIZER to enabled annotations.
-*/
-
-#if defined(__has_feature) && __has_feature(thread_sanitizer)
-# define ANNOTATE_HAPPENS_BEFORE(addr) \
- AnnotateHappensBefore(__FILE__, __LINE__, (void*)(addr))
-# define ANNOTATE_HAPPENS_AFTER(addr) \
- AnnotateHappensAfter(__FILE__, __LINE__, (void*)(addr))
-extern "C" void AnnotateHappensBefore(const char *f, int l, void *addr);
-extern "C" void AnnotateHappensAfter(const char *f, int l, void *addr);
-#else
-# define ANNOTATE_HAPPENS_BEFORE(addr)
-# define ANNOTATE_HAPPENS_AFTER(addr)
-#endif
-
-int Global;
-
-void *Thread1(void *x) {
- barrier_wait(&barrier);
- ANNOTATE_HAPPENS_AFTER(&barrier);
- Global++;
- return NULL;
-}
-
-void *Thread2(void *x) {
- Global--;
- ANNOTATE_HAPPENS_BEFORE(&barrier);
- barrier_wait(&barrier);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK: DONE
-
Copied: compiler-rt/trunk/test/tsan/annotate_happens_before.cpp (from r367653, compiler-rt/trunk/test/tsan/annotate_happens_before.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/annotate_happens_before.cpp?p2=compiler-rt/trunk/test/tsan/annotate_happens_before.cpp&p1=compiler-rt/trunk/test/tsan/annotate_happens_before.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/atexit.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atexit.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/atexit.cc (original)
+++ compiler-rt/trunk/test/tsan/atexit.cc (removed)
@@ -1,29 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-
-#include <stdio.h>
-#include <stdlib.h>
-
-class Logger {
- public:
- Logger() {
- fprintf(stderr, "Logger ctor\n");
- }
-
- ~Logger() {
- fprintf(stderr, "Logger dtor\n");
- }
-};
-
-Logger logger;
-
-void log_from_atexit() {
- fprintf(stderr, "In log_from_atexit\n");
-}
-
-int main() {
- atexit(log_from_atexit);
-}
-
-// CHECK: Logger ctor
-// CHECK: In log_from_atexit
-// CHECK: Logger dtor
Copied: compiler-rt/trunk/test/tsan/atexit.cpp (from r367653, compiler-rt/trunk/test/tsan/atexit.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atexit.cpp?p2=compiler-rt/trunk/test/tsan/atexit.cpp&p1=compiler-rt/trunk/test/tsan/atexit.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/atexit2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atexit2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/atexit2.cc (original)
+++ compiler-rt/trunk/test/tsan/atexit2.cc (removed)
@@ -1,26 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-
-#include <stdio.h>
-#include <stdlib.h>
-
-int n;
-const int N = 10000;
-
-static void atexit1() {
- n++;
-}
-
-static void atexit0() {
- fprintf(stderr, "run count: %d\n", n);
-}
-
-int main() {
- atexit(atexit0);
- for (int i = 0; i < N; i++)
- atexit(atexit1);
-}
-
-// CHECK-NOT: FATAL: ThreadSanitizer
-// CHECK-NOT: WARNING: ThreadSanitizer
-// CHECK: run count: 10000
-
Copied: compiler-rt/trunk/test/tsan/atexit2.cpp (from r367653, compiler-rt/trunk/test/tsan/atexit2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atexit2.cpp?p2=compiler-rt/trunk/test/tsan/atexit2.cpp&p1=compiler-rt/trunk/test/tsan/atexit2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/atexit3.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atexit3.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/atexit3.cc (original)
+++ compiler-rt/trunk/test/tsan/atexit3.cc (removed)
@@ -1,41 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-
-#include <stdio.h>
-#include <stdlib.h>
-
-static void atexit5() {
- fprintf(stderr, "5");
-}
-
-static void atexit4() {
- fprintf(stderr, "4");
-}
-
-static void atexit3() {
- fprintf(stderr, "3");
-}
-
-static void atexit2() {
- fprintf(stderr, "2");
-}
-
-static void atexit1() {
- fprintf(stderr, "1");
-}
-
-static void atexit0() {
- fprintf(stderr, "\n");
-}
-
-int main() {
- atexit(atexit0);
- atexit(atexit1);
- atexit(atexit2);
- atexit(atexit3);
- atexit(atexit4);
- atexit(atexit5);
-}
-
-// CHECK-NOT: FATAL: ThreadSanitizer
-// CHECK-NOT: WARNING: ThreadSanitizer
-// CHECK: 54321
Copied: compiler-rt/trunk/test/tsan/atexit3.cpp (from r367653, compiler-rt/trunk/test/tsan/atexit3.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atexit3.cpp?p2=compiler-rt/trunk/test/tsan/atexit3.cpp&p1=compiler-rt/trunk/test/tsan/atexit3.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/atomic_free.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atomic_free.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/atomic_free.cc (original)
+++ compiler-rt/trunk/test/tsan/atomic_free.cc (removed)
@@ -1,31 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
-
-// Also check that atomics instrumentation can be configured by either driver or
-// legacy flags:
-
-// RUN: %clangxx_tsan -O1 %s -o %t -fno-sanitize-thread-atomics && not %deflake %run %t 2>&1 \
-// RUN: | FileCheck --allow-empty --check-prefix=CHECK-NO-ATOMICS %s
-// RUN: %clangxx_tsan -O1 %s -o %t -mllvm -tsan-instrument-atomics=0 && not %deflake %run %t 2>&1 \
-// RUN: | FileCheck --allow-empty --check-prefix=CHECK-NO-ATOMICS %s <%t
-
-#include "test.h"
-
-void *Thread(void *a) {
- __atomic_fetch_add((int*)a, 1, __ATOMIC_SEQ_CST);
- barrier_wait(&barrier);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- int *a = new int(0);
- pthread_t t;
- pthread_create(&t, 0, Thread, a);
- barrier_wait(&barrier);
- delete a;
- pthread_join(t, 0);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-
-// CHECK-NO-ATOMICS-NOT: WARNING: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/atomic_free.cpp (from r367653, compiler-rt/trunk/test/tsan/atomic_free.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atomic_free.cpp?p2=compiler-rt/trunk/test/tsan/atomic_free.cpp&p1=compiler-rt/trunk/test/tsan/atomic_free.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/atomic_free2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atomic_free2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/atomic_free2.cc (original)
+++ compiler-rt/trunk/test/tsan/atomic_free2.cc (removed)
@@ -1,20 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-void *Thread(void *a) {
- barrier_wait(&barrier);
- __atomic_fetch_add((int*)a, 1, __ATOMIC_SEQ_CST);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- int *a = new int(0);
- pthread_t t;
- pthread_create(&t, 0, Thread, a);
- delete a;
- barrier_wait(&barrier);
- pthread_join(t, 0);
-}
-
-// CHECK: WARNING: ThreadSanitizer: heap-use-after-free
Copied: compiler-rt/trunk/test/tsan/atomic_free2.cpp (from r367653, compiler-rt/trunk/test/tsan/atomic_free2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atomic_free2.cpp?p2=compiler-rt/trunk/test/tsan/atomic_free2.cpp&p1=compiler-rt/trunk/test/tsan/atomic_free2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/atomic_free3.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atomic_free3.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/atomic_free3.cc (original)
+++ compiler-rt/trunk/test/tsan/atomic_free3.cc (removed)
@@ -1,28 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-// Test for https://github.com/google/sanitizers/issues/602
-
-void *Thread(void *a) {
- __atomic_store_n((int*)a, 1, __ATOMIC_RELAXED);
- return 0;
-}
-
-int main() {
- int *a = new int(0);
- pthread_t t;
- pthread_create(&t, 0, Thread, a);
- while (__atomic_load_n(a, __ATOMIC_RELAXED) == 0)
- sched_yield();
- delete a;
- pthread_join(t, 0);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Write
-// CHECK: #0 operator delete
-// CHECK: #1 main
-
-// CHECK: Previous atomic write
-// CHECK: #0 __tsan_atomic32_store
-// CHECK: #1 Thread
Copied: compiler-rt/trunk/test/tsan/atomic_free3.cpp (from r367653, compiler-rt/trunk/test/tsan/atomic_free3.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atomic_free3.cpp?p2=compiler-rt/trunk/test/tsan/atomic_free3.cpp&p1=compiler-rt/trunk/test/tsan/atomic_free3.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/atomic_hle.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atomic_hle.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/atomic_hle.cc (original)
+++ compiler-rt/trunk/test/tsan/atomic_hle.cc (removed)
@@ -1,25 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "test.h"
-#include <sanitizer/tsan_interface_atomic.h>
-
-#ifndef __ATOMIC_HLE_ACQUIRE
-#define __ATOMIC_HLE_ACQUIRE (1 << 16)
-#endif
-#ifndef __ATOMIC_HLE_RELEASE
-#define __ATOMIC_HLE_RELEASE (1 << 17)
-#endif
-
-int main() {
- volatile int x = 0;
- //__atomic_fetch_add(&x, 1, __ATOMIC_ACQUIRE | __ATOMIC_HLE_ACQUIRE);
- //__atomic_store_n(&x, 0, __ATOMIC_RELEASE | __ATOMIC_HLE_RELEASE);
- __tsan_atomic32_fetch_add(&x, 1,
- (__tsan_memory_order)(__ATOMIC_ACQUIRE | __ATOMIC_HLE_ACQUIRE));
- __tsan_atomic32_store(&x, 0,
- (__tsan_memory_order)(__ATOMIC_RELEASE | __ATOMIC_HLE_RELEASE));
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK: DONE
-
Copied: compiler-rt/trunk/test/tsan/atomic_hle.cpp (from r367653, compiler-rt/trunk/test/tsan/atomic_hle.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atomic_hle.cpp?p2=compiler-rt/trunk/test/tsan/atomic_hle.cpp&p1=compiler-rt/trunk/test/tsan/atomic_hle.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/atomic_norace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atomic_norace.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/atomic_norace.cc (original)
+++ compiler-rt/trunk/test/tsan/atomic_norace.cc (removed)
@@ -1,62 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "test.h"
-
-const int kTestCount = 4;
-typedef long long T;
-T atomics[kTestCount * 2];
-
-void Test(int test, T *p, bool main_thread) {
- volatile T sink;
- if (test == 0) {
- if (main_thread)
- __atomic_fetch_add(p, 1, __ATOMIC_RELAXED);
- else
- __atomic_fetch_add(p, 1, __ATOMIC_RELAXED);
- } else if (test == 1) {
- if (main_thread)
- __atomic_exchange_n(p, 1, __ATOMIC_ACQ_REL);
- else
- __atomic_exchange_n(p, 1, __ATOMIC_ACQ_REL);
- } else if (test == 2) {
- if (main_thread)
- sink = __atomic_load_n(p, __ATOMIC_SEQ_CST);
- else
- __atomic_store_n(p, 1, __ATOMIC_SEQ_CST);
- } else if (test == 3) {
- if (main_thread)
- sink = __atomic_load_n(p, __ATOMIC_SEQ_CST);
- else
- sink = *p;
- }
-}
-
-void *Thread(void *p) {
- for (int i = 0; i < kTestCount; i++) {
- Test(i, &atomics[i], false);
- }
- barrier_wait(&barrier);
- barrier_wait(&barrier);
- for (int i = 0; i < kTestCount; i++) {
- fprintf(stderr, "Test %d reverse\n", i);
- Test(i, &atomics[kTestCount + i], false);
- }
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- barrier_wait(&barrier);
- for (int i = 0; i < kTestCount; i++) {
- fprintf(stderr, "Test %d\n", i);
- Test(i, &atomics[i], true);
- }
- for (int i = 0; i < kTestCount; i++) {
- Test(i, &atomics[kTestCount + i], true);
- }
- barrier_wait(&barrier);
- pthread_join(t, 0);
-}
-
-// CHECK-NOT: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/atomic_norace.cpp (from r367653, compiler-rt/trunk/test/tsan/atomic_norace.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atomic_norace.cpp?p2=compiler-rt/trunk/test/tsan/atomic_norace.cpp&p1=compiler-rt/trunk/test/tsan/atomic_norace.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/atomic_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atomic_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/atomic_race.cc (original)
+++ compiler-rt/trunk/test/tsan/atomic_race.cc (removed)
@@ -1,81 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-const int kTestCount = 4;
-typedef long long T;
-T atomics[kTestCount * 2];
-
-void Test(int test, T *p, bool main_thread) {
- volatile T sink;
- if (test == 0) {
- if (main_thread)
- __atomic_fetch_add(p, 1, __ATOMIC_RELAXED);
- else
- *p = 42;
- } else if (test == 1) {
- if (main_thread)
- __atomic_fetch_add(p, 1, __ATOMIC_RELAXED);
- else
- sink = *p;
- } else if (test == 2) {
- if (main_thread)
- sink = __atomic_load_n(p, __ATOMIC_SEQ_CST);
- else
- *p = 42;
- } else if (test == 3) {
- if (main_thread)
- __atomic_store_n(p, 1, __ATOMIC_SEQ_CST);
- else
- sink = *p;
- }
-}
-
-void *Thread(void *p) {
- for (int i = 0; i < kTestCount; i++) {
- Test(i, &atomics[i], false);
- }
- barrier_wait(&barrier);
- barrier_wait(&barrier);
- for (int i = 0; i < kTestCount; i++) {
- fprintf(stderr, "Test %d reverse\n", i);
- Test(i, &atomics[kTestCount + i], false);
- }
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- barrier_wait(&barrier);
- for (int i = 0; i < kTestCount; i++) {
- fprintf(stderr, "Test %d\n", i);
- Test(i, &atomics[i], true);
- }
- for (int i = 0; i < kTestCount; i++) {
- Test(i, &atomics[kTestCount + i], true);
- }
- barrier_wait(&barrier);
- pthread_join(t, 0);
-}
-
-// CHECK: Test 0
-// CHECK: ThreadSanitizer: data race
-// CHECK-NOT: SUMMARY{{.*}}tsan_interface_atomic
-// CHECK: Test 1
-// CHECK: ThreadSanitizer: data race
-// CHECK-NOT: SUMMARY{{.*}}tsan_interface_atomic
-// CHECK: Test 2
-// CHECK: ThreadSanitizer: data race
-// CHECK-NOT: SUMMARY{{.*}}tsan_interface_atomic
-// CHECK: Test 3
-// CHECK: ThreadSanitizer: data race
-// CHECK-NOT: SUMMARY{{.*}}tsan_interface_atomic
-// CHECK: Test 0 reverse
-// CHECK: ThreadSanitizer: data race
-// CHECK: Test 1 reverse
-// CHECK: ThreadSanitizer: data race
-// CHECK: Test 2 reverse
-// CHECK: ThreadSanitizer: data race
-// CHECK: Test 3 reverse
-// CHECK: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/atomic_race.cpp (from r367653, compiler-rt/trunk/test/tsan/atomic_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atomic_race.cpp?p2=compiler-rt/trunk/test/tsan/atomic_race.cpp&p1=compiler-rt/trunk/test/tsan/atomic_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/atomic_stack.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atomic_stack.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/atomic_stack.cc (original)
+++ compiler-rt/trunk/test/tsan/atomic_stack.cc (removed)
@@ -1,30 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-int Global;
-
-void *Thread1(void *x) {
- barrier_wait(&barrier);
- __atomic_fetch_add(&Global, 1, __ATOMIC_RELAXED);
- return NULL;
-}
-
-void *Thread2(void *x) {
- Global++;
- barrier_wait(&barrier);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Atomic write of size 4
-// CHECK: #0 __tsan_atomic32_fetch_add
-// CHECK: #1 Thread1
Copied: compiler-rt/trunk/test/tsan/atomic_stack.cpp (from r367653, compiler-rt/trunk/test/tsan/atomic_stack.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atomic_stack.cpp?p2=compiler-rt/trunk/test/tsan/atomic_stack.cpp&p1=compiler-rt/trunk/test/tsan/atomic_stack.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/atomic_store.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atomic_store.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/atomic_store.cc (original)
+++ compiler-rt/trunk/test/tsan/atomic_store.cc (removed)
@@ -1,49 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
-#include "test.h"
-
-long long Data;
-long long Sync;
-
-void *Thread1(void *x) {
- Data++;
- __atomic_store_n(&Sync, 1, __ATOMIC_RELEASE);
- barrier_wait(&barrier);
- barrier_wait(&barrier);
- return NULL;
-}
-
-void *Thread2(void *x) {
- barrier_wait(&barrier);
- if (__atomic_load_n(&Sync, __ATOMIC_RELAXED) != 1)
- exit(0);
- // This store must terminate release sequence of the store in Thread1,
- // thus tsan must detect race between Thread1 and main on Data.
- __atomic_store_n(&Sync, 2, __ATOMIC_RELEASE);
- barrier_wait(&barrier);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 3);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- barrier_wait(&barrier);
- barrier_wait(&barrier);
- if (__atomic_load_n(&Sync, __ATOMIC_ACQUIRE) != 2)
- exit(0);
- if (Data != 1)
- exit(0);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Read
-// CHECK: #0 main
-// CHECK: Previous write
-// CHECK: #0 Thread1
-// CHECK: Location is global 'Data'
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/atomic_store.cpp (from r367653, compiler-rt/trunk/test/tsan/atomic_store.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/atomic_store.cpp?p2=compiler-rt/trunk/test/tsan/atomic_store.cpp&p1=compiler-rt/trunk/test/tsan/atomic_store.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/barrier.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/barrier.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/barrier.cc (original)
+++ compiler-rt/trunk/test/tsan/barrier.cc (removed)
@@ -1,40 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-// CHECK-NOT: ThreadSanitizer: data race
-// CHECK: DONE
-
-// pthread barriers are not available on OS X
-// UNSUPPORTED: darwin
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <pthread.h>
-#include <unistd.h>
-
-const int kSize = 4;
-volatile int kIter = 10; // prevent unwinding
-int data[2][kSize];
-pthread_barrier_t barrier;
-
-void *thr(void *p) {
- int idx = (int)(long)p;
- for (int i = 0; i < kIter; i++) {
- int *prev = data[i % 2];
- int *curr = data[(i + 1) % 2];
- int left = idx - 1 >= 0 ? prev[idx - 1] : 0;
- int right = idx + 1 < kSize ? prev[idx + 1] : 0;
- curr[idx] = (left + right) / 2;
- pthread_barrier_wait(&barrier);
- }
- return 0;
-}
-
-int main() {
- pthread_barrier_init(&barrier, 0, kSize);
- pthread_t th[kSize];
- for (int i = 0; i < kSize; i++)
- pthread_create(&th[i], 0, thr, (void*)(long)i);
- for (int i = 0; i < kSize; i++)
- pthread_join(th[i], 0);
- pthread_barrier_destroy(&barrier);
- fprintf(stderr, "DONE\n");
-}
Copied: compiler-rt/trunk/test/tsan/barrier.cpp (from r367653, compiler-rt/trunk/test/tsan/barrier.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/barrier.cpp?p2=compiler-rt/trunk/test/tsan/barrier.cpp&p1=compiler-rt/trunk/test/tsan/barrier.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/bench_acquire_only.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/bench_acquire_only.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/bench_acquire_only.cc (original)
+++ compiler-rt/trunk/test/tsan/bench_acquire_only.cc (removed)
@@ -1,22 +0,0 @@
-// RUN: %clangxx_tsan %s -o %t
-// RUN: %run %t 2>&1 | FileCheck %s
-
-// bench.h needs pthread barriers which are not available on OS X
-// UNSUPPORTED: darwin
-
-#include "bench.h"
-
-int x;
-
-void thread(int tid) {
- for (int i = 0; i < bench_niter; i++)
- __atomic_load_n(&x, __ATOMIC_ACQUIRE);
-}
-
-void bench() {
- __atomic_store_n(&x, 0, __ATOMIC_RELEASE);
- start_thread_group(bench_nthread, thread);
-}
-
-// CHECK: DONE
-
Copied: compiler-rt/trunk/test/tsan/bench_acquire_only.cpp (from r367653, compiler-rt/trunk/test/tsan/bench_acquire_only.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/bench_acquire_only.cpp?p2=compiler-rt/trunk/test/tsan/bench_acquire_only.cpp&p1=compiler-rt/trunk/test/tsan/bench_acquire_only.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/bench_acquire_release.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/bench_acquire_release.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/bench_acquire_release.cc (original)
+++ compiler-rt/trunk/test/tsan/bench_acquire_release.cc (removed)
@@ -1,21 +0,0 @@
-// RUN: %clangxx_tsan %s -o %t
-// RUN: %run %t 2>&1 | FileCheck %s
-
-// bench.h needs pthread barriers which are not available on OS X
-// UNSUPPORTED: darwin
-
-#include "bench.h"
-
-int x;
-
-void thread(int tid) {
- for (int i = 0; i < bench_niter; i++)
- __atomic_fetch_add(&x, 1, __ATOMIC_ACQ_REL);
-}
-
-void bench() {
- start_thread_group(bench_nthread, thread);
-}
-
-// CHECK: DONE
-
Copied: compiler-rt/trunk/test/tsan/bench_acquire_release.cpp (from r367653, compiler-rt/trunk/test/tsan/bench_acquire_release.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/bench_acquire_release.cpp?p2=compiler-rt/trunk/test/tsan/bench_acquire_release.cpp&p1=compiler-rt/trunk/test/tsan/bench_acquire_release.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/bench_local_mutex.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/bench_local_mutex.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/bench_local_mutex.cc (original)
+++ compiler-rt/trunk/test/tsan/bench_local_mutex.cc (removed)
@@ -1,30 +0,0 @@
-// RUN: %clangxx_tsan %s -o %t
-// RUN: %run %t 2>&1 | FileCheck %s
-
-// bench.h needs pthread barriers which are not available on OS X
-// UNSUPPORTED: darwin
-
-#include "bench.h"
-
-pthread_mutex_t *mtx;
-const int kStride = 16;
-
-void thread(int tid) {
- for (int i = 0; i < bench_niter; i++) {
- pthread_mutex_lock(&mtx[tid * kStride]);
- pthread_mutex_unlock(&mtx[tid * kStride]);
- }
-}
-
-void bench() {
- mtx = (pthread_mutex_t*)malloc(bench_nthread * kStride * sizeof(*mtx));
- for (int i = 0; i < bench_nthread; i++) {
- pthread_mutex_init(&mtx[i * kStride], 0);
- pthread_mutex_lock(&mtx[i * kStride]);
- pthread_mutex_unlock(&mtx[i * kStride]);
- }
- start_thread_group(bench_nthread, thread);
-}
-
-// CHECK: DONE
-
Copied: compiler-rt/trunk/test/tsan/bench_local_mutex.cpp (from r367653, compiler-rt/trunk/test/tsan/bench_local_mutex.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/bench_local_mutex.cpp?p2=compiler-rt/trunk/test/tsan/bench_local_mutex.cpp&p1=compiler-rt/trunk/test/tsan/bench_local_mutex.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/bench_mutex.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/bench_mutex.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/bench_mutex.cc (original)
+++ compiler-rt/trunk/test/tsan/bench_mutex.cc (removed)
@@ -1,31 +0,0 @@
-// RUN: %clangxx_tsan %s -o %t
-// RUN: %run %t 2>&1 | FileCheck %s
-
-// bench.h needs pthread barriers which are not available on OS X
-// UNSUPPORTED: darwin
-
-#include "bench.h"
-
-pthread_mutex_t mtx;
-pthread_cond_t cv;
-int x;
-
-void thread(int tid) {
- for (int i = 0; i < bench_niter; i++) {
- pthread_mutex_lock(&mtx);
- while (x != i * 2 + tid)
- pthread_cond_wait(&cv, &mtx);
- x++;
- pthread_cond_signal(&cv);
- pthread_mutex_unlock(&mtx);
- }
-}
-
-void bench() {
- pthread_mutex_init(&mtx, 0);
- pthread_cond_init(&cv, 0);
- start_thread_group(2, thread);
-}
-
-// CHECK: DONE
-
Copied: compiler-rt/trunk/test/tsan/bench_mutex.cpp (from r367653, compiler-rt/trunk/test/tsan/bench_mutex.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/bench_mutex.cpp?p2=compiler-rt/trunk/test/tsan/bench_mutex.cpp&p1=compiler-rt/trunk/test/tsan/bench_mutex.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/bench_release_only.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/bench_release_only.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/bench_release_only.cc (original)
+++ compiler-rt/trunk/test/tsan/bench_release_only.cc (removed)
@@ -1,26 +0,0 @@
-// RUN: %clangxx_tsan %s -o %t
-// RUN: %run %t 2>&1 | FileCheck %s
-
-// bench.h needs pthread barriers which are not available on OS X
-// UNSUPPORTED: darwin
-
-#include "bench.h"
-
-int *x;
-const int kStride = 32;
-
-void thread(int tid) {
- __atomic_load_n(&x[tid * kStride], __ATOMIC_ACQUIRE);
- for (int i = 0; i < bench_niter; i++)
- __atomic_store_n(&x[tid * kStride], 0, __ATOMIC_RELEASE);
-}
-
-void bench() {
- x = (int*)malloc(bench_nthread * kStride * sizeof(x[0]));
- for (int i = 0; i < bench_nthread; i++)
- __atomic_store_n(&x[i * kStride], 0, __ATOMIC_RELEASE);
- start_thread_group(bench_nthread, thread);
-}
-
-// CHECK: DONE
-
Copied: compiler-rt/trunk/test/tsan/bench_release_only.cpp (from r367653, compiler-rt/trunk/test/tsan/bench_release_only.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/bench_release_only.cpp?p2=compiler-rt/trunk/test/tsan/bench_release_only.cpp&p1=compiler-rt/trunk/test/tsan/bench_release_only.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/bench_rwmutex.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/bench_rwmutex.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/bench_rwmutex.cc (original)
+++ compiler-rt/trunk/test/tsan/bench_rwmutex.cc (removed)
@@ -1,28 +0,0 @@
-// RUN: %clangxx_tsan %s -o %t
-// RUN: %run %t 2>&1 | FileCheck %s
-
-// bench.h needs pthread barriers which are not available on OS X
-// UNSUPPORTED: darwin
-
-#include "bench.h"
-
-pthread_rwlock_t mtx;
-
-void thread(int tid) {
- for (int i = 0; i < bench_niter; i++) {
- pthread_rwlock_rdlock(&mtx);
- pthread_rwlock_unlock(&mtx);
- }
-}
-
-void bench() {
- pthread_rwlock_init(&mtx, 0);
- pthread_rwlock_wrlock(&mtx);
- pthread_rwlock_unlock(&mtx);
- pthread_rwlock_rdlock(&mtx);
- pthread_rwlock_unlock(&mtx);
- start_thread_group(bench_nthread, thread);
-}
-
-// CHECK: DONE
-
Copied: compiler-rt/trunk/test/tsan/bench_rwmutex.cpp (from r367653, compiler-rt/trunk/test/tsan/bench_rwmutex.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/bench_rwmutex.cpp?p2=compiler-rt/trunk/test/tsan/bench_rwmutex.cpp&p1=compiler-rt/trunk/test/tsan/bench_rwmutex.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/bench_shadow_flush.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/bench_shadow_flush.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/bench_shadow_flush.cc (original)
+++ compiler-rt/trunk/test/tsan/bench_shadow_flush.cc (removed)
@@ -1,48 +0,0 @@
-// RUN: %clangxx_tsan %s -o %t
-// RUN: %run %t 2>&1 | FileCheck %s
-
-#include <pthread.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <time.h>
-#include <sys/mman.h>
-
-const long kSmallPage = 4 << 10;
-const long kLargePage = 2 << 20;
-const long kStride = 1 << 10;
-
-typedef unsigned long uptr;
-
-int main(int argc, const char **argv) {
- uptr mem_size = 4 << 20;
- if (argc > 1)
- mem_size = (uptr)atoi(argv[1]) << 20;
- uptr stride = kSmallPage;
- if (argc > 2)
- stride = (uptr)atoi(argv[2]) << 10;
- int niter = 1;
- if (argc > 3)
- niter = atoi(argv[3]);
- int stride2 = 1;
- if (argc > 4)
- stride2 = atoi(argv[4]);
-
- uptr sz = mem_size + stride2 * kStride + kLargePage;
- void *p = mmap(0, sz, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);
- uptr a = ((uptr)p + kLargePage - 1) & ~(kLargePage - 1);
- volatile char *mem = (volatile char *)a;
-
- for (int i = 0; i < niter; i++) {
- for (uptr off = 0; off < mem_size; off += stride) {
- for (uptr off2 = 0; off2 < stride2; off2++)
- mem[off + off2 * kStride] = 42;
- }
- }
-
- fprintf(stderr, "DONE\n");
-}
-
-// CHECK: DONE
-
Copied: compiler-rt/trunk/test/tsan/bench_shadow_flush.cpp (from r367653, compiler-rt/trunk/test/tsan/bench_shadow_flush.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/bench_shadow_flush.cpp?p2=compiler-rt/trunk/test/tsan/bench_shadow_flush.cpp&p1=compiler-rt/trunk/test/tsan/bench_shadow_flush.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/bench_single_writer.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/bench_single_writer.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/bench_single_writer.cc (original)
+++ compiler-rt/trunk/test/tsan/bench_single_writer.cc (removed)
@@ -1,26 +0,0 @@
-// RUN: %clangxx_tsan %s -o %t
-// RUN: %run %t 2>&1 | FileCheck %s
-
-// bench.h needs pthread barriers which are not available on OS X
-// UNSUPPORTED: darwin
-
-#include "bench.h"
-
-int x;
-
-void thread(int tid) {
- if (tid == 0) {
- for (int i = 0; i < bench_niter; i++)
- __atomic_store_n(&x, 0, __ATOMIC_RELEASE);
- } else {
- for (int i = 0; i < bench_niter; i++)
- __atomic_load_n(&x, __ATOMIC_ACQUIRE);
- }
-}
-
-void bench() {
- start_thread_group(bench_nthread, thread);
-}
-
-// CHECK: DONE
-
Copied: compiler-rt/trunk/test/tsan/bench_single_writer.cpp (from r367653, compiler-rt/trunk/test/tsan/bench_single_writer.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/bench_single_writer.cpp?p2=compiler-rt/trunk/test/tsan/bench_single_writer.cpp&p1=compiler-rt/trunk/test/tsan/bench_single_writer.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/bench_ten_mutexes.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/bench_ten_mutexes.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/bench_ten_mutexes.cc (original)
+++ compiler-rt/trunk/test/tsan/bench_ten_mutexes.cc (removed)
@@ -1,29 +0,0 @@
-// RUN: %clangxx_tsan %s -o %t
-// RUN: %run %t 2>&1 | FileCheck %s
-
-// bench.h needs pthread barriers which are not available on OS X
-// UNSUPPORTED: darwin
-
-#include "bench.h"
-
-const int kMutex = 10;
-pthread_mutex_t mtx[kMutex];
-
-void thread(int tid) {
- for (int i = 0; i < bench_niter; i++) {
- int idx = (i % kMutex);
- if (tid == 0)
- idx = kMutex - idx - 1;
- pthread_mutex_lock(&mtx[idx]);
- pthread_mutex_unlock(&mtx[idx]);
- }
-}
-
-void bench() {
- for (int i = 0; i < kMutex; i++)
- pthread_mutex_init(&mtx[i], 0);
- start_thread_group(2, thread);
-}
-
-// CHECK: DONE
-
Copied: compiler-rt/trunk/test/tsan/bench_ten_mutexes.cpp (from r367653, compiler-rt/trunk/test/tsan/bench_ten_mutexes.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/bench_ten_mutexes.cpp?p2=compiler-rt/trunk/test/tsan/bench_ten_mutexes.cpp&p1=compiler-rt/trunk/test/tsan/bench_ten_mutexes.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/benign_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/benign_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/benign_race.cc (original)
+++ compiler-rt/trunk/test/tsan/benign_race.cc (removed)
@@ -1,39 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "test.h"
-
-int Global;
-int WTFGlobal;
-
-extern "C" {
-void AnnotateBenignRaceSized(const char *f, int l,
- void *mem, unsigned int size, const char *desc);
-void WTFAnnotateBenignRaceSized(const char *f, int l,
- void *mem, unsigned int size,
- const char *desc);
-}
-
-
-void *Thread(void *x) {
- Global = 42;
- WTFGlobal = 142;
- barrier_wait(&barrier);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- AnnotateBenignRaceSized(__FILE__, __LINE__,
- &Global, sizeof(Global), "Race on Global");
- WTFAnnotateBenignRaceSized(__FILE__, __LINE__,
- &WTFGlobal, sizeof(WTFGlobal),
- "Race on WTFGlobal");
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- barrier_wait(&barrier);
- Global = 43;
- WTFGlobal = 143;
- pthread_join(t, 0);
- fprintf(stderr, "OK\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/benign_race.cpp (from r367653, compiler-rt/trunk/test/tsan/benign_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/benign_race.cpp?p2=compiler-rt/trunk/test/tsan/benign_race.cpp&p1=compiler-rt/trunk/test/tsan/benign_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/blacklist.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/blacklist.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/blacklist.cc (original)
+++ compiler-rt/trunk/test/tsan/blacklist.cc (removed)
@@ -1,30 +0,0 @@
-// Test blacklist functionality for TSan.
-
-// RUN: echo "fun:*Blacklisted_Thread2*" > %t.blacklist
-// RUN: %clangxx_tsan -O1 %s -fsanitize-blacklist=%t.blacklist -o %t && %run %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdio.h>
-
-int Global;
-
-void *Thread1(void *x) {
- Global++;
- return NULL;
-}
-
-void *Blacklisted_Thread2(void *x) {
- Global--;
- return NULL;
-}
-
-int main() {
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Blacklisted_Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- fprintf(stderr, "PASS\n");
- return 0;
-}
-
-// CHECK-NOT: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/blacklist.cpp (from r367653, compiler-rt/trunk/test/tsan/blacklist.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/blacklist.cpp?p2=compiler-rt/trunk/test/tsan/blacklist.cpp&p1=compiler-rt/trunk/test/tsan/blacklist.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/blacklist2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/blacklist2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/blacklist2.cc (original)
+++ compiler-rt/trunk/test/tsan/blacklist2.cc (removed)
@@ -1,49 +0,0 @@
-// Test that blacklisted functions are still contained in the stack trace.
-
-// RUN: echo "fun:*Blacklisted_Thread2*" > %t.blacklist
-// RUN: echo "fun:*CallTouchGlobal*" >> %t.blacklist
-
-// RUN: %clangxx_tsan -O1 %s -fsanitize-blacklist=%t.blacklist -o %t
-// RUN: %deflake %run %t 2>&1 | FileCheck %s
-#include "test.h"
-
-int Global;
-
-void *Thread1(void *x) {
- barrier_wait(&barrier);
- // CHECK: ThreadSanitizer: data race
- // CHECK: Write of size 4
- // CHECK: #0 Thread1{{.*}}blacklist2.cc:[[@LINE+1]]
- Global++;
- return NULL;
-}
-
-void TouchGlobal() {
- // CHECK: Previous write of size 4
- // CHECK: #0 TouchGlobal{{.*}}blacklist2.cc:[[@LINE+1]]
- Global--;
-}
-
-void CallTouchGlobal() {
- // CHECK: #1 CallTouchGlobal{{.*}}blacklist2.cc:[[@LINE+1]]
- TouchGlobal();
-}
-
-void *Blacklisted_Thread2(void *x) {
- Global--;
- // CHECK: #2 Blacklisted_Thread2{{.*}}blacklist2.cc:[[@LINE+1]]
- CallTouchGlobal();
- barrier_wait(&barrier);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Blacklisted_Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- fprintf(stderr, "PASS\n");
- return 0;
-}
Copied: compiler-rt/trunk/test/tsan/blacklist2.cpp (from r367653, compiler-rt/trunk/test/tsan/blacklist2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/blacklist2.cpp?p2=compiler-rt/trunk/test/tsan/blacklist2.cpp&p1=compiler-rt/trunk/test/tsan/blacklist2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/blacklist2.cc (original)
+++ compiler-rt/trunk/test/tsan/blacklist2.cpp Fri Aug 2 00:18:07 2019
@@ -13,25 +13,25 @@ void *Thread1(void *x) {
barrier_wait(&barrier);
// CHECK: ThreadSanitizer: data race
// CHECK: Write of size 4
- // CHECK: #0 Thread1{{.*}}blacklist2.cc:[[@LINE+1]]
+ // CHECK: #0 Thread1{{.*}}blacklist2.cpp:[[@LINE+1]]
Global++;
return NULL;
}
void TouchGlobal() {
// CHECK: Previous write of size 4
- // CHECK: #0 TouchGlobal{{.*}}blacklist2.cc:[[@LINE+1]]
+ // CHECK: #0 TouchGlobal{{.*}}blacklist2.cpp:[[@LINE+1]]
Global--;
}
void CallTouchGlobal() {
- // CHECK: #1 CallTouchGlobal{{.*}}blacklist2.cc:[[@LINE+1]]
+ // CHECK: #1 CallTouchGlobal{{.*}}blacklist2.cpp:[[@LINE+1]]
TouchGlobal();
}
void *Blacklisted_Thread2(void *x) {
Global--;
- // CHECK: #2 Blacklisted_Thread2{{.*}}blacklist2.cc:[[@LINE+1]]
+ // CHECK: #2 Blacklisted_Thread2{{.*}}blacklist2.cpp:[[@LINE+1]]
CallTouchGlobal();
barrier_wait(&barrier);
return NULL;
Removed: compiler-rt/trunk/test/tsan/cond_destruction.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/cond_destruction.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/cond_destruction.cc (original)
+++ compiler-rt/trunk/test/tsan/cond_destruction.cc (removed)
@@ -1,53 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t
-// RUN: %run %t 2>&1 | FileCheck %s
-// RUN: %run %t arg 2>&1 | FileCheck %s
-// RUN: %run %t arg arg 2>&1 | FileCheck %s
-#include "test.h"
-
-// Test for destruction of pthread_cond_t.
-// POSIX states that it is safe to destroy a condition variable upon which no
-// threads are currently blocked. That is, it is not necessary to wait untill
-// other threads return from pthread_cond_wait, they just need to be unblocked.
-
-pthread_mutex_t m;
-pthread_cond_t c;
-bool done1, done2;
-
-void *thr(void *p) {
- pthread_mutex_lock(&m);
- done1 = true;
- pthread_cond_signal(&c);
- while (!done2)
- pthread_cond_wait(&c, &m);
- pthread_mutex_unlock(&m);
- return 0;
-}
-
-int main(int argc, char **argv) {
- pthread_t th;
- pthread_mutex_init(&m, 0);
- pthread_cond_init(&c, 0);
- pthread_create(&th, 0, thr, 0);
- pthread_mutex_lock(&m);
- while (!done1)
- pthread_cond_wait(&c, &m);
- done2 = true;
- // Any of these sequences is legal.
- if (argc == 1) {
- pthread_cond_signal(&c);
- pthread_mutex_unlock(&m);
- pthread_cond_destroy(&c);
- } else if (argc == 2) {
- pthread_mutex_unlock(&m);
- pthread_cond_signal(&c);
- pthread_cond_destroy(&c);
- } else {
- pthread_cond_signal(&c);
- pthread_cond_destroy(&c);
- pthread_mutex_unlock(&m);
- }
- pthread_join(th, 0);
- fprintf(stderr, "DONE\n");
-}
-
-// CHECK-NOT: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/cond_destruction.cpp (from r367653, compiler-rt/trunk/test/tsan/cond_destruction.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/cond_destruction.cpp?p2=compiler-rt/trunk/test/tsan/cond_destruction.cpp&p1=compiler-rt/trunk/test/tsan/cond_destruction.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/cond_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/cond_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/cond_race.cc (original)
+++ compiler-rt/trunk/test/tsan/cond_race.cc (removed)
@@ -1,39 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-// CHECK-NOT: unlock of unlocked mutex
-// CHECK: ThreadSanitizer: data race
-// CHECK: pthread_cond_signal
-
-#include "test.h"
-
-struct Ctx {
- pthread_mutex_t m;
- pthread_cond_t c;
- bool done;
-};
-
-void *thr(void *p) {
- Ctx *c = (Ctx*)p;
- pthread_mutex_lock(&c->m);
- c->done = true;
- pthread_mutex_unlock(&c->m);
- pthread_cond_signal(&c->c);
- barrier_wait(&barrier);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- Ctx *c = new Ctx();
- pthread_mutex_init(&c->m, 0);
- pthread_cond_init(&c->c, 0);
- pthread_t th;
- pthread_create(&th, 0, thr, c);
- pthread_mutex_lock(&c->m);
- while (!c->done)
- pthread_cond_wait(&c->c, &c->m);
- pthread_mutex_unlock(&c->m);
- // otherwise it can be reported as use-after-free
- barrier_wait(&barrier);
- delete c;
- pthread_join(th, 0);
-}
Copied: compiler-rt/trunk/test/tsan/cond_race.cpp (from r367653, compiler-rt/trunk/test/tsan/cond_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/cond_race.cpp?p2=compiler-rt/trunk/test/tsan/cond_race.cpp&p1=compiler-rt/trunk/test/tsan/cond_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/custom_mutex0.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/custom_mutex0.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/custom_mutex0.cc (original)
+++ compiler-rt/trunk/test/tsan/custom_mutex0.cc (removed)
@@ -1,31 +0,0 @@
-// RUN: %clangxx_tsan -O1 --std=c++11 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "custom_mutex.h"
-
-// Test that custom annoations provide normal mutex synchronization
-// (no race reports for properly protected critical sections).
-
-Mutex mu(true, 0);
-long data;
-
-void *thr(void *arg) {
- barrier_wait(&barrier);
- mu.Lock();
- data++;
- mu.Unlock();
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t th;
- pthread_create(&th, 0, thr, 0);
- barrier_wait(&barrier);
- mu.Lock();
- data++;
- mu.Unlock();
- pthread_join(th, 0);
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/custom_mutex0.cpp (from r367653, compiler-rt/trunk/test/tsan/custom_mutex0.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/custom_mutex0.cpp?p2=compiler-rt/trunk/test/tsan/custom_mutex0.cpp&p1=compiler-rt/trunk/test/tsan/custom_mutex0.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/custom_mutex1.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/custom_mutex1.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/custom_mutex1.cc (original)
+++ compiler-rt/trunk/test/tsan/custom_mutex1.cc (removed)
@@ -1,39 +0,0 @@
-// RUN: %clangxx_tsan -O1 --std=c++11 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
-#include "custom_mutex.h"
-
-// Test that failed TryLock does not induce parasitic synchronization.
-
-Mutex mu(true, 0);
-long data;
-
-void *thr(void *arg) {
- mu.Lock();
- data++;
- mu.Unlock();
- mu.Lock();
- barrier_wait(&barrier);
- barrier_wait(&barrier);
- mu.Unlock();
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t th;
- pthread_create(&th, 0, thr, 0);
- barrier_wait(&barrier);
- if (mu.TryLock()) {
- fprintf(stderr, "TryLock succeeded, should not\n");
- exit(0);
- }
- data++;
- barrier_wait(&barrier);
- pthread_join(th, 0);
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK: ThreadSanitizer: data race
-// CHECK-NEXT: Write of size 8 at {{.*}} by main thread:
-// CHECK-NEXT: #0 main {{.*}}custom_mutex1.cc:29
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/custom_mutex1.cpp (from r367653, compiler-rt/trunk/test/tsan/custom_mutex1.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/custom_mutex1.cpp?p2=compiler-rt/trunk/test/tsan/custom_mutex1.cpp&p1=compiler-rt/trunk/test/tsan/custom_mutex1.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/custom_mutex1.cc (original)
+++ compiler-rt/trunk/test/tsan/custom_mutex1.cpp Fri Aug 2 00:18:07 2019
@@ -35,5 +35,5 @@ int main() {
// CHECK: ThreadSanitizer: data race
// CHECK-NEXT: Write of size 8 at {{.*}} by main thread:
-// CHECK-NEXT: #0 main {{.*}}custom_mutex1.cc:29
+// CHECK-NEXT: #0 main {{.*}}custom_mutex1.cpp:29
// CHECK: DONE
Removed: compiler-rt/trunk/test/tsan/custom_mutex2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/custom_mutex2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/custom_mutex2.cc (original)
+++ compiler-rt/trunk/test/tsan/custom_mutex2.cc (removed)
@@ -1,34 +0,0 @@
-// RUN: %clangxx_tsan -O1 --std=c++11 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
-#include "custom_mutex.h"
-
-// Test that Broadcast does not induce parasitic synchronization.
-
-Mutex mu(true, 0);
-long data;
-
-void *thr(void *arg) {
- barrier_wait(&barrier);
- mu.Lock();
- data++;
- mu.Unlock();
- data++;
- mu.Broadcast();
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t th;
- pthread_create(&th, 0, thr, 0);
- mu.Lock();
- barrier_wait(&barrier);
- while (data == 0)
- mu.Wait();
- mu.Unlock();
- pthread_join(th, 0);
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK: ThreadSanitizer: data race
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/custom_mutex2.cpp (from r367653, compiler-rt/trunk/test/tsan/custom_mutex2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/custom_mutex2.cpp?p2=compiler-rt/trunk/test/tsan/custom_mutex2.cpp&p1=compiler-rt/trunk/test/tsan/custom_mutex2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/custom_mutex3.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/custom_mutex3.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/custom_mutex3.cc (original)
+++ compiler-rt/trunk/test/tsan/custom_mutex3.cc (removed)
@@ -1,46 +0,0 @@
-// RUN: %clangxx_tsan -O1 --std=c++11 %s -o %t
-// RUN: %env_tsan_opts=report_destroy_locked=0 %run %t 2>&1 | FileCheck %s
-#include "custom_mutex.h"
-
-// Regression test for a bug.
-// Thr1 destroys a locked mutex, previously such mutex was not removed from
-// sync map and as the result subsequent uses of a mutex located at the same
-// address caused false race reports.
-
-Mutex mu(false, __tsan_mutex_write_reentrant);
-long data;
-
-void *thr1(void *arg) {
- mu.Lock();
- mu.~Mutex();
- new(&mu) Mutex(true, __tsan_mutex_write_reentrant);
- return 0;
-}
-
-void *thr2(void *arg) {
- barrier_wait(&barrier);
- mu.Lock();
- data++;
- mu.Unlock();
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t th;
- pthread_create(&th, 0, thr1, 0);
- pthread_join(th, 0);
-
- barrier_init(&barrier, 2);
- pthread_create(&th, 0, thr2, 0);
- mu.Lock();
- data++;
- mu.Unlock();
- barrier_wait(&barrier);
- pthread_join(th, 0);
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/custom_mutex3.cpp (from r367653, compiler-rt/trunk/test/tsan/custom_mutex3.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/custom_mutex3.cpp?p2=compiler-rt/trunk/test/tsan/custom_mutex3.cpp&p1=compiler-rt/trunk/test/tsan/custom_mutex3.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/custom_mutex4.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/custom_mutex4.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/custom_mutex4.cc (original)
+++ compiler-rt/trunk/test/tsan/custom_mutex4.cc (removed)
@@ -1,33 +0,0 @@
-// RUN: %clangxx_tsan -O1 --std=c++11 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "custom_mutex.h"
-
-#include <type_traits>
-
-// Test that the destruction events of a mutex are ignored when the
-// annotations request this.
-//
-// Use after destruction is UB, but __tsan_mutex_linker_init and
-// __tsan_mutex_not_static exist to support global variables of mutex type,
-// which might be accessed during program shutdown after the class's destructor
-// has run.
-
-int main() {
- std::aligned_storage<sizeof(Mutex), alignof(Mutex)>::type mu1_store;
- Mutex* mu1 = reinterpret_cast<Mutex*>(&mu1_store);
- new(&mu1_store) Mutex(false, __tsan_mutex_linker_init);
- mu1->Lock();
- mu1->~Mutex();
- mu1->Unlock();
-
- std::aligned_storage<sizeof(Mutex), alignof(Mutex)>::type mu2_store;
- Mutex* mu2 = reinterpret_cast<Mutex*>(&mu2_store);
- new(&mu2_store) Mutex(false, 0, __tsan_mutex_not_static);
- mu2->Lock();
- mu2->~Mutex();
- mu2->Unlock();
-
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/custom_mutex4.cpp (from r367653, compiler-rt/trunk/test/tsan/custom_mutex4.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/custom_mutex4.cpp?p2=compiler-rt/trunk/test/tsan/custom_mutex4.cpp&p1=compiler-rt/trunk/test/tsan/custom_mutex4.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/custom_mutex5.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/custom_mutex5.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/custom_mutex5.cc (original)
+++ compiler-rt/trunk/test/tsan/custom_mutex5.cc (removed)
@@ -1,33 +0,0 @@
-// RUN: %clangxx_tsan -O1 --std=c++11 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
-#include "custom_mutex.h"
-
-#include <type_traits>
-
-// Test that we detect the destruction of an in-use mutex when the
-// thread annotations don't otherwise disable the check.
-
-int main() {
- std::aligned_storage<sizeof(Mutex), alignof(Mutex)>::type mu1_store;
- Mutex* mu1 = reinterpret_cast<Mutex*>(&mu1_store);
- new(&mu1_store) Mutex(false, 0);
- mu1->Lock();
- mu1->~Mutex();
- mu1->Unlock();
-
- std::aligned_storage<sizeof(Mutex), alignof(Mutex)>::type mu2_store;
- Mutex* mu2 = reinterpret_cast<Mutex*>(&mu2_store);
- new(&mu2_store)
- Mutex(false, __tsan_mutex_not_static, __tsan_mutex_not_static);
- mu2->Lock();
- mu2->~Mutex();
- mu2->Unlock();
-
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: destroy of a locked mutex
-// CHECK: main {{.*}}custom_mutex5.cc:14
-// CHECK: WARNING: ThreadSanitizer: destroy of a locked mutex
-// CHECK: main {{.*}}custom_mutex5.cc:22
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/custom_mutex5.cpp (from r367653, compiler-rt/trunk/test/tsan/custom_mutex5.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/custom_mutex5.cpp?p2=compiler-rt/trunk/test/tsan/custom_mutex5.cpp&p1=compiler-rt/trunk/test/tsan/custom_mutex5.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/custom_mutex5.cc (original)
+++ compiler-rt/trunk/test/tsan/custom_mutex5.cpp Fri Aug 2 00:18:07 2019
@@ -27,7 +27,7 @@ int main() {
}
// CHECK: WARNING: ThreadSanitizer: destroy of a locked mutex
-// CHECK: main {{.*}}custom_mutex5.cc:14
+// CHECK: main {{.*}}custom_mutex5.cpp:14
// CHECK: WARNING: ThreadSanitizer: destroy of a locked mutex
-// CHECK: main {{.*}}custom_mutex5.cc:22
+// CHECK: main {{.*}}custom_mutex5.cpp:22
// CHECK: DONE
Removed: compiler-rt/trunk/test/tsan/cxa_guard_acquire.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/cxa_guard_acquire.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/cxa_guard_acquire.cc (original)
+++ compiler-rt/trunk/test/tsan/cxa_guard_acquire.cc (removed)
@@ -1,25 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-
-#include <stdio.h>
-
-namespace __tsan {
-
-void OnPotentiallyBlockingRegionBegin() {
- printf("Enter __cxa_guard_acquire\n");
-}
-
-void OnPotentiallyBlockingRegionEnd() { printf("Exit __cxa_guard_acquire\n"); }
-
-} // namespace __tsan
-
-int main(int argc, char **argv) {
- // CHECK: Enter main
- printf("Enter main\n");
- // CHECK-NEXT: Enter __cxa_guard_acquire
- // CHECK-NEXT: Exit __cxa_guard_acquire
- static int s = argc;
- (void)s;
- // CHECK-NEXT: Exit main
- printf("Exit main\n");
- return 0;
-}
Copied: compiler-rt/trunk/test/tsan/cxa_guard_acquire.cpp (from r367653, compiler-rt/trunk/test/tsan/cxa_guard_acquire.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/cxa_guard_acquire.cpp?p2=compiler-rt/trunk/test/tsan/cxa_guard_acquire.cpp&p1=compiler-rt/trunk/test/tsan/cxa_guard_acquire.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc (original)
+++ compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc (removed)
@@ -1,625 +0,0 @@
-// RUN: %clangxx_tsan %s -o %t -DLockType=PthreadMutex
-// RUN: %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NOT-SECOND
-// RUN: %env_tsan_opts=second_deadlock_stack=1 %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-SECOND
-// RUN: %clangxx_tsan %s -o %t -DLockType=PthreadSpinLock
-// RUN: %deflake %run %t | FileCheck %s
-// RUN: %clangxx_tsan %s -o %t -DLockType=PthreadRWLock
-// RUN: %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-RD
-// RUN: %clangxx_tsan %s -o %t -DLockType=PthreadRecursiveMutex
-// RUN: %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-REC
-#include "test.h"
-#undef NDEBUG
-#include <assert.h>
-#include <new>
-
-#ifndef LockType
-#define LockType PthreadMutex
-#endif
-
-// You can optionally pass [test_number [iter_count]] on command line.
-static int test_number = -1;
-static int iter_count = 100000;
-
-class PthreadMutex {
- public:
- explicit PthreadMutex(bool recursive = false) {
- if (recursive) {
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
- assert(0 == pthread_mutex_init(&mu_, &attr));
- } else {
- assert(0 == pthread_mutex_init(&mu_, 0));
- }
- }
- ~PthreadMutex() {
- assert(0 == pthread_mutex_destroy(&mu_));
- (void)padding_;
- }
- static bool supports_read_lock() { return false; }
- static bool supports_recursive_lock() { return false; }
- void lock() { assert(0 == pthread_mutex_lock(&mu_)); }
- void unlock() { assert(0 == pthread_mutex_unlock(&mu_)); }
- bool try_lock() { return 0 == pthread_mutex_trylock(&mu_); }
- void rdlock() { assert(0); }
- void rdunlock() { assert(0); }
- bool try_rdlock() { assert(0); }
-
- private:
- pthread_mutex_t mu_;
- char padding_[64 - sizeof(pthread_mutex_t)];
-};
-
-class PthreadRecursiveMutex : public PthreadMutex {
- public:
- PthreadRecursiveMutex() : PthreadMutex(true) { }
- static bool supports_recursive_lock() { return true; }
-};
-
-#ifndef __APPLE__
-class PthreadSpinLock {
- public:
- PthreadSpinLock() { assert(0 == pthread_spin_init(&mu_, 0)); }
- ~PthreadSpinLock() {
- assert(0 == pthread_spin_destroy(&mu_));
- (void)padding_;
- }
- static bool supports_read_lock() { return false; }
- static bool supports_recursive_lock() { return false; }
- void lock() { assert(0 == pthread_spin_lock(&mu_)); }
- void unlock() { assert(0 == pthread_spin_unlock(&mu_)); }
- bool try_lock() { return 0 == pthread_spin_trylock(&mu_); }
- void rdlock() { assert(0); }
- void rdunlock() { assert(0); }
- bool try_rdlock() { assert(0); }
-
- private:
- pthread_spinlock_t mu_;
- char padding_[64 - sizeof(pthread_spinlock_t)];
-};
-#else
-class PthreadSpinLock : public PthreadMutex { };
-#endif
-
-class PthreadRWLock {
- public:
- PthreadRWLock() { assert(0 == pthread_rwlock_init(&mu_, 0)); }
- ~PthreadRWLock() {
- assert(0 == pthread_rwlock_destroy(&mu_));
- (void)padding_;
- }
- static bool supports_read_lock() { return true; }
- static bool supports_recursive_lock() { return false; }
- void lock() { assert(0 == pthread_rwlock_wrlock(&mu_)); }
- void unlock() { assert(0 == pthread_rwlock_unlock(&mu_)); }
- bool try_lock() { return 0 == pthread_rwlock_trywrlock(&mu_); }
- void rdlock() { assert(0 == pthread_rwlock_rdlock(&mu_)); }
- void rdunlock() { assert(0 == pthread_rwlock_unlock(&mu_)); }
- bool try_rdlock() { return 0 == pthread_rwlock_tryrdlock(&mu_); }
-
- private:
- pthread_rwlock_t mu_;
- char padding_[256 - sizeof(pthread_rwlock_t)];
-};
-
-class LockTest {
- public:
- LockTest() : n_(), locks_() {}
- void Init(size_t n) {
- n_ = n;
- locks_ = new LockType*[n_];
- for (size_t i = 0; i < n_; i++)
- locks_[i] = new LockType;
- }
- ~LockTest() {
- for (size_t i = 0; i < n_; i++)
- delete locks_[i];
- delete [] locks_;
- }
- void L(size_t i) {
- assert(i < n_);
- locks_[i]->lock();
- }
-
- void U(size_t i) {
- assert(i < n_);
- locks_[i]->unlock();
- }
-
- void RL(size_t i) {
- assert(i < n_);
- locks_[i]->rdlock();
- }
-
- void RU(size_t i) {
- assert(i < n_);
- locks_[i]->rdunlock();
- }
-
- void *A(size_t i) {
- assert(i < n_);
- return locks_[i];
- }
-
- bool T(size_t i) {
- assert(i < n_);
- return locks_[i]->try_lock();
- }
-
- // Simple lock order onversion.
- void Test1() {
- if (test_number > 0 && test_number != 1) return;
- fprintf(stderr, "Starting Test1\n");
- // CHECK: Starting Test1
- Init(5);
- print_address("Expecting lock inversion: ", 2, A(0), A(1));
- // CHECK: Expecting lock inversion: [[A1:0x[a-f0-9]*]] [[A2:0x[a-f0-9]*]]
- Lock_0_1();
- Lock_1_0();
- // CHECK: WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
- // CHECK: Cycle in lock order graph: [[M1:M[0-9]+]] ([[A1]]) => [[M2:M[0-9]+]] ([[A2]]) => [[M1]]
- // CHECK: Mutex [[M2]] acquired here while holding mutex [[M1]]
- // CHECK: #0 pthread_
- // CHECK-SECOND: Mutex [[M1]] previously acquired by the same thread here:
- // CHECK-SECOND: #0 pthread_
- // CHECK-NOT-SECOND: second_deadlock_stack=1 to get more informative warning message
- // CHECK-NOT-SECOND-NOT: #0 pthread_
- // CHECK: Mutex [[M1]] acquired here while holding mutex [[M2]]
- // CHECK: #0 pthread_
- // CHECK-SECOND: Mutex [[M2]] previously acquired by the same thread here:
- // CHECK-SECOND: #0 pthread_
- // CHECK-NOT-SECOND-NOT: #0 pthread_
- // CHECK-NOT: WARNING: ThreadSanitizer:
- }
-
- // Simple lock order inversion with 3 locks.
- void Test2() {
- if (test_number > 0 && test_number != 2) return;
- fprintf(stderr, "Starting Test2\n");
- // CHECK: Starting Test2
- Init(5);
- print_address("Expecting lock inversion: ", 3, A(0), A(1), A(2));
- // CHECK: Expecting lock inversion: [[A1:0x[a-f0-9]*]] [[A2:0x[a-f0-9]*]] [[A3:0x[a-f0-9]*]]
- Lock2(0, 1);
- Lock2(1, 2);
- Lock2(2, 0);
- // CHECK: WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
- // CHECK: Cycle in lock order graph: [[M1:M[0-9]+]] ([[A1]]) => [[M2:M[0-9]+]] ([[A2]]) => [[M3:M[0-9]+]] ([[A3]]) => [[M1]]
- // CHECK-NOT: WARNING: ThreadSanitizer:
- }
-
- // Lock order inversion with lots of new locks created (but not used)
- // between. Since the new locks are not used we should still detect the
- // deadlock.
- void Test3() {
- if (test_number > 0 && test_number != 3) return;
- fprintf(stderr, "Starting Test3\n");
- // CHECK: Starting Test3
- Init(5);
- Lock_0_1();
- L(2);
- CreateAndDestroyManyLocks();
- U(2);
- Lock_1_0();
- // CHECK: WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
- // CHECK-NOT: WARNING: ThreadSanitizer:
- }
-
- // lock l0=>l1; then create and use lots of locks; then lock l1=>l0.
- // The deadlock epoch should have changed and we should not report anything.
- void Test4() {
- if (test_number > 0 && test_number != 4) return;
- fprintf(stderr, "Starting Test4\n");
- // CHECK: Starting Test4
- Init(5);
- Lock_0_1();
- L(2);
- CreateLockUnlockAndDestroyManyLocks();
- U(2);
- Lock_1_0();
- // CHECK-NOT: WARNING: ThreadSanitizer:
- }
-
- void Test5() {
- if (test_number > 0 && test_number != 5) return;
- fprintf(stderr, "Starting Test5\n");
- // CHECK: Starting Test5
- Init(5);
- RunThreads(&LockTest::Lock_0_1<true>, &LockTest::Lock_1_0<true>);
- // CHECK: WARNING: ThreadSanitizer: lock-order-inversion
- // CHECK: Cycle in lock order graph: [[M1:M[0-9]+]] ({{.*}}) => [[M2:M[0-9]+]] ({{.*}}) => [[M1]]
- // CHECK: Mutex [[M2]] acquired here while holding mutex [[M1]] in thread [[T1:T[0-9]+]]
- // CHECK: Mutex [[M1]] acquired here while holding mutex [[M2]] in thread [[T2:T[0-9]+]]
- // CHECK: Thread [[T1]] {{.*}} created by main thread
- // CHECK: Thread [[T2]] {{.*}} created by main thread
- // CHECK-NOT: WARNING: ThreadSanitizer:
- }
-
- void Test6() {
- if (test_number > 0 && test_number != 6) return;
- fprintf(stderr, "Starting Test6: 3 threads lock/unlock private mutexes\n");
- // CHECK: Starting Test6
- Init(100);
- // CHECK-NOT: WARNING: ThreadSanitizer:
- RunThreads(&LockTest::Lock1_Loop_0, &LockTest::Lock1_Loop_1,
- &LockTest::Lock1_Loop_2);
- }
-
- void Test7() {
- if (test_number > 0 && test_number != 7) return;
- fprintf(stderr, "Starting Test7\n");
- // CHECK: Starting Test7
- Init(10);
- L(0); T(1); U(1); U(0);
- T(1); L(0); U(1); U(0);
- // CHECK-NOT: WARNING: ThreadSanitizer:
- fprintf(stderr, "No cycle: 0=>1\n");
- // CHECK: No cycle: 0=>1
-
- T(2); L(3); U(3); U(2);
- L(3); T(2); U(3); U(2);
- // CHECK-NOT: WARNING: ThreadSanitizer:
- fprintf(stderr, "No cycle: 2=>3\n");
- // CHECK: No cycle: 2=>3
-
- T(4); L(5); U(4); U(5);
- L(5); L(4); U(4); U(5);
- // CHECK: WARNING: ThreadSanitizer: lock-order-inversion
- fprintf(stderr, "Have cycle: 4=>5\n");
- // CHECK: Have cycle: 4=>5
-
- L(7); L(6); U(6); U(7);
- T(6); L(7); U(6); U(7);
- // CHECK: WARNING: ThreadSanitizer: lock-order-inversion
- fprintf(stderr, "Have cycle: 6=>7\n");
- // CHECK: Have cycle: 6=>7
- }
-
- void Test8() {
- if (test_number > 0 && test_number != 8) return;
- if (!LockType::supports_read_lock()) return;
- fprintf(stderr, "Starting Test8\n");
- Init(5);
- // CHECK-RD: Starting Test8
- RL(0); L(1); RU(0); U(1);
- L(1); RL(0); RU(0); U(1);
- // CHECK-RD: WARNING: ThreadSanitizer: lock-order-inversion
- fprintf(stderr, "Have cycle: 0=>1\n");
- // CHECK-RD: Have cycle: 0=>1
-
- RL(2); RL(3); RU(2); RU(3);
- RL(3); RL(2); RU(2); RU(3);
- // CHECK-RD: WARNING: ThreadSanitizer: lock-order-inversion
- fprintf(stderr, "Have cycle: 2=>3\n");
- // CHECK-RD: Have cycle: 2=>3
- }
-
- void Test9() {
- if (test_number > 0 && test_number != 9) return;
- if (!LockType::supports_recursive_lock()) return;
- fprintf(stderr, "Starting Test9\n");
- // CHECK-REC: Starting Test9
- Init(5);
- L(0); L(0); L(0); L(1); U(1); U(0); U(0); U(0);
- L(1); L(1); L(1); L(0); U(0); U(1); U(1); U(1);
- // CHECK-REC: WARNING: ThreadSanitizer: lock-order-inversion
- }
-
- void Test10() {
- if (test_number > 0 && test_number != 10) return;
- fprintf(stderr, "Starting Test10: 4 threads lock/unlock 4 private mutexes, one under another\n");
- // CHECK: Starting Test10
- Init(100);
- // CHECK-NOT: WARNING: ThreadSanitizer:
- RunThreads(&LockTest::Test10_Thread1, &LockTest::Test10_Thread2,
- &LockTest::Test10_Thread3, &LockTest::Test10_Thread4);
- }
- void Test10_Thread1() { Test10_Thread(0); }
- void Test10_Thread2() { Test10_Thread(10); }
- void Test10_Thread3() { Test10_Thread(20); }
- void Test10_Thread4() { Test10_Thread(30); }
- void Test10_Thread(size_t m) {
- for (int i = 0; i < iter_count; i++) {
- L(m + 0);
- L(m + 1);
- L(m + 2);
- L(m + 3);
- U(m + 3);
- U(m + 2);
- U(m + 1);
- U(m + 0);
- }
- }
-
- void Test11() {
- if (test_number > 0 && test_number != 11) return;
- fprintf(stderr, "Starting Test11: 4 threads lock/unlock 4 private mutexes, all under another private mutex\n");
- // CHECK: Starting Test11
- Init(500);
- // CHECK-NOT: WARNING: ThreadSanitizer:
- RunThreads(&LockTest::Test11_Thread1, &LockTest::Test11_Thread2,
- &LockTest::Test11_Thread3, &LockTest::Test11_Thread4);
- }
- void Test11_Thread1() { Test10_Thread(0); }
- void Test11_Thread2() { Test10_Thread(10); }
- void Test11_Thread3() { Test10_Thread(20); }
- void Test11_Thread4() { Test10_Thread(30); }
- void Test11_Thread(size_t m) {
- for (int i = 0; i < iter_count; i++) {
- L(m);
- L(m + 100);
- U(m + 100);
- L(m + 200);
- U(m + 200);
- L(m + 300);
- U(m + 300);
- L(m + 400);
- U(m + 500);
- U(m);
- }
- }
-
- void Test12() {
- if (test_number > 0 && test_number != 12) return;
- if (!LockType::supports_read_lock()) return;
- fprintf(stderr, "Starting Test12: 4 threads read lock/unlock 4 shared mutexes, one under another\n");
- // CHECK-RD: Starting Test12
- Init(500);
- // CHECK-RD-NOT: WARNING: ThreadSanitizer:
- RunThreads(&LockTest::Test12_Thread, &LockTest::Test12_Thread,
- &LockTest::Test12_Thread, &LockTest::Test12_Thread);
- }
- void Test12_Thread() {
- for (int i = 0; i < iter_count; i++) {
- RL(000);
- RL(100);
- RL(200);
- RL(300);
- RU(300);
- RU(200);
- RU(100);
- RU(000);
- }
- }
-
- void Test13() {
- if (test_number > 0 && test_number != 13) return;
- if (!LockType::supports_read_lock()) return;
- fprintf(stderr, "Starting Test13: 4 threads read lock/unlock 4 shared mutexes, all under another shared mutex\n");
- // CHECK-RD: Starting Test13
- Init(500);
- // CHECK-RD-NOT: WARNING: ThreadSanitizer:
- RunThreads(&LockTest::Test13_Thread, &LockTest::Test13_Thread,
- &LockTest::Test13_Thread, &LockTest::Test13_Thread);
- }
- void Test13_Thread() {
- for (int i = 0; i < iter_count; i++) {
- RL(0);
- RL(100);
- RU(100);
- RL(200);
- RU(200);
- RL(300);
- RU(300);
- RL(400);
- RU(400);
- RU(0);
- }
- }
-
- void Test14() {
- if (test_number > 0 && test_number != 14) return;
- fprintf(stderr, "Starting Test14: create lots of locks in 4 threads\n");
- Init(10);
- // CHECK-RD: Starting Test14
- RunThreads(&LockTest::CreateAndDestroyLocksLoop,
- &LockTest::CreateAndDestroyLocksLoop,
- &LockTest::CreateAndDestroyLocksLoop,
- &LockTest::CreateAndDestroyLocksLoop);
- }
-
- void Test15() {
- if (test_number > 0 && test_number != 15) return;
- if (!LockType::supports_read_lock()) return;
- fprintf(stderr, "Starting Test15: recursive rlock\n");
- // DISABLEDCHECK-RD: Starting Test15
- Init(5);
- RL(0); RL(0); RU(0); RU(0); // Recusrive reader lock.
- RL(0); RL(0); RL(0); RU(0); RU(0); RU(0); // Recusrive reader lock.
- }
-
- // More detailed output test.
- void Test16() {
- if (test_number > 0 && test_number != 16) return;
- fprintf(stderr, "Starting Test16: detailed output test with two locks\n");
- // CHECK: Starting Test16
- // CHECK: WARNING: ThreadSanitizer: lock-order-inversion
- // CHECK: acquired here while holding mutex
- // CHECK: LockTest::Acquire1
- // CHECK-NEXT: LockTest::Acquire_0_then_1
- // CHECK-SECOND: previously acquired by the same thread here
- // CHECK-SECOND: LockTest::Acquire0
- // CHECK-SECOND-NEXT: LockTest::Acquire_0_then_1
- // CHECK: acquired here while holding mutex
- // CHECK: LockTest::Acquire0
- // CHECK-NEXT: LockTest::Acquire_1_then_0
- // CHECK-SECOND: previously acquired by the same thread here
- // CHECK-SECOND: LockTest::Acquire1
- // CHECK-SECOND-NEXT: LockTest::Acquire_1_then_0
- Init(5);
- Acquire_0_then_1();
- U(0); U(1);
- Acquire_1_then_0();
- U(0); U(1);
- }
-
- // More detailed output test.
- void Test17() {
- if (test_number > 0 && test_number != 17) return;
- fprintf(stderr, "Starting Test17: detailed output test with three locks\n");
- // CHECK: Starting Test17
- // CHECK: WARNING: ThreadSanitizer: lock-order-inversion
- // CHECK: LockTest::Acquire1
- // CHECK-NEXT: LockTest::Acquire_0_then_1
- // CHECK: LockTest::Acquire2
- // CHECK-NEXT: LockTest::Acquire_1_then_2
- // CHECK: LockTest::Acquire0
- // CHECK-NEXT: LockTest::Acquire_2_then_0
- Init(5);
- Acquire_0_then_1();
- U(0); U(1);
- Acquire_1_then_2();
- U(1); U(2);
- Acquire_2_then_0();
- U(0); U(2);
- }
-
- __attribute__((noinline)) void Acquire2() { L(2); }
- __attribute__((noinline)) void Acquire1() { L(1); }
- __attribute__((noinline)) void Acquire0() { L(0); }
- __attribute__((noinline)) void Acquire_1_then_0() { Acquire1(); Acquire0(); }
- __attribute__((noinline)) void Acquire_0_then_1() { Acquire0(); Acquire1(); }
- __attribute__((noinline)) void Acquire_1_then_2() { Acquire1(); Acquire2(); }
- __attribute__((noinline)) void Acquire_2_then_0() { Acquire2(); Acquire0(); }
-
- // This test creates, locks, unlocks and destroys lots of mutexes.
- void Test18() {
- if (test_number > 0 && test_number != 18) return;
- fprintf(stderr, "Starting Test18: create, lock and destroy 4 locks; all in "
- "4 threads in a loop\n");
- RunThreads(&LockTest::Test18_Thread, &LockTest::Test18_Thread,
- &LockTest::Test18_Thread, &LockTest::Test18_Thread);
- }
-
- void Test18_Thread() {
- LockType *l = new LockType[4];
- for (size_t i = 0; i < iter_count / 100; i++) {
- for (int i = 0; i < 4; i++) l[i].lock();
- for (int i = 0; i < 4; i++) l[i].unlock();
- for (int i = 0; i < 4; i++) l[i].~LockType();
- for (int i = 0; i < 4; i++) new ((void*)&l[i]) LockType();
- }
- delete [] l;
- }
-
- void Test19() {
- if (test_number > 0 && test_number != 19) return;
- fprintf(stderr, "Starting Test19: lots of lock inversions\n");
- const int kNumLocks = 45;
- Init(kNumLocks);
- for (int i = 0; i < kNumLocks; i++) {
- for (int j = 0; j < kNumLocks; j++)
- L((i + j) % kNumLocks);
- for (int j = 0; j < kNumLocks; j++)
- U((i + j) % kNumLocks);
- }
- }
-
- private:
- void Lock2(size_t l1, size_t l2) { L(l1); L(l2); U(l2); U(l1); }
-
- template<bool wait = false>
- void Lock_0_1() {
- Lock2(0, 1);
- if (wait)
- barrier_wait(&barrier);
- }
-
- template<bool wait = false>
- void Lock_1_0() {
- if (wait)
- barrier_wait(&barrier);
- Lock2(1, 0);
- }
-
- void Lock1_Loop(size_t i, size_t n_iter) {
- for (size_t it = 0; it < n_iter; it++) {
- // if ((it & (it - 1)) == 0) fprintf(stderr, "%zd", i);
- L(i);
- U(i);
- }
- // fprintf(stderr, "\n");
- }
- void Lock1_Loop_0() { Lock1_Loop(0, iter_count); }
- void Lock1_Loop_1() { Lock1_Loop(10, iter_count); }
- void Lock1_Loop_2() { Lock1_Loop(20, iter_count); }
-
- void CreateAndDestroyManyLocks() {
- LockType *create_many_locks_but_never_acquire =
- new LockType[kDeadlockGraphSize];
- (void)create_many_locks_but_never_acquire;
- delete [] create_many_locks_but_never_acquire;
- }
-
- void CreateAndDestroyLocksLoop() {
- for (size_t it = 0; it <= iter_count; it++) {
- LockType some_locks[10];
- (void)some_locks;
- }
- }
-
- void CreateLockUnlockAndDestroyManyLocks() {
- LockType many_locks[kDeadlockGraphSize];
- for (size_t i = 0; i < kDeadlockGraphSize; i++) {
- many_locks[i].lock();
- many_locks[i].unlock();
- }
- }
-
- // LockTest Member function callback.
- struct CB {
- void (LockTest::*f)();
- LockTest *lt;
- };
-
- // Thread function with CB.
- static void *Thread(void *param) {
- CB *cb = (CB*)param;
- (cb->lt->*cb->f)();
- return NULL;
- }
-
- void RunThreads(void (LockTest::*f1)(), void (LockTest::*f2)(),
- void (LockTest::*f3)() = 0, void (LockTest::*f4)() = 0) {
- const int kNumThreads = 4;
- pthread_t t[kNumThreads];
- CB cb[kNumThreads] = {{f1, this}, {f2, this}, {f3, this}, {f4, this}};
- for (int i = 0; i < kNumThreads && cb[i].f; i++)
- pthread_create(&t[i], 0, Thread, &cb[i]);
- for (int i = 0; i < kNumThreads && cb[i].f; i++)
- pthread_join(t[i], 0);
- }
-
- static const size_t kDeadlockGraphSize = 4096;
- size_t n_;
- LockType **locks_;
-};
-
-int main(int argc, char **argv) {
- barrier_init(&barrier, 2);
- if (argc > 1)
- test_number = atoi(argv[1]);
- if (argc > 2)
- iter_count = atoi(argv[2]);
- LockTest().Test1();
- LockTest().Test2();
- LockTest().Test3();
- LockTest().Test4();
- LockTest().Test5();
- LockTest().Test6();
- LockTest().Test7();
- LockTest().Test8();
- LockTest().Test9();
- LockTest().Test10();
- LockTest().Test11();
- LockTest().Test12();
- LockTest().Test13();
- LockTest().Test14();
- LockTest().Test15();
- LockTest().Test16();
- LockTest().Test17();
- LockTest().Test18();
- LockTest().Test19();
- fprintf(stderr, "ALL-DONE\n");
- // CHECK: ALL-DONE
-}
Copied: compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cpp (from r367653, 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.cpp?p2=compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cpp&p1=compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/debug_alloc_stack.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/debug_alloc_stack.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/debug_alloc_stack.cc (original)
+++ compiler-rt/trunk/test/tsan/debug_alloc_stack.cc (removed)
@@ -1,84 +0,0 @@
-// RUN: %clangxx_tsan -O0 %s -o %t
-// RUN: env %env_tsan_opts=stack_trace_format=DEFAULT %deflake %run %t 2>&1 | FileCheck %s
-
-// Until I figure out how to make this test work on Linux
-// REQUIRES: system-darwin
-
-#include "test.h"
-#include <pthread.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifndef __APPLE__
-#include <sys/types.h>
-#endif
-
-extern "C" int __tsan_get_alloc_stack(void *addr, void **trace, size_t size,
- int *thread_id, uint64_t *os_id);
-
-char *mem;
-void alloc_func() { mem = (char *)malloc(10); }
-
-void *AllocThread(void *context) {
- uint64_t tid;
-#ifdef __APPLE__
- pthread_threadid_np(NULL, &tid);
-#else
- tid = gettid();
-#endif
- fprintf(stderr, "alloc stack thread os id = 0x%llx\n", tid);
- // CHECK: alloc stack thread os id = [[THREAD_OS_ID:0x[0-9a-f]+]]
- alloc_func();
- return NULL;
-}
-
-void *RaceThread(void *context) {
- *mem = 'a';
- barrier_wait(&barrier);
- return NULL;
-}
-
-int main() {
- pthread_t t;
- barrier_init(&barrier, 2);
-
- pthread_create(&t, NULL, AllocThread, NULL);
- pthread_join(t, NULL);
-
- void *trace[100];
- size_t num_frames = 100;
- int thread_id;
- uint64_t *thread_os_id;
- num_frames =
- __tsan_get_alloc_stack(mem, trace, num_frames, &thread_id, &thread_os_id);
-
- fprintf(stderr, "alloc stack retval %s\n",
- (num_frames > 0 && num_frames < 10) ? "ok" : "");
- // CHECK: alloc stack retval ok
- fprintf(stderr, "thread id = %d\n", thread_id);
- // CHECK: thread id = 1
- fprintf(stderr, "thread os id = 0x%llx\n", thread_os_id);
- // CHECK: thread os id = [[THREAD_OS_ID]]
- fprintf(stderr, "%p\n", trace[0]);
- // CHECK: [[ALLOC_FRAME_0:0x[0-9a-f]+]]
- fprintf(stderr, "%p\n", trace[1]);
- // CHECK: [[ALLOC_FRAME_1:0x[0-9a-f]+]]
- fprintf(stderr, "%p\n", trace[2]);
- // CHECK: [[ALLOC_FRAME_2:0x[0-9a-f]+]]
-
- pthread_create(&t, NULL, RaceThread, NULL);
- barrier_wait(&barrier);
- mem[0] = 'b';
- pthread_join(t, NULL);
-
- free(mem);
-
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Location is heap block of size 10 at {{.*}} allocated by thread T1
-// CHECK: #0 [[ALLOC_FRAME_0]]
-// CHECK: #1 [[ALLOC_FRAME_1]] in alloc_func
-// CHECK: #2 [[ALLOC_FRAME_2]] in AllocThread
Copied: compiler-rt/trunk/test/tsan/debug_alloc_stack.cpp (from r367653, compiler-rt/trunk/test/tsan/debug_alloc_stack.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/debug_alloc_stack.cpp?p2=compiler-rt/trunk/test/tsan/debug_alloc_stack.cpp&p1=compiler-rt/trunk/test/tsan/debug_alloc_stack.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/debug_locate.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/debug_locate.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/debug_locate.cc (original)
+++ compiler-rt/trunk/test/tsan/debug_locate.cc (removed)
@@ -1,43 +0,0 @@
-// RUN: %clangxx_tsan -O0 %s -o %t
-// RUN: %run %t 2>&1 | FileCheck %s
-
-#include <stdio.h>
-#include <stdlib.h>
-
-extern "C" const char *
-__tsan_locate_address(void *addr, char *name, size_t name_size,
- void **region_address_ptr, size_t *region_size_ptr);
-
-long global_var;
-
-int main() {
- long stack_var;
- void *heap_var = malloc(10);
-
- fprintf(stderr, "stack_var = %p\n", &stack_var);
- fprintf(stderr, "global_var = %p\n", &global_var);
- fprintf(stderr, "heap_var = %p\n", heap_var);
- // CHECK: stack_var = [[STACK_VAR:0x[0-9a-f]+]]
- // CHECK: global_var = [[GLOBAL_VAR:0x[0-9a-f]+]]
- // CHECK: heap_var = [[HEAP_VAR:0x[0-9a-f]+]]
-
- const char *type;
- char name[128];
- void *start;
- size_t size;
- type = __tsan_locate_address(&stack_var, name, 128, &start, &size);
- fprintf(stderr, "type: %s\n", type);
- // CHECK: type: stack
-
- type = __tsan_locate_address(&global_var, name, 128, &start, &size);
- fprintf(stderr, "type: %s, name = %s, start = %p, size = %zu\n", type, name,
- start, size);
- // CHECK: type: global, name = global_var, start = [[GLOBAL_VAR]], size = {{8|0}}
-
- type = __tsan_locate_address(heap_var, name, 128, &start, &size);
- fprintf(stderr, "type: %s, start = %p, size = %zu\n", type, start, size);
- // CHECK: type: heap, start = [[HEAP_VAR]], size = 10
-
- free(heap_var);
- return 0;
-}
Copied: compiler-rt/trunk/test/tsan/debug_locate.cpp (from r367653, compiler-rt/trunk/test/tsan/debug_locate.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/debug_locate.cpp?p2=compiler-rt/trunk/test/tsan/debug_locate.cpp&p1=compiler-rt/trunk/test/tsan/debug_locate.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/debugging.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/debugging.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/debugging.cc (original)
+++ compiler-rt/trunk/test/tsan/debugging.cc (removed)
@@ -1,109 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t
-// RUN: %deflake %run %t 2>&1 | FileCheck %s
-
-#include <pthread.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "test.h"
-
-extern "C" {
-void __tsan_on_report(void *report);
-void *__tsan_get_current_report();
-int __tsan_get_report_data(void *report, const char **description, int *count,
- int *stack_count, int *mop_count, int *loc_count,
- int *mutex_count, int *thread_count,
- int *unique_tid_count, void **sleep_trace,
- unsigned long trace_size);
-int __tsan_get_report_mop(void *report, unsigned long idx, int *tid,
- void **addr, int *size, int *write, int *atomic,
- void **trace, unsigned long trace_size);
-int __tsan_get_report_thread(void *report, unsigned long idx, int *tid,
- uint64_t *os_id, int *running,
- const char **name, int *parent_tid, void **trace,
- unsigned long trace_size);
-}
-
-long my_global;
-
-void *Thread(void *a) {
- barrier_wait(&barrier);
- my_global = 42;
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- fprintf(stderr, "&my_global = %p\n", &my_global);
- // CHECK: &my_global = [[GLOBAL:0x[0-9a-f]+]]
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- my_global = 41;
- barrier_wait(&barrier);
- pthread_join(t, 0);
- fprintf(stderr, "Done.\n");
-}
-
-void __tsan_on_report(void *report) {
- fprintf(stderr, "__tsan_on_report(%p)\n", report);
- fprintf(stderr, "__tsan_get_current_report() = %p\n",
- __tsan_get_current_report());
- // CHECK: __tsan_on_report([[REPORT:0x[0-9a-f]+]])
- // CHECK: __tsan_get_current_report() = [[REPORT]]
-
- const char *description;
- int count;
- int stack_count, mop_count, loc_count, mutex_count, thread_count,
- unique_tid_count;
- void *sleep_trace[16] = {0};
- __tsan_get_report_data(report, &description, &count, &stack_count, &mop_count,
- &loc_count, &mutex_count, &thread_count,
- &unique_tid_count, sleep_trace, 16);
- fprintf(stderr, "report type = '%s', count = %d\n", description, count);
- // CHECK: report type = 'data-race', count = 0
-
- fprintf(stderr, "mop_count = %d\n", mop_count);
- // CHECK: mop_count = 2
-
- int tid;
- void *addr;
- int size, write, atomic;
- void *trace[16] = {0};
-
- __tsan_get_report_mop(report, 0, &tid, &addr, &size, &write, &atomic, trace,
- 16);
- fprintf(stderr, "tid = %d, addr = %p, size = %d, write = %d, atomic = %d\n",
- tid, addr, size, write, atomic);
- // CHECK: tid = 1, addr = [[GLOBAL]], size = 8, write = 1, atomic = 0
- fprintf(stderr, "trace[0] = %p, trace[1] = %p\n", trace[0], trace[1]);
- // CHECK: trace[0] = 0x{{[0-9a-f]+}}, trace[1] = {{0x0|\(nil\)|\(null\)}}
-
- __tsan_get_report_mop(report, 1, &tid, &addr, &size, &write, &atomic, trace,
- 16);
- fprintf(stderr, "tid = %d, addr = %p, size = %d, write = %d, atomic = %d\n",
- tid, addr, size, write, atomic);
- // CHECK: tid = 0, addr = [[GLOBAL]], size = 8, write = 1, atomic = 0
- fprintf(stderr, "trace[0] = %p, trace[1] = %p\n", trace[0], trace[1]);
- // CHECK: trace[0] = 0x{{[0-9a-f]+}}, trace[1] = {{0x0|\(nil\)|\(null\)}}
-
- fprintf(stderr, "thread_count = %d\n", thread_count);
- // CHECK: thread_count = 2
-
- uint64_t os_id;
- int running;
- const char *name;
- int parent_tid;
-
- __tsan_get_report_thread(report, 0, &tid, &os_id, &running, &name, &parent_tid, trace, 16);
- fprintf(stderr, "tid = %d\n", tid);
- // CHECK: tid = 1
-
- __tsan_get_report_thread(report, 1, &tid, &os_id, &running, &name, &parent_tid, trace, 16);
- fprintf(stderr, "tid = %d\n", tid);
- // CHECK: tid = 0
-}
-
-// CHECK: Done.
-// CHECK: ThreadSanitizer: reported 1 warnings
Copied: compiler-rt/trunk/test/tsan/debugging.cpp (from r367653, compiler-rt/trunk/test/tsan/debugging.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/debugging.cpp?p2=compiler-rt/trunk/test/tsan/debugging.cpp&p1=compiler-rt/trunk/test/tsan/debugging.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/deep_stack1.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/deep_stack1.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/deep_stack1.cc (original)
+++ compiler-rt/trunk/test/tsan/deep_stack1.cc (removed)
@@ -1,57 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t -DORDER1 && %deflake %run %t | FileCheck %s
-// RUN: %clangxx_tsan -O1 %s -o %t -DORDER2 && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-volatile int X;
-volatile int N;
-void (*volatile F)();
-
-static void foo() {
- if (--N == 0)
- X = 42;
- else
- F();
-}
-
-void *Thread(void *p) {
-#ifdef ORDER1
- barrier_wait(&barrier);
-#endif
- F();
-#ifdef ORDER2
- barrier_wait(&barrier);
-#endif
- return 0;
-}
-
-static size_t RoundUp(size_t n, size_t to) {
- return ((n + to - 1) / to) * to;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- N = 50000;
- F = foo;
- pthread_t t;
- pthread_attr_t a;
- pthread_attr_init(&a);
- size_t stack_size = N * 256 + (1 << 20);
- stack_size = RoundUp(stack_size, 0x10000); // round the stack size to 64k
- int ret = pthread_attr_setstacksize(&a, stack_size);
- if (ret) abort();
- pthread_create(&t, &a, Thread, 0);
-#ifdef ORDER2
- barrier_wait(&barrier);
-#endif
- X = 43;
-#ifdef ORDER1
- barrier_wait(&barrier);
-#endif
-
- pthread_join(t, 0);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: #100 foo
-// We must output suffucuently large stack (at least 100 frames)
-
Copied: compiler-rt/trunk/test/tsan/deep_stack1.cpp (from r367653, compiler-rt/trunk/test/tsan/deep_stack1.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/deep_stack1.cpp?p2=compiler-rt/trunk/test/tsan/deep_stack1.cpp&p1=compiler-rt/trunk/test/tsan/deep_stack1.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/default_options.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/default_options.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/default_options.cc (original)
+++ compiler-rt/trunk/test/tsan/default_options.cc (removed)
@@ -1,32 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdio.h>
-
-extern "C" const char *__tsan_default_options() {
- return "report_bugs=0";
-}
-
-int Global;
-
-void *Thread1(void *x) {
- Global = 42;
- return NULL;
-}
-
-void *Thread2(void *x) {
- Global = 43;
- return NULL;
-}
-
-int main() {
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/default_options.cpp (from r367653, compiler-rt/trunk/test/tsan/default_options.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/default_options.cpp?p2=compiler-rt/trunk/test/tsan/default_options.cpp&p1=compiler-rt/trunk/test/tsan/default_options.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/dl_iterate_phdr.cc (original)
+++ compiler-rt/trunk/test/tsan/dl_iterate_phdr.cc (removed)
@@ -1,57 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -DBUILD_SO -fPIC -shared -o %t-so.so
-// RUN: %clangxx_tsan -O1 %s %link_libcxx_tsan -o %t && %run %t 2>&1 | FileCheck %s
-
-// dl_iterate_phdr doesn't exist on OS X.
-// UNSUPPORTED: darwin
-
-#ifdef BUILD_SO
-
-#include "test.h"
-
-int exported_var = 0;
-
-#else // BUILD_SO
-
-#include "test.h"
-#include <dlfcn.h>
-#include <link.h>
-#include <string.h>
-#include <string>
-
-static int callback(struct dl_phdr_info *info, size_t size, void *data) {
- if (info->dlpi_name[0] == '\0')
- info->dlpi_name = "/proc/self/exe";
- return !strcmp(info->dlpi_name, "non existent module");
-}
-
-void *thread(void *unused) {
- for (int i = 0; i < 1000; i++) {
- barrier_wait(&barrier);
- dl_iterate_phdr(callback, 0);
- }
- return 0;
-}
-
-int main(int argc, char *argv[]) {
- barrier_init(&barrier, 2);
- std::string path = std::string(argv[0]) + std::string("-so.so");
- pthread_t th;
- pthread_create(&th, 0, thread, 0);
- for (int i = 0; i < 1000; i++) {
- barrier_wait(&barrier);
- void *lib = dlopen(path.c_str(), RTLD_NOW);
- if (!lib) {
- printf("error in dlopen: %s\n", dlerror());
- return 1;
- }
- dlclose(lib);
- }
- pthread_join(th, 0);
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-#endif // BUILD_SO
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/dl_iterate_phdr.cpp (from r367653, compiler-rt/trunk/test/tsan/dl_iterate_phdr.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/dl_iterate_phdr.cpp?p2=compiler-rt/trunk/test/tsan/dl_iterate_phdr.cpp&p1=compiler-rt/trunk/test/tsan/dl_iterate_phdr.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/dlclose.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/dlclose.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/dlclose.cc (original)
+++ compiler-rt/trunk/test/tsan/dlclose.cc (removed)
@@ -1,56 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -DBUILD_SO -fPIC -shared -o %t-so.so
-// RUN: %clangxx_tsan -O1 %s %link_libcxx_tsan -o %t && %run %t 2>&1 | FileCheck %s
-
-// Test case for
-// https://github.com/google/sanitizers/issues/487
-
-#ifdef BUILD_SO
-
-#include <stdio.h>
-
-extern "C"
-void sofunc() {
- fprintf(stderr, "HELLO FROM SO\n");
-}
-
-#else // BUILD_SO
-
-#include <dlfcn.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <string>
-
-void *lib;
-void *lib2;
-
-struct Closer {
- ~Closer() {
- dlclose(lib);
- fprintf(stderr, "CLOSED SO\n");
- }
-};
-static Closer c;
-
-int main(int argc, char *argv[]) {
- lib = dlopen((std::string(argv[0]) + std::string("-so.so")).c_str(),
- RTLD_NOW|RTLD_NODELETE);
- if (lib == 0) {
- printf("error in dlopen: %s\n", dlerror());
- return 1;
- }
- void *f = dlsym(lib, "sofunc");
- if (f == 0) {
- printf("error in dlsym: %s\n", dlerror());
- return 1;
- }
- ((void(*)())f)();
- return 0;
-}
-
-#endif // BUILD_SO
-
-// CHECK: HELLO FROM SO
-// CHECK-NOT: Inconsistency detected by ld.so
-// CHECK: CLOSED SO
-
Copied: compiler-rt/trunk/test/tsan/dlclose.cpp (from r367653, compiler-rt/trunk/test/tsan/dlclose.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/dlclose.cpp?p2=compiler-rt/trunk/test/tsan/dlclose.cpp&p1=compiler-rt/trunk/test/tsan/dlclose.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/exceptions.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/exceptions.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/exceptions.cc (original)
+++ compiler-rt/trunk/test/tsan/exceptions.cc (removed)
@@ -1,185 +0,0 @@
-// RUN: %clangxx_tsan -O0 %s -o %t && %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-
-#include "test.h"
-#include <setjmp.h>
-
-__attribute__((noinline)) void throws_int() {
- throw 42;
-}
-
-__attribute__((noinline)) void callee_throws() {
- try {
- throws_int();
- } catch (int) { // NOLINT
- fprintf(stderr, "callee_throws caught exception\n");
- }
-}
-
-__attribute__((noinline)) void throws_catches_rethrows() {
- try {
- throws_int();
- } catch (int) { // NOLINT
- fprintf(stderr, "throws_catches_rethrows caught exception\n");
- throw;
- }
-}
-
-__attribute__((noinline)) void callee_rethrows() {
- try {
- throws_catches_rethrows();
- } catch (int) { // NOLINT
- fprintf(stderr, "callee_rethrows caught exception\n");
- }
-}
-
-__attribute__((noinline)) void throws_and_catches() {
- try {
- throws_int();
- } catch (int) { // NOLINT
- fprintf(stderr, "throws_and_catches caught exception\n");
- }
-}
-
-__attribute__((noinline)) void nested_try() {
- try {
- try {
- throws_int();
- } catch (double) { // NOLINT
- fprintf(stderr, "nested_try inner block caught exception\n");
- }
- } catch (int) { // NOLINT
- fprintf(stderr, "nested_try outer block caught exception\n");
- }
-}
-
-__attribute__((noinline)) void nested_try2() {
- try {
- try {
- throws_int();
- } catch (int) { // NOLINT
- fprintf(stderr, "nested_try inner block caught exception\n");
- }
- } catch (double) { // NOLINT
- fprintf(stderr, "nested_try outer block caught exception\n");
- }
-}
-
-class ClassWithDestructor {
- public:
- ClassWithDestructor() {
- fprintf(stderr, "ClassWithDestructor\n");
- }
- ~ClassWithDestructor() {
- fprintf(stderr, "~ClassWithDestructor\n");
- }
-};
-
-__attribute__((noinline)) void local_object_then_throw() {
- ClassWithDestructor obj;
- throws_int();
-}
-
-__attribute__((noinline)) void cpp_object_with_destructor() {
- try {
- local_object_then_throw();
- } catch (int) { // NOLINT
- fprintf(stderr, "cpp_object_with_destructor caught exception\n");
- }
-}
-
-__attribute__((noinline)) void recursive_call(long n) {
- if (n > 0) {
- recursive_call(n - 1);
- } else {
- throws_int();
- }
-}
-
-__attribute__((noinline)) void multiframe_unwind() {
- try {
- recursive_call(5);
- } catch (int) { // NOLINT
- fprintf(stderr, "multiframe_unwind caught exception\n");
- }
-}
-
-__attribute__((noinline)) void longjmp_unwind() {
- jmp_buf env;
- int i = setjmp(env);
- if (i != 0) {
- fprintf(stderr, "longjmp_unwind jumped\n");
- return;
- }
-
- try {
- longjmp(env, 42);
- } catch (int) { // NOLINT
- fprintf(stderr, "longjmp_unwind caught exception\n");
- }
-}
-
-__attribute__((noinline)) void recursive_call_longjmp(jmp_buf env, long n) {
- if (n > 0) {
- recursive_call_longjmp(env, n - 1);
- } else {
- longjmp(env, 42);
- }
-}
-
-__attribute__((noinline)) void longjmp_unwind_multiple_frames() {
- jmp_buf env;
- int i = setjmp(env);
- if (i != 0) {
- fprintf(stderr, "longjmp_unwind_multiple_frames jumped\n");
- return;
- }
-
- try {
- recursive_call_longjmp(env, 5);
- } catch (int) { // NOLINT
- fprintf(stderr, "longjmp_unwind_multiple_frames caught exception\n");
- }
-}
-
-#define CHECK_SHADOW_STACK(val) \
- fprintf(stderr, (val == __tsan_testonly_shadow_stack_current_size() \
- ? "OK.\n" \
- : "Shadow stack leak!\n"));
-
-int main(int argc, const char * argv[]) {
- fprintf(stderr, "Hello, World!\n");
- unsigned long shadow_stack_size = __tsan_testonly_shadow_stack_current_size();
-
- throws_and_catches();
- CHECK_SHADOW_STACK(shadow_stack_size);
-
- callee_throws();
- CHECK_SHADOW_STACK(shadow_stack_size);
-
- callee_rethrows();
- CHECK_SHADOW_STACK(shadow_stack_size);
-
- nested_try();
- CHECK_SHADOW_STACK(shadow_stack_size);
-
- nested_try2();
- CHECK_SHADOW_STACK(shadow_stack_size);
-
- cpp_object_with_destructor();
- CHECK_SHADOW_STACK(shadow_stack_size);
-
- multiframe_unwind();
- CHECK_SHADOW_STACK(shadow_stack_size);
-
- longjmp_unwind();
- CHECK_SHADOW_STACK(shadow_stack_size);
-
- longjmp_unwind_multiple_frames();
- CHECK_SHADOW_STACK(shadow_stack_size);
-
- return 0;
-}
-
-// CHECK: Hello, World!
-// CHECK-NOT: Shadow stack leak
Copied: compiler-rt/trunk/test/tsan/exceptions.cpp (from r367653, compiler-rt/trunk/test/tsan/exceptions.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/exceptions.cpp?p2=compiler-rt/trunk/test/tsan/exceptions.cpp&p1=compiler-rt/trunk/test/tsan/exceptions.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_close_norace.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_close_norace.cc (removed)
@@ -1,33 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "test.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-void *Thread1(void *x) {
- int f = open("/dev/random", O_RDONLY);
- close(f);
- barrier_wait(&barrier);
- return NULL;
-}
-
-void *Thread2(void *x) {
- barrier_wait(&barrier);
- int f = open("/dev/random", O_RDONLY);
- close(f);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- fprintf(stderr, "OK\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-
-
Copied: compiler-rt/trunk/test/tsan/fd_close_norace.cpp (from r367653, compiler-rt/trunk/test/tsan/fd_close_norace.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_close_norace.cpp?p2=compiler-rt/trunk/test/tsan/fd_close_norace.cpp&p1=compiler-rt/trunk/test/tsan/fd_close_norace.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_close_norace2.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_close_norace2.cc (removed)
@@ -1,30 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdio.h>
-#include <unistd.h>
-
-int pipes[2];
-
-void *Thread(void *x) {
- // wait for shutown signal
- while (read(pipes[0], &x, 1) != 1) {
- }
- close(pipes[0]);
- close(pipes[1]);
- return 0;
-}
-
-int main() {
- if (pipe(pipes))
- return 1;
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- // send shutdown signal
- while (write(pipes[1], &t, 1) != 1) {
- }
- pthread_join(t, 0);
- fprintf(stderr, "OK\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK: OK
Copied: compiler-rt/trunk/test/tsan/fd_close_norace2.cpp (from r367653, compiler-rt/trunk/test/tsan/fd_close_norace2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_close_norace2.cpp?p2=compiler-rt/trunk/test/tsan/fd_close_norace2.cpp&p1=compiler-rt/trunk/test/tsan/fd_close_norace2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_dup_norace.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_dup_norace.cc (removed)
@@ -1,34 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-int fds[2];
-
-void *Thread1(void *x) {
- char buf;
- read(fds[0], &buf, 1);
- close(fds[0]);
- return 0;
-}
-
-void *Thread2(void *x) {
- close(fds[1]);
- return 0;
-}
-
-int main() {
- fds[0] = open("/dev/random", O_RDONLY);
- fds[1] = dup2(fds[0], 100);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- fprintf(stderr, "OK\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/fd_dup_norace.cpp (from r367653, compiler-rt/trunk/test/tsan/fd_dup_norace.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_dup_norace.cpp?p2=compiler-rt/trunk/test/tsan/fd_dup_norace.cpp&p1=compiler-rt/trunk/test/tsan/fd_dup_norace.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_dup_norace2.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_dup_norace2.cc (removed)
@@ -1,60 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "test.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-
-// dup2(oldfd, newfd) races with read(newfd).
-// This is not reported as race because:
-// 1. Some software dups a closed pipe in place of a socket before closing
-// the socket (to prevent races actually).
-// 2. Some daemons dup /dev/null in place of stdin/stdout.
-
-int fd;
-
-void *Thread(void *x) {
- char buf;
- int n = read(fd, &buf, 1);
- if (n != 1) {
- // This read can "legitimately" fail regadless of the fact that glibc claims
- // that "there is no instant in the middle of calling dup2 at which new is
- // closed and not yet a duplicate of old". Strace of the failing runs
- // looks as follows:
- //
- // [pid 122196] open("/dev/urandom", O_RDONLY) = 3
- // [pid 122196] open("/dev/urandom", O_RDONLY) = 4
- // Process 122382 attached
- // [pid 122382] read(3, <unfinished ...>
- // [pid 122196] dup2(4, 3 <unfinished ...>
- // [pid 122382] <... read resumed> 0x7fcd139960b7, 1) = -1 EBADF (Bad file descriptor)
- // [pid 122196] <... dup2 resumed> ) = 3
- // read failed: n=-1 errno=9
- //
- // The failing read does not interfere with what this test tests,
- // so we just ignore the failure.
- //
- // exit(printf("read failed: n=%d errno=%d\n", n, errno));
- }
- return 0;
-}
-
-int main() {
- fd = open("/dev/urandom", O_RDONLY);
- int fd2 = open("/dev/urandom", O_RDONLY);
- if (fd == -1 || fd2 == -1)
- exit(printf("open failed\n"));
- pthread_t th;
- pthread_create(&th, 0, Thread, 0);
- if (dup2(fd2, fd) == -1)
- exit(printf("dup2 failed\n"));
- pthread_join(th, 0);
- if (close(fd) == -1)
- exit(printf("close failed\n"));
- if (close(fd2) == -1)
- exit(printf("close failed\n"));
- fprintf(stderr, "DONE\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/fd_dup_norace2.cpp (from r367653, compiler-rt/trunk/test/tsan/fd_dup_norace2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_dup_norace2.cpp?p2=compiler-rt/trunk/test/tsan/fd_dup_norace2.cpp&p1=compiler-rt/trunk/test/tsan/fd_dup_norace2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_dup_race.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_dup_race.cc (removed)
@@ -1,33 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
-#include "test.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-// dup2(oldfd, newfd) races with close(newfd).
-
-int fd;
-
-void *Thread(void *x) {
- barrier_wait(&barrier);
- if (close(fd) == -1)
- exit(printf("close failed\n"));
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- fd = open("/dev/random", O_RDONLY);
- int fd2 = open("/dev/random", O_RDONLY);
- if (fd == -1 || fd2 == -1)
- exit(printf("open failed\n"));
- pthread_t th;
- pthread_create(&th, 0, Thread, 0);
- if (dup2(fd2, fd) == -1)
- exit(printf("dup2 failed\n"));
- barrier_wait(&barrier);
- pthread_join(th, 0);
- fprintf(stderr, "DONE\n");
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/fd_dup_race.cpp (from r367653, compiler-rt/trunk/test/tsan/fd_dup_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_dup_race.cpp?p2=compiler-rt/trunk/test/tsan/fd_dup_race.cpp&p1=compiler-rt/trunk/test/tsan/fd_dup_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/fd_location.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_location.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_location.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_location.cc (removed)
@@ -1,33 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-int fds[2];
-
-void *Thread1(void *x) {
- write(fds[1], "a", 1);
- barrier_wait(&barrier);
- return NULL;
-}
-
-void *Thread2(void *x) {
- barrier_wait(&barrier);
- close(fds[0]);
- close(fds[1]);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pipe(fds);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Location is file descriptor {{[0-9]+}} created by main thread at:
-// CHECK: #0 pipe
-// CHECK: #1 main
-
Copied: compiler-rt/trunk/test/tsan/fd_location.cpp (from r367653, compiler-rt/trunk/test/tsan/fd_location.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_location.cpp?p2=compiler-rt/trunk/test/tsan/fd_location.cpp&p1=compiler-rt/trunk/test/tsan/fd_location.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_pipe_norace.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_pipe_norace.cc (removed)
@@ -1,33 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdio.h>
-#include <unistd.h>
-
-int fds[2];
-int X;
-
-void *Thread1(void *x) {
- X = 42;
- write(fds[1], "a", 1);
- return NULL;
-}
-
-void *Thread2(void *x) {
- char buf;
- while (read(fds[0], &buf, 1) != 1) {
- }
- X = 43;
- return NULL;
-}
-
-int main() {
- pipe(fds);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- fprintf(stderr, "OK\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/fd_pipe_norace.cpp (from r367653, compiler-rt/trunk/test/tsan/fd_pipe_norace.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_pipe_norace.cpp?p2=compiler-rt/trunk/test/tsan/fd_pipe_norace.cpp&p1=compiler-rt/trunk/test/tsan/fd_pipe_norace.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/fd_pipe_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_pipe_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_pipe_race.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_pipe_race.cc (removed)
@@ -1,37 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-int fds[2];
-
-void *Thread1(void *x) {
- write(fds[1], "a", 1);
- barrier_wait(&barrier);
- return NULL;
-}
-
-void *Thread2(void *x) {
- barrier_wait(&barrier);
- close(fds[0]);
- close(fds[1]);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pipe(fds);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Write of size 8
-// CHECK: #0 close
-// CHECK: #1 Thread2
-// CHECK: Previous read of size 8
-// CHECK: #0 write
-// CHECK: #1 Thread1
-
-
Copied: compiler-rt/trunk/test/tsan/fd_pipe_race.cpp (from r367653, compiler-rt/trunk/test/tsan/fd_pipe_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_pipe_race.cpp?p2=compiler-rt/trunk/test/tsan/fd_pipe_race.cpp&p1=compiler-rt/trunk/test/tsan/fd_pipe_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_socket_connect_norace.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_socket_connect_norace.cc (removed)
@@ -1,62 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <arpa/inet.h>
-#include <assert.h>
-#include <netinet/in.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-struct sockaddr_in addr4;
-struct sockaddr_in6 addr6;
-struct sockaddr *addr;
-socklen_t addrlen;
-int X;
-
-void *ClientThread(void *x) {
- int c = socket(addr->sa_family, SOCK_STREAM, IPPROTO_TCP);
- X = 42;
- if (connect(c, addr, addrlen)) {
- perror("connect");
- exit(1);
- }
- close(c);
- return NULL;
-}
-
-int main() {
- addr4.sin_family = AF_INET;
- addr4.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
- addr4.sin_port = INADDR_ANY;
- addr = (struct sockaddr *)&addr4;
- addrlen = sizeof(addr4);
-
- int s = socket(addr->sa_family, SOCK_STREAM, IPPROTO_TCP);
- if (s <= 0) {
- // Try to fall-back to IPv6
- addr6.sin6_family = AF_INET6;
- addr6.sin6_addr = in6addr_loopback;
- addr6.sin6_port = INADDR_ANY;
- addr = (struct sockaddr *)&addr6;
- addrlen = sizeof(addr6);
- s = socket(addr->sa_family, SOCK_STREAM, IPPROTO_TCP);
- }
- assert(s > 0);
-
- bind(s, addr, addrlen);
- getsockname(s, addr, &addrlen);
- listen(s, 10);
- pthread_t t;
- pthread_create(&t, 0, ClientThread, 0);
- int c = accept(s, 0, 0);
- X = 42;
- pthread_join(t, 0);
- close(c);
- close(s);
- fprintf(stderr, "OK\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-
Copied: compiler-rt/trunk/test/tsan/fd_socket_connect_norace.cpp (from r367653, 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.cpp?p2=compiler-rt/trunk/test/tsan/fd_socket_connect_norace.cpp&p1=compiler-rt/trunk/test/tsan/fd_socket_connect_norace.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_socket_norace.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_socket_norace.cc (removed)
@@ -1,69 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <arpa/inet.h>
-#include <assert.h>
-#include <netinet/in.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-struct sockaddr_in addr4;
-struct sockaddr_in6 addr6;
-struct sockaddr *addr;
-socklen_t addrlen;
-int X;
-
-void *ClientThread(void *x) {
- X = 42;
- int c = socket(addr->sa_family, SOCK_STREAM, IPPROTO_TCP);
- if (connect(c, addr, addrlen)) {
- perror("connect");
- exit(1);
- }
- if (send(c, "a", 1, 0) != 1) {
- perror("send");
- exit(1);
- }
- close(c);
- return NULL;
-}
-
-int main() {
- addr4.sin_family = AF_INET;
- addr4.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
- addr4.sin_port = INADDR_ANY;
- addr = (struct sockaddr *)&addr4;
- addrlen = sizeof(addr4);
-
- int s = socket(addr->sa_family, SOCK_STREAM, IPPROTO_TCP);
- if (s <= 0) {
- // Try to fall-back to IPv6
- addr6.sin6_family = AF_INET6;
- addr6.sin6_addr = in6addr_loopback;
- addr6.sin6_port = INADDR_ANY;
- addr = (struct sockaddr *)&addr6;
- addrlen = sizeof(addr6);
- s = socket(addr->sa_family, SOCK_STREAM, IPPROTO_TCP);
- }
- assert(s > 0);
-
- bind(s, addr, addrlen);
- getsockname(s, addr, &addrlen);
- listen(s, 10);
- pthread_t t;
- pthread_create(&t, 0, ClientThread, 0);
- int c = accept(s, 0, 0);
- char buf;
- while (read(c, &buf, 1) != 1) {
- }
- X = 43;
- close(c);
- close(s);
- pthread_join(t, 0);
- fprintf(stderr, "OK\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-
Copied: compiler-rt/trunk/test/tsan/fd_socket_norace.cpp (from r367653, compiler-rt/trunk/test/tsan/fd_socket_norace.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_socket_norace.cpp?p2=compiler-rt/trunk/test/tsan/fd_socket_norace.cpp&p1=compiler-rt/trunk/test/tsan/fd_socket_norace.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_socketpair_norace.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_socketpair_norace.cc (removed)
@@ -1,37 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-
-int fds[2];
-int X;
-
-void *Thread1(void *x) {
- X = 42;
- write(fds[1], "a", 1);
- close(fds[1]);
- return NULL;
-}
-
-void *Thread2(void *x) {
- char buf;
- while (read(fds[0], &buf, 1) != 1) {
- }
- X = 43;
- close(fds[0]);
- return NULL;
-}
-
-int main() {
- socketpair(AF_UNIX, SOCK_STREAM, 0, fds);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- fprintf(stderr, "OK\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/fd_socketpair_norace.cpp (from r367653, compiler-rt/trunk/test/tsan/fd_socketpair_norace.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_socketpair_norace.cpp?p2=compiler-rt/trunk/test/tsan/fd_socketpair_norace.cpp&p1=compiler-rt/trunk/test/tsan/fd_socketpair_norace.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/fd_stdout_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_stdout_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_stdout_race.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_stdout_race.cc (removed)
@@ -1,41 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-int X;
-
-void *Thread1(void *x) {
- barrier_wait(&barrier);
- int f = open("/dev/random", O_RDONLY);
- char buf;
- read(f, &buf, 1);
- close(f);
- X = 42;
- return NULL;
-}
-
-void *Thread2(void *x) {
- X = 43;
- write(STDOUT_FILENO, "a", 1);
- barrier_wait(&barrier);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Write of size 4
-// CHECK: #0 Thread1
-// CHECK: Previous write of size 4
-// CHECK: #0 Thread2
-
-
Copied: compiler-rt/trunk/test/tsan/fd_stdout_race.cpp (from r367653, compiler-rt/trunk/test/tsan/fd_stdout_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_stdout_race.cpp?p2=compiler-rt/trunk/test/tsan/fd_stdout_race.cpp&p1=compiler-rt/trunk/test/tsan/fd_stdout_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/fd_tid_recycled.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_tid_recycled.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fd_tid_recycled.cc (original)
+++ compiler-rt/trunk/test/tsan/fd_tid_recycled.cc (removed)
@@ -1,54 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-int fds[2];
-
-void *ThreadCreatePipe(void *x) {
- pipe(fds);
- return NULL;
-}
-
-void *ThreadDummy(void *x) {
- return NULL;
-}
-
-void *ThreadWrite(void *x) {
- write(fds[1], "a", 1);
- barrier_wait(&barrier);
- return NULL;
-}
-
-void *ThreadClose(void *x) {
- barrier_wait(&barrier);
- close(fds[0]);
- close(fds[1]);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t_create;
- pthread_create(&t_create, NULL, ThreadCreatePipe, NULL);
- pthread_join(t_create, NULL);
-
- for (int i = 0; i < 100; i++) {
- pthread_t t_dummy;
- pthread_create(&t_dummy, NULL, ThreadDummy, NULL);
- pthread_join(t_dummy, NULL);
- }
-
- pthread_t t[2];
- pthread_create(&t[0], NULL, ThreadWrite, NULL);
- pthread_create(&t[1], NULL, ThreadClose, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
-}
-
-// CHECK-NOT: CHECK failed
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Write of size 8
-// CHECK: #0 close
-// CHECK: #1 ThreadClose
-// CHECK: Previous read of size 8
-// CHECK: #0 write
-// CHECK: #1 ThreadWrite
Copied: compiler-rt/trunk/test/tsan/fd_tid_recycled.cpp (from r367653, compiler-rt/trunk/test/tsan/fd_tid_recycled.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fd_tid_recycled.cpp?p2=compiler-rt/trunk/test/tsan/fd_tid_recycled.cpp&p1=compiler-rt/trunk/test/tsan/fd_tid_recycled.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/fiber_asm.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fiber_asm.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fiber_asm.cc (original)
+++ compiler-rt/trunk/test/tsan/fiber_asm.cc (removed)
@@ -1,86 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-// REQUIRES: x86_64-target-arch
-// UNSUPPORTED: tvos, watchos
-#include "test.h"
-
-struct ucontext {
- void *sp;
- void *fiber;
-};
-
-extern "C" {
- void ucontext_do_switch(void **save, void **load);
- void ucontext_trampoline();
-}
-
-__asm__(".global " ASM_SYMBOL(ucontext_do_switch) "\n"
- ASM_SYMBOL(ucontext_do_switch) ":\n\t"
- "pushq %rbp\n\t"
- "pushq %r15\n\t"
- "pushq %r14\n\t"
- "pushq %r13\n\t"
- "pushq %r12\n\t"
- "pushq %rbx\n\t"
- "movq %rsp, (%rdi)\n\t"
- "movq (%rsi), %rsp\n\t"
- "popq %rbx\n\t"
- "popq %r12\n\t"
- "popq %r13\n\t"
- "popq %r14\n\t"
- "popq %r15\n\t"
- "popq %rbp\n\t"
- "retq");
-
-__asm__(".global " ASM_SYMBOL(ucontext_trampoline) "\n"
- ASM_SYMBOL(ucontext_trampoline) ":\n\t"
- ".cfi_startproc\n\t"
- ".cfi_undefined rip\n\t"
- "movq %r12, %rdi\n\t"
- "jmpq *%rbx\n\t"
- ".cfi_endproc");
-
-void ucontext_init(ucontext *context, void *stack, unsigned stack_sz,
- void (*func)(void*), void *arg) {
- void **sp = reinterpret_cast<void **>(static_cast<char *>(stack) + stack_sz);
- *(--sp) = 0;
- *(--sp) = reinterpret_cast<void *>(ucontext_trampoline);
- *(--sp) = 0; // rbp
- *(--sp) = 0; // r15
- *(--sp) = 0; // r14
- *(--sp) = 0; // r13
- *(--sp) = arg; // r12
- *(--sp) = reinterpret_cast<void *>(func); // rbx
- context->sp = sp;
- context->fiber = __tsan_create_fiber(0);
-}
-
-void ucontext_free(ucontext *context) {
- __tsan_destroy_fiber(context->fiber);
-}
-
-__attribute__((no_sanitize_thread))
-void ucontext_switch(ucontext *save, ucontext *load) {
- save->fiber = __tsan_get_current_fiber();
- __tsan_switch_to_fiber(load->fiber, 0);
- ucontext_do_switch(&save->sp, &load->sp);
-}
-
-char stack[64 * 1024] __attribute__((aligned(16)));
-
-ucontext uc, orig_uc;
-
-void func(void *arg) {
- __asm__ __volatile__(".cfi_undefined rip");
- ucontext_switch(&uc, &orig_uc);
-}
-
-int main() {
- ucontext_init(&uc, stack, sizeof(stack), func, 0);
- ucontext_switch(&orig_uc, &uc);
- ucontext_free(&uc);
- fprintf(stderr, "PASS\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer:
-// CHECK: PASS
Copied: compiler-rt/trunk/test/tsan/fiber_asm.cpp (from r367653, compiler-rt/trunk/test/tsan/fiber_asm.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fiber_asm.cpp?p2=compiler-rt/trunk/test/tsan/fiber_asm.cpp&p1=compiler-rt/trunk/test/tsan/fiber_asm.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/fiber_from_thread.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fiber_from_thread.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fiber_from_thread.cc (original)
+++ compiler-rt/trunk/test/tsan/fiber_from_thread.cc (removed)
@@ -1,49 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-// UNSUPPORTED: tvos, watchos
-// XFAIL: ios && !iossim
-#include "sanitizer_common/sanitizer_ucontext.h"
-#include "test.h"
-
-char stack[64 * 1024] __attribute__((aligned(16)));
-
-ucontext_t uc, orig_uc1, orig_uc2;
-void *fiber, *orig_fiber1, *orig_fiber2;
-
-int var;
-
-void *Thread(void *x) {
- orig_fiber2 = __tsan_get_current_fiber();
- swapcontext(&orig_uc2, &orig_uc1);
- return 0;
-}
-
-void func() {
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- pthread_join(t, 0);
- __tsan_switch_to_fiber(orig_fiber1, 0);
- swapcontext(&uc, &orig_uc1);
-}
-
-int main() {
- orig_fiber1 = __tsan_get_current_fiber();
- fiber = __tsan_create_fiber(0);
- getcontext(&uc);
- uc.uc_stack.ss_sp = stack;
- uc.uc_stack.ss_size = sizeof(stack);
- uc.uc_link = 0;
- makecontext(&uc, func, 0);
- var = 1;
- __tsan_switch_to_fiber(fiber, 0);
- swapcontext(&orig_uc1, &uc);
- var = 2;
- __tsan_switch_to_fiber(orig_fiber2, 0);
- swapcontext(&orig_uc1, &orig_uc2);
- var = 3;
- __tsan_destroy_fiber(fiber);
- fprintf(stderr, "PASS\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer:
-// CHECK: PASS
Copied: compiler-rt/trunk/test/tsan/fiber_from_thread.cpp (from r367653, compiler-rt/trunk/test/tsan/fiber_from_thread.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fiber_from_thread.cpp?p2=compiler-rt/trunk/test/tsan/fiber_from_thread.cpp&p1=compiler-rt/trunk/test/tsan/fiber_from_thread.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/fiber_longjmp.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fiber_longjmp.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fiber_longjmp.cc (original)
+++ compiler-rt/trunk/test/tsan/fiber_longjmp.cc (removed)
@@ -1,81 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-// UNSUPPORTED: tvos, watchos
-// XFAIL: ios && !iossim
-#include "sanitizer_common/sanitizer_ucontext.h"
-#include "test.h"
-#include <setjmp.h>
-
-char stack[64 * 1024] __attribute__((aligned(16)));
-
-sigjmp_buf jmpbuf, orig_jmpbuf[2];
-void *fiber, *orig_fiber[2];
-
-const unsigned N = 1000;
-
-__attribute__((noinline))
-void switch0() {
- if (!sigsetjmp(jmpbuf, 0)) {
- __tsan_switch_to_fiber(orig_fiber[0], 0);
- siglongjmp(orig_jmpbuf[0], 1);
- }
-}
-
-void func() {
- if (!sigsetjmp(jmpbuf, 0)) {
- __tsan_switch_to_fiber(orig_fiber[0], 0);
- siglongjmp(orig_jmpbuf[0], 1);
- }
- for (;;) {
- switch0();
- if (!sigsetjmp(jmpbuf, 0)) {
- __tsan_switch_to_fiber(orig_fiber[1], 0);
- siglongjmp(orig_jmpbuf[1], 1);
- }
- }
-}
-
-void *Thread(void *x) {
- orig_fiber[1] = __tsan_get_current_fiber();
- for (unsigned i = 0; i < N; i++) {
- barrier_wait(&barrier);
- if (!sigsetjmp(orig_jmpbuf[1], 0)) {
- __tsan_switch_to_fiber(fiber, 0);
- siglongjmp(jmpbuf, 1);
- }
- barrier_wait(&barrier);
- }
- return 0;
-}
-
-int main() {
- fiber = __tsan_create_fiber(0);
- barrier_init(&barrier, 2);
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- orig_fiber[0] = __tsan_get_current_fiber();
- ucontext_t uc, orig_uc;
- getcontext(&uc);
- uc.uc_stack.ss_sp = stack;
- uc.uc_stack.ss_size = sizeof(stack);
- uc.uc_link = 0;
- makecontext(&uc, func, 0);
- if (!sigsetjmp(orig_jmpbuf[0], 0)) {
- __tsan_switch_to_fiber(fiber, 0);
- swapcontext(&orig_uc, &uc);
- }
- for (unsigned i = 0; i < N; i++) {
- if (!sigsetjmp(orig_jmpbuf[0], 0)) {
- __tsan_switch_to_fiber(fiber, 0);
- siglongjmp(jmpbuf, 1);
- }
- barrier_wait(&barrier);
- barrier_wait(&barrier);
- }
- pthread_join(t, 0);
- __tsan_destroy_fiber(fiber);
- fprintf(stderr, "PASS\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer:
-// CHECK: PASS
Copied: compiler-rt/trunk/test/tsan/fiber_longjmp.cpp (from r367653, compiler-rt/trunk/test/tsan/fiber_longjmp.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fiber_longjmp.cpp?p2=compiler-rt/trunk/test/tsan/fiber_longjmp.cpp&p1=compiler-rt/trunk/test/tsan/fiber_longjmp.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/fiber_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fiber_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fiber_race.cc (original)
+++ compiler-rt/trunk/test/tsan/fiber_race.cc (removed)
@@ -1,37 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
-// UNSUPPORTED: tvos, watchos
-// XFAIL: ios && !iossim
-#include "sanitizer_common/sanitizer_ucontext.h"
-#include "test.h"
-
-char stack[64 * 1024] __attribute__((aligned(16)));
-
-ucontext_t uc, orig_uc;
-void *fiber, *orig_fiber;
-
-int var;
-
-void func() {
- var = 1;
- __tsan_switch_to_fiber(orig_fiber, __tsan_switch_to_fiber_no_sync);
- swapcontext(&uc, &orig_uc);
-}
-
-int main() {
- orig_fiber = __tsan_get_current_fiber();
- fiber = __tsan_create_fiber(0);
- getcontext(&uc);
- uc.uc_stack.ss_sp = stack;
- uc.uc_stack.ss_size = sizeof(stack);
- uc.uc_link = 0;
- makecontext(&uc, func, 0);
- var = 2;
- __tsan_switch_to_fiber(fiber, __tsan_switch_to_fiber_no_sync);
- swapcontext(&orig_uc, &uc);
- __tsan_destroy_fiber(fiber);
- fprintf(stderr, "PASS\n");
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: PASS
Copied: compiler-rt/trunk/test/tsan/fiber_race.cpp (from r367653, compiler-rt/trunk/test/tsan/fiber_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fiber_race.cpp?p2=compiler-rt/trunk/test/tsan/fiber_race.cpp&p1=compiler-rt/trunk/test/tsan/fiber_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/fiber_simple.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fiber_simple.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fiber_simple.cc (original)
+++ compiler-rt/trunk/test/tsan/fiber_simple.cc (removed)
@@ -1,37 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-// UNSUPPORTED: tvos, watchos
-// XFAIL: ios && !iossim
-#include "sanitizer_common/sanitizer_ucontext.h"
-#include "test.h"
-
-char stack[64 * 1024] __attribute__((aligned(16)));
-
-ucontext_t uc, orig_uc;
-void *fiber, *orig_fiber;
-
-int var;
-
-void func() {
- var = 1;
- __tsan_switch_to_fiber(orig_fiber, 0);
- swapcontext(&uc, &orig_uc);
-}
-
-int main() {
- orig_fiber = __tsan_get_current_fiber();
- fiber = __tsan_create_fiber(0);
- getcontext(&uc);
- uc.uc_stack.ss_sp = stack;
- uc.uc_stack.ss_size = sizeof(stack);
- uc.uc_link = 0;
- makecontext(&uc, func, 0);
- var = 2;
- __tsan_switch_to_fiber(fiber, 0);
- swapcontext(&orig_uc, &uc);
- __tsan_destroy_fiber(fiber);
- fprintf(stderr, "PASS\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer:
-// CHECK: PASS
Copied: compiler-rt/trunk/test/tsan/fiber_simple.cpp (from r367653, compiler-rt/trunk/test/tsan/fiber_simple.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fiber_simple.cpp?p2=compiler-rt/trunk/test/tsan/fiber_simple.cpp&p1=compiler-rt/trunk/test/tsan/fiber_simple.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/fiber_two_threads.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fiber_two_threads.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fiber_two_threads.cc (original)
+++ compiler-rt/trunk/test/tsan/fiber_two_threads.cc (removed)
@@ -1,63 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-// UNSUPPORTED: tvos, watchos
-// XFAIL: ios && !iossim
-#include "sanitizer_common/sanitizer_ucontext.h"
-#include "test.h"
-
-char stack[64 * 1024] __attribute__((aligned(16)));
-
-ucontext_t uc, orig_uc[2];
-void *fiber, *orig_fiber[2];
-
-const unsigned N = 1000;
-
-__attribute__((noinline))
-void switch0() {
- __tsan_switch_to_fiber(orig_fiber[0], 0);
- swapcontext(&uc, &orig_uc[0]);
-}
-
-void func() {
- for (;;) {
- switch0();
- __tsan_switch_to_fiber(orig_fiber[1], 0);
- swapcontext(&uc, &orig_uc[1]);
- }
-}
-
-void *Thread(void *x) {
- orig_fiber[1] = __tsan_get_current_fiber();
- for (unsigned i = 0; i < N; i++) {
- barrier_wait(&barrier);
- __tsan_switch_to_fiber(fiber, 0);
- swapcontext(&orig_uc[1], &uc);
- barrier_wait(&barrier);
- }
- return 0;
-}
-
-int main() {
- fiber = __tsan_create_fiber(0);
- barrier_init(&barrier, 2);
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- orig_fiber[0] = __tsan_get_current_fiber();
- getcontext(&uc);
- uc.uc_stack.ss_sp = stack;
- uc.uc_stack.ss_size = sizeof(stack);
- uc.uc_link = 0;
- makecontext(&uc, func, 0);
- for (unsigned i = 0; i < N; i++) {
- __tsan_switch_to_fiber(fiber, 0);
- swapcontext(&orig_uc[0], &uc);
- barrier_wait(&barrier);
- barrier_wait(&barrier);
- }
- pthread_join(t, 0);
- __tsan_destroy_fiber(fiber);
- fprintf(stderr, "PASS\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer:
-// CHECK: PASS
Copied: compiler-rt/trunk/test/tsan/fiber_two_threads.cpp (from r367653, compiler-rt/trunk/test/tsan/fiber_two_threads.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fiber_two_threads.cpp?p2=compiler-rt/trunk/test/tsan/fiber_two_threads.cpp&p1=compiler-rt/trunk/test/tsan/fiber_two_threads.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/fork_atexit.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fork_atexit.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fork_atexit.cc (original)
+++ compiler-rt/trunk/test/tsan/fork_atexit.cc (removed)
@@ -1,37 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %env_tsan_opts=atexit_sleep_ms=50 %run %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-void foo() {
- fprintf(stderr, "CHILD ATEXIT\n");
-}
-
-void *worker(void *unused) {
- return 0;
-}
-
-int main() {
- pthread_t t;
- pthread_create(&t, NULL, worker, NULL);
- int pid = fork();
- if (pid == 0) {
- // child
- atexit(foo);
- fprintf(stderr, "CHILD DONE\n");
- } else {
- pthread_join(t, 0);
- if (waitpid(pid, 0, 0) == -1) {
- perror("waitpid");
- exit(1);
- }
- fprintf(stderr, "PARENT DONE\n");
- }
-}
-
-// CHECK: CHILD DONE
-// CHECK: CHILD ATEXIT
-// CHECK: PARENT DONE
Copied: compiler-rt/trunk/test/tsan/fork_atexit.cpp (from r367653, compiler-rt/trunk/test/tsan/fork_atexit.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fork_atexit.cpp?p2=compiler-rt/trunk/test/tsan/fork_atexit.cpp&p1=compiler-rt/trunk/test/tsan/fork_atexit.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/fork_deadlock.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fork_deadlock.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fork_deadlock.cc (original)
+++ compiler-rt/trunk/test/tsan/fork_deadlock.cc (removed)
@@ -1,38 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %env_tsan_opts=atexit_sleep_ms=50 %run %t 2>&1 | FileCheck %s
-#include "test.h"
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-int counter;
-
-static void *incrementer(void *p) {
- for (;;)
- __sync_fetch_and_add(&counter, 1);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t th1;
- pthread_create(&th1, 0, incrementer, 0);
- for (int i = 0; i < 10; i++) {
- switch (fork()) {
- default: // parent
- while (wait(0) < 0) {}
- fprintf(stderr, ".");
- break;
- case 0: // child
- __sync_fetch_and_add(&counter, 1);
- exit(0);
- break;
- case -1: // error
- fprintf(stderr, "failed to fork (%d)\n", errno);
- exit(1);
- }
- }
- fprintf(stderr, "OK\n");
-}
-
-// CHECK: OK
-
Copied: compiler-rt/trunk/test/tsan/fork_deadlock.cpp (from r367653, compiler-rt/trunk/test/tsan/fork_deadlock.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fork_deadlock.cpp?p2=compiler-rt/trunk/test/tsan/fork_deadlock.cpp&p1=compiler-rt/trunk/test/tsan/fork_deadlock.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/fork_multithreaded.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fork_multithreaded.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fork_multithreaded.cc (original)
+++ compiler-rt/trunk/test/tsan/fork_multithreaded.cc (removed)
@@ -1,44 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s -check-prefix=CHECK-DIE
-// RUN: %clangxx_tsan -O1 %s -o %t && %env_tsan_opts=die_after_fork=0 %run %t 2>&1 | FileCheck %s -check-prefix=CHECK-NODIE
-#include "test.h"
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-static void *sleeper(void *p) {
- sleep(1000); // not intended to exit during test
- return 0;
-}
-
-static void *nop(void *p) {
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t th;
- pthread_create(&th, 0, sleeper, 0);
- switch (fork()) {
- default: // parent
- while (wait(0) < 0) {}
- break;
- case 0: // child
- {
- pthread_t th2;
- pthread_create(&th2, 0, nop, 0);
- exit(0);
- break;
- }
- case -1: // error
- fprintf(stderr, "failed to fork (%d)\n", errno);
- exit(1);
- }
- fprintf(stderr, "OK\n");
-}
-
-// CHECK-DIE: ThreadSanitizer: starting new threads after multi-threaded fork is not supported
-// CHECK-DIE: OK
-
-// CHECK-NODIE-NOT: ThreadSanitizer: starting new threads after multi-threaded fork is not supported
-// CHECK-NODIE: OK
-
Copied: compiler-rt/trunk/test/tsan/fork_multithreaded.cpp (from r367653, compiler-rt/trunk/test/tsan/fork_multithreaded.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fork_multithreaded.cpp?p2=compiler-rt/trunk/test/tsan/fork_multithreaded.cpp&p1=compiler-rt/trunk/test/tsan/fork_multithreaded.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/fork_multithreaded3.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fork_multithreaded3.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/fork_multithreaded3.cc (original)
+++ compiler-rt/trunk/test/tsan/fork_multithreaded3.cc (removed)
@@ -1,40 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-static void *racer(void *p) {
- *(int*)p = 42;
- return 0;
-}
-
-int main() {
- switch (fork()) {
- default: // parent
- while (wait(0) < 0) {}
- break;
- case 0: // child
- {
- int x = 0;
- pthread_t th1, th2;
- pthread_create(&th1, 0, racer, &x);
- pthread_create(&th2, 0, racer, &x);
- pthread_join(th1, 0);
- pthread_join(th2, 0);
- exit(0);
- break;
- }
- case -1: // error
- fprintf(stderr, "failed to fork (%d)\n", errno);
- exit(1);
- }
- fprintf(stderr, "OK\n");
-}
-
-// CHECK: ThreadSanitizer: data race
-// CHECK: OK
-
Copied: compiler-rt/trunk/test/tsan/fork_multithreaded3.cpp (from r367653, compiler-rt/trunk/test/tsan/fork_multithreaded3.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fork_multithreaded3.cpp?p2=compiler-rt/trunk/test/tsan/fork_multithreaded3.cpp&p1=compiler-rt/trunk/test/tsan/fork_multithreaded3.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/getline_nohang.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/getline_nohang.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/getline_nohang.cc (original)
+++ compiler-rt/trunk/test/tsan/getline_nohang.cc (removed)
@@ -1,42 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t
-
-// Data race randomly triggered.
-// UNSUPPORTED: netbsd
-
-// Make sure TSan doesn't deadlock on a file stream lock at program shutdown.
-// See https://github.com/google/sanitizers/issues/454
-#ifdef __FreeBSD__
-#define _WITH_GETLINE // to declare getline()
-#endif
-
-#include <pthread.h>
-#include <stdio.h>
-#include <unistd.h>
-
-void *thread(void *unused) {
- char *line = NULL;
- size_t size;
- int fd[2];
- pipe(fd);
- // Forge a non-standard stream to make sure it's not closed.
- FILE *stream = fdopen(fd[0], "r");
- while (1) {
- volatile int res = getline(&line, &size, stream);
- (void)res;
- }
- return NULL;
-}
-
-int main() {
- pthread_t t;
- pthread_attr_t a;
- pthread_attr_init(&a);
- pthread_attr_setdetachstate(&a, PTHREAD_CREATE_DETACHED);
- pthread_create(&t, &a, thread, NULL);
- pthread_attr_destroy(&a);
- fprintf(stderr, "DONE\n");
- return 0;
- // ThreadSanitizer used to hang here because of a deadlock on a file stream.
-}
-
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/getline_nohang.cpp (from r367653, compiler-rt/trunk/test/tsan/getline_nohang.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/getline_nohang.cpp?p2=compiler-rt/trunk/test/tsan/getline_nohang.cpp&p1=compiler-rt/trunk/test/tsan/getline_nohang.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/global_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/global_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/global_race.cc (original)
+++ compiler-rt/trunk/test/tsan/global_race.cc (removed)
@@ -1,39 +0,0 @@
-// RUN: rm -rf %t-dir
-// RUN: mkdir %t-dir
-
-// RUN: %clangxx_tsan -O1 %s -o %t-dir/global_race.cc.exe && %deflake %run %t-dir/global_race.cc.exe 2>&1 \
-// RUN: | FileCheck %s
-
-// Also check that memory access instrumentation can be configured by either
-// driver or legacy flags:
-
-// RUN: %clangxx_tsan -O1 %s -o %t-dir/global_race.cc.exe -fno-sanitize-thread-memory-access && not %deflake %run %t-dir/global_race.cc.exe 2>&1 \
-// RUN: | FileCheck --allow-empty --check-prefix=CHECK-MEMORY-ACCESS-OFF %s
-// RUN: %clangxx_tsan -O1 %s -o %t-dir/global_race.cc.exe -mllvm -tsan-instrument-memory-accesses=0 && not %deflake %run %t-dir/global_race.cc.exe 2>&1 \
-// RUN: | FileCheck --allow-empty --check-prefix=CHECK-MEMORY-ACCESS-OFF %s
-
-#include "test.h"
-
-int GlobalData[10];
-
-void *Thread(void *a) {
- barrier_wait(&barrier);
- GlobalData[2] = 42;
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- print_address("addr=", 1, GlobalData);
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- GlobalData[2] = 43;
- barrier_wait(&barrier);
- pthread_join(t, 0);
-}
-
-// CHECK: addr=[[ADDR:0x[0-9,a-f]+]]
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Location is global 'GlobalData' {{(of size 40 )?}}at [[ADDR]] (global_race.cc.exe+0x{{[0-9,a-f]+}})
-
-// CHECK-MEMORY-ACCESS-OFF-NOT: WARNING: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/global_race.cpp (from r367653, compiler-rt/trunk/test/tsan/global_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/global_race.cpp?p2=compiler-rt/trunk/test/tsan/global_race.cpp&p1=compiler-rt/trunk/test/tsan/global_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/global_race.cc (original)
+++ compiler-rt/trunk/test/tsan/global_race.cpp Fri Aug 2 00:18:07 2019
@@ -1,15 +1,15 @@
// RUN: rm -rf %t-dir
// RUN: mkdir %t-dir
-// RUN: %clangxx_tsan -O1 %s -o %t-dir/global_race.cc.exe && %deflake %run %t-dir/global_race.cc.exe 2>&1 \
+// RUN: %clangxx_tsan -O1 %s -o %t-dir/global_race.cpp.exe && %deflake %run %t-dir/global_race.cpp.exe 2>&1 \
// RUN: | FileCheck %s
// Also check that memory access instrumentation can be configured by either
// driver or legacy flags:
-// RUN: %clangxx_tsan -O1 %s -o %t-dir/global_race.cc.exe -fno-sanitize-thread-memory-access && not %deflake %run %t-dir/global_race.cc.exe 2>&1 \
+// RUN: %clangxx_tsan -O1 %s -o %t-dir/global_race.cpp.exe -fno-sanitize-thread-memory-access && not %deflake %run %t-dir/global_race.cpp.exe 2>&1 \
// RUN: | FileCheck --allow-empty --check-prefix=CHECK-MEMORY-ACCESS-OFF %s
-// RUN: %clangxx_tsan -O1 %s -o %t-dir/global_race.cc.exe -mllvm -tsan-instrument-memory-accesses=0 && not %deflake %run %t-dir/global_race.cc.exe 2>&1 \
+// RUN: %clangxx_tsan -O1 %s -o %t-dir/global_race.cpp.exe -mllvm -tsan-instrument-memory-accesses=0 && not %deflake %run %t-dir/global_race.cpp.exe 2>&1 \
// RUN: | FileCheck --allow-empty --check-prefix=CHECK-MEMORY-ACCESS-OFF %s
#include "test.h"
@@ -34,6 +34,6 @@ int main() {
// CHECK: addr=[[ADDR:0x[0-9,a-f]+]]
// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Location is global 'GlobalData' {{(of size 40 )?}}at [[ADDR]] (global_race.cc.exe+0x{{[0-9,a-f]+}})
+// CHECK: Location is global 'GlobalData' {{(of size 40 )?}}at [[ADDR]] (global_race.cpp.exe+0x{{[0-9,a-f]+}})
// CHECK-MEMORY-ACCESS-OFF-NOT: WARNING: ThreadSanitizer: data race
Removed: compiler-rt/trunk/test/tsan/global_race2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/global_race2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/global_race2.cc (original)
+++ compiler-rt/trunk/test/tsan/global_race2.cc (removed)
@@ -1,25 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-int x;
-
-void *Thread(void *a) {
- barrier_wait(&barrier);
- x = 1;
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- print_address("addr2=", 1, &x);
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- x = 0;
- barrier_wait(&barrier);
- pthread_join(t, 0);
-}
-
-// CHECK: addr2=[[ADDR2:0x[0-9,a-f]+]]
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Location is global 'x' {{(of size 4 )?}}at [[ADDR2]] ({{.*}}+0x{{[0-9,a-f]+}})
-
Copied: compiler-rt/trunk/test/tsan/global_race2.cpp (from r367653, compiler-rt/trunk/test/tsan/global_race2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/global_race2.cpp?p2=compiler-rt/trunk/test/tsan/global_race2.cpp&p1=compiler-rt/trunk/test/tsan/global_race2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/global_race3.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/global_race3.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/global_race3.cc (original)
+++ compiler-rt/trunk/test/tsan/global_race3.cc (removed)
@@ -1,29 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-namespace XXX {
- struct YYY {
- static int ZZZ[10];
- };
- int YYY::ZZZ[10];
-}
-
-void *Thread(void *a) {
- barrier_wait(&barrier);
- XXX::YYY::ZZZ[0] = 1;
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- print_address("addr3=", 1, XXX::YYY::ZZZ);
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- XXX::YYY::ZZZ[0] = 0;
- barrier_wait(&barrier);
- pthread_join(t, 0);
-}
-
-// CHECK: addr3=[[ADDR3:0x[0-9,a-f]+]]
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Location is global 'XXX::YYY::ZZZ' {{(of size 40 )?}}at [[ADDR3]] ({{.*}}+0x{{[0-9,a-f]+}})
Copied: compiler-rt/trunk/test/tsan/global_race3.cpp (from r367653, compiler-rt/trunk/test/tsan/global_race3.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/global_race3.cpp?p2=compiler-rt/trunk/test/tsan/global_race3.cpp&p1=compiler-rt/trunk/test/tsan/global_race3.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/halt_on_error.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/halt_on_error.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/halt_on_error.cc (original)
+++ compiler-rt/trunk/test/tsan/halt_on_error.cc (removed)
@@ -1,27 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %env_tsan_opts=halt_on_error=1 %deflake %run %t | FileCheck %s
-#include "test.h"
-
-int X;
-
-void *Thread(void *x) {
- barrier_wait(&barrier);
- X = 42;
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- fprintf(stderr, "BEFORE\n");
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- X = 43;
- barrier_wait(&barrier);
- pthread_join(t, 0);
- fprintf(stderr, "AFTER\n");
- return 0;
-}
-
-// CHECK: BEFORE
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK-NOT: AFTER
-
Copied: compiler-rt/trunk/test/tsan/halt_on_error.cpp (from r367653, compiler-rt/trunk/test/tsan/halt_on_error.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/halt_on_error.cpp?p2=compiler-rt/trunk/test/tsan/halt_on_error.cpp&p1=compiler-rt/trunk/test/tsan/halt_on_error.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/heap_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/heap_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/heap_race.cc (original)
+++ compiler-rt/trunk/test/tsan/heap_race.cc (removed)
@@ -1,24 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-#include <pthread.h>
-#include <stdio.h>
-#include <stddef.h>
-
-void *Thread(void *a) {
- ((int*)a)[0]++;
- barrier_wait(&barrier);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- int *p = new int(42);
- pthread_t t;
- pthread_create(&t, NULL, Thread, p);
- barrier_wait(&barrier);
- p[0]++;
- pthread_join(t, NULL);
- delete p;
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/heap_race.cpp (from r367653, compiler-rt/trunk/test/tsan/heap_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/heap_race.cpp?p2=compiler-rt/trunk/test/tsan/heap_race.cpp&p1=compiler-rt/trunk/test/tsan/heap_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/ignore_free.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_free.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/ignore_free.cc (original)
+++ compiler-rt/trunk/test/tsan/ignore_free.cc (removed)
@@ -1,34 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "test.h"
-
-extern "C" {
-void AnnotateIgnoreReadsBegin(const char *f, int l);
-void AnnotateIgnoreReadsEnd(const char *f, int l);
-void AnnotateIgnoreWritesBegin(const char *f, int l);
-void AnnotateIgnoreWritesEnd(const char *f, int l);
-}
-
-void *Thread(void *p) {
- *(int*)p = 42;
- barrier_wait(&barrier);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- int *p = new int(0);
- pthread_t t;
- pthread_create(&t, 0, Thread, p);
- barrier_wait(&barrier);
- AnnotateIgnoreReadsBegin(__FILE__, __LINE__);
- AnnotateIgnoreWritesBegin(__FILE__, __LINE__);
- free(p);
- AnnotateIgnoreReadsEnd(__FILE__, __LINE__);
- AnnotateIgnoreWritesEnd(__FILE__, __LINE__);
- pthread_join(t, 0);
- fprintf(stderr, "OK\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK: OK
Copied: compiler-rt/trunk/test/tsan/ignore_free.cpp (from r367653, compiler-rt/trunk/test/tsan/ignore_free.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_free.cpp?p2=compiler-rt/trunk/test/tsan/ignore_free.cpp&p1=compiler-rt/trunk/test/tsan/ignore_free.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/ignore_lib0.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib0.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/ignore_lib0.cc (original)
+++ compiler-rt/trunk/test/tsan/ignore_lib0.cc (removed)
@@ -1,38 +0,0 @@
-// RUN: rm -rf %t-dir
-// RUN: mkdir %t-dir
-
-// RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -fno-sanitize=thread -shared -o %t-dir/libignore_lib0.so
-// RUN: %clangxx_tsan -O1 %s -L%t-dir -lignore_lib0 %link_libcxx_tsan -o %t
-// RUN: echo running w/o suppressions:
-// RUN: env LD_LIBRARY_PATH=%t-dir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %deflake %run %t | FileCheck %s --check-prefix=CHECK-NOSUPP
-// RUN: echo running with suppressions:
-// RUN: env LD_LIBRARY_PATH=%t-dir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %env_tsan_opts=suppressions='%s.supp' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP
-
-// Tests that interceptors coming from a library specified in called_from_lib
-// suppression are ignored.
-
-// Some aarch64 kernels do not support non executable write pages
-// REQUIRES: stable-runtime
-
-// UNSUPPORTED: ios
-
-#ifndef LIB
-
-extern "C" void libfunc();
-
-int main() {
- libfunc();
-}
-
-#else // #ifdef LIB
-
-#include "ignore_lib_lib.h"
-
-#endif // #ifdef LIB
-
-// CHECK-NOSUPP: WARNING: ThreadSanitizer: data race
-// CHECK-NOSUPP: OK
-
-// CHECK-WITHSUPP-NOT: WARNING: ThreadSanitizer: data race
-// CHECK-WITHSUPP: OK
-
Removed: compiler-rt/trunk/test/tsan/ignore_lib0.cc.supp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib0.cc.supp?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/ignore_lib0.cc.supp (original)
+++ compiler-rt/trunk/test/tsan/ignore_lib0.cc.supp (removed)
@@ -1,2 +0,0 @@
-called_from_lib:/libignore_lib0.so
-
Copied: compiler-rt/trunk/test/tsan/ignore_lib0.cpp (from r367653, compiler-rt/trunk/test/tsan/ignore_lib0.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib0.cpp?p2=compiler-rt/trunk/test/tsan/ignore_lib0.cpp&p1=compiler-rt/trunk/test/tsan/ignore_lib0.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Copied: compiler-rt/trunk/test/tsan/ignore_lib0.cpp.supp (from r367653, compiler-rt/trunk/test/tsan/ignore_lib0.cc.supp)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib0.cpp.supp?p2=compiler-rt/trunk/test/tsan/ignore_lib0.cpp.supp&p1=compiler-rt/trunk/test/tsan/ignore_lib0.cc.supp&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/ignore_lib1.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib1.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/ignore_lib1.cc (original)
+++ compiler-rt/trunk/test/tsan/ignore_lib1.cc (removed)
@@ -1,50 +0,0 @@
-// RUN: rm -rf %t-dir
-// RUN: mkdir %t-dir
-
-// RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -fno-sanitize=thread -shared -o %t-dir/libignore_lib1.so
-// RUN: %clangxx_tsan -O1 %s %link_libcxx_tsan -o %t-dir/executable
-// RUN: echo running w/o suppressions:
-// RUN: %deflake %run %t-dir/executable | FileCheck %s --check-prefix=CHECK-NOSUPP
-// RUN: echo running with suppressions:
-// RUN: %env_tsan_opts=suppressions='%s.supp' %run %t-dir/executable 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP
-
-// Tests that interceptors coming from a dynamically loaded library specified
-// in called_from_lib suppression are ignored.
-
-// REQUIRES: stable-runtime
-// UNSUPPORTED: powerpc64le
-// FIXME: This test regularly fails on powerpc64 LE possibly starting with
-// r279664. Re-enable the test once the problem(s) have been fixed.
-
-#ifndef LIB
-
-#include <dlfcn.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <libgen.h>
-#include <string>
-
-int main(int argc, char **argv) {
- std::string lib = std::string(dirname(argv[0])) + "/libignore_lib1.so";
- void *h = dlopen(lib.c_str(), RTLD_GLOBAL | RTLD_NOW);
- if (h == 0)
- exit(printf("failed to load the library (%d)\n", errno));
- void (*f)() = (void(*)())dlsym(h, "libfunc");
- if (f == 0)
- exit(printf("failed to find the func (%d)\n", errno));
- f();
-}
-
-#else // #ifdef LIB
-
-#include "ignore_lib_lib.h"
-
-#endif // #ifdef LIB
-
-// CHECK-NOSUPP: WARNING: ThreadSanitizer: data race
-// CHECK-NOSUPP: OK
-
-// CHECK-WITHSUPP-NOT: WARNING: ThreadSanitizer: data race
-// CHECK-WITHSUPP: OK
-
Removed: compiler-rt/trunk/test/tsan/ignore_lib1.cc.supp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib1.cc.supp?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/ignore_lib1.cc.supp (original)
+++ compiler-rt/trunk/test/tsan/ignore_lib1.cc.supp (removed)
@@ -1,2 +0,0 @@
-called_from_lib:/libignore_lib1.so$
-
Copied: compiler-rt/trunk/test/tsan/ignore_lib1.cpp (from r367653, compiler-rt/trunk/test/tsan/ignore_lib1.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib1.cpp?p2=compiler-rt/trunk/test/tsan/ignore_lib1.cpp&p1=compiler-rt/trunk/test/tsan/ignore_lib1.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Copied: compiler-rt/trunk/test/tsan/ignore_lib1.cpp.supp (from r367653, compiler-rt/trunk/test/tsan/ignore_lib1.cc.supp)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib1.cpp.supp?p2=compiler-rt/trunk/test/tsan/ignore_lib1.cpp.supp&p1=compiler-rt/trunk/test/tsan/ignore_lib1.cc.supp&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/ignore_lib2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/ignore_lib2.cc (original)
+++ compiler-rt/trunk/test/tsan/ignore_lib2.cc (removed)
@@ -1,36 +0,0 @@
-// RUN: rm -rf %t-dir
-// RUN: mkdir %t-dir
-
-// RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -fno-sanitize=thread -shared -o %t-dir/libignore_lib2_0.so
-// RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -fno-sanitize=thread -shared -o %t-dir/libignore_lib2_1.so
-// RUN: %clangxx_tsan -O1 %s %link_libcxx_tsan -o %t-dir/executable
-// RUN: %env_tsan_opts=suppressions='%s.supp' %deflake %run %t-dir/executable | FileCheck %s
-
-// Tests that called_from_lib suppression matched against 2 libraries
-// causes program crash (this is not supported).
-
-#ifndef LIB
-
-#include <dlfcn.h>
-#include <stdio.h>
-#include <libgen.h>
-#include <string>
-
-int main(int argc, char **argv) {
- std::string lib0 = std::string(dirname(argv[0])) + "/libignore_lib2_0.so";
- std::string lib1 = std::string(dirname(argv[0])) + "/libignore_lib2_1.so";
- dlopen(lib0.c_str(), RTLD_GLOBAL | RTLD_NOW);
- dlopen(lib1.c_str(), RTLD_GLOBAL | RTLD_NOW);
- fprintf(stderr, "OK\n");
-}
-
-#else // #ifdef LIB
-
-extern "C" void libfunc() {
-}
-
-#endif // #ifdef LIB
-
-// CHECK: ThreadSanitizer: called_from_lib suppression 'ignore_lib2' is matched against 2 libraries
-// CHECK-NOT: OK
-
Removed: compiler-rt/trunk/test/tsan/ignore_lib2.cc.supp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib2.cc.supp?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/ignore_lib2.cc.supp (original)
+++ compiler-rt/trunk/test/tsan/ignore_lib2.cc.supp (removed)
@@ -1,2 +0,0 @@
-called_from_lib:ignore_lib2
-
Copied: compiler-rt/trunk/test/tsan/ignore_lib2.cpp (from r367653, compiler-rt/trunk/test/tsan/ignore_lib2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib2.cpp?p2=compiler-rt/trunk/test/tsan/ignore_lib2.cpp&p1=compiler-rt/trunk/test/tsan/ignore_lib2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Copied: compiler-rt/trunk/test/tsan/ignore_lib2.cpp.supp (from r367653, compiler-rt/trunk/test/tsan/ignore_lib2.cc.supp)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib2.cpp.supp?p2=compiler-rt/trunk/test/tsan/ignore_lib2.cpp.supp&p1=compiler-rt/trunk/test/tsan/ignore_lib2.cc.supp&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/ignore_lib3.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib3.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/ignore_lib3.cc (original)
+++ compiler-rt/trunk/test/tsan/ignore_lib3.cc (removed)
@@ -1,39 +0,0 @@
-// RUN: rm -rf %t-dir
-// RUN: mkdir %t-dir
-
-// RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -fno-sanitize=thread -shared -o %t-dir/libignore_lib3.so
-// RUN: %clangxx_tsan -O1 %s %link_libcxx_tsan -o %t-dir/executable
-// RUN: %env_tsan_opts=suppressions='%s.supp' %deflake %run %t-dir/executable | FileCheck %s
-
-// Tests that unloading of a library matched against called_from_lib suppression
-// causes program crash (this is not supported).
-
-// Some aarch64 kernels do not support non executable write pages
-// REQUIRES: stable-runtime
-
-#ifndef LIB
-
-#include <dlfcn.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <libgen.h>
-#include <string>
-
-int main(int argc, char **argv) {
- std::string lib = std::string(dirname(argv[0])) + "/libignore_lib3.so";
- void *h = dlopen(lib.c_str(), RTLD_GLOBAL | RTLD_NOW);
- dlclose(h);
- fprintf(stderr, "OK\n");
-}
-
-#else // #ifdef LIB
-
-extern "C" void libfunc() {
-}
-
-#endif // #ifdef LIB
-
-// CHECK: ThreadSanitizer: library {{.*}} that was matched against called_from_lib suppression 'ignore_lib3.so' is unloaded
-// CHECK-NOT: OK
-
Removed: compiler-rt/trunk/test/tsan/ignore_lib3.cc.supp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib3.cc.supp?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/ignore_lib3.cc.supp (original)
+++ compiler-rt/trunk/test/tsan/ignore_lib3.cc.supp (removed)
@@ -1,2 +0,0 @@
-called_from_lib:ignore_lib3.so
-
Copied: compiler-rt/trunk/test/tsan/ignore_lib3.cpp (from r367653, compiler-rt/trunk/test/tsan/ignore_lib3.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib3.cpp?p2=compiler-rt/trunk/test/tsan/ignore_lib3.cpp&p1=compiler-rt/trunk/test/tsan/ignore_lib3.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Copied: compiler-rt/trunk/test/tsan/ignore_lib3.cpp.supp (from r367653, compiler-rt/trunk/test/tsan/ignore_lib3.cc.supp)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib3.cpp.supp?p2=compiler-rt/trunk/test/tsan/ignore_lib3.cpp.supp&p1=compiler-rt/trunk/test/tsan/ignore_lib3.cc.supp&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/ignore_lib4.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib4.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/ignore_lib4.cc (original)
+++ compiler-rt/trunk/test/tsan/ignore_lib4.cc (removed)
@@ -1,49 +0,0 @@
-// RUN: rm -rf %t-dir
-// RUN: mkdir %t-dir
-
-// RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -shared -o %t-dir/libignore_lib4.so
-// RUN: %clangxx_tsan -O1 %s %link_libcxx_tsan -o %t-dir/executable
-// RUN: echo "called_from_lib:libignore_lib4.so" > %t-dir/executable.supp
-// RUN: %env_tsan_opts=suppressions='%t-dir/executable.supp' %run %t-dir/executable 2>&1 | FileCheck %s
-
-// powerpc64 big endian bots failed with "FileCheck error: '-' is empty" due
-// to a segmentation fault.
-// UNSUPPORTED: powerpc64-unknown-linux-gnu
-// aarch64 bots failed with "called_from_lib suppression 'libignore_lib4.so'
-// is matched against 2 libraries".
-// UNSUPPORTED: aarch64
-
-// Test longjmp in ignored lib.
-// It used to crash since we jumped out of ScopedInterceptor scope.
-
-#include "test.h"
-#include <setjmp.h>
-#include <string.h>
-#include <errno.h>
-#include <libgen.h>
-#include <string>
-
-#ifdef LIB
-
-extern "C" void myfunc() {
- for (int i = 0; i < (1 << 20); i++) {
- jmp_buf env;
- if (!setjmp(env))
- longjmp(env, 1);
- }
-}
-
-#else
-
-int main(int argc, char **argv) {
- std::string lib = std::string(dirname(argv[0])) + "/libignore_lib4.so";
- void *h = dlopen(lib.c_str(), RTLD_GLOBAL | RTLD_NOW);
- void (*func)() = (void(*)())dlsym(h, "myfunc");
- func();
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-#endif
-
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/ignore_lib4.cpp (from r367653, compiler-rt/trunk/test/tsan/ignore_lib4.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib4.cpp?p2=compiler-rt/trunk/test/tsan/ignore_lib4.cpp&p1=compiler-rt/trunk/test/tsan/ignore_lib4.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/ignore_lib5.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib5.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/ignore_lib5.cc (original)
+++ compiler-rt/trunk/test/tsan/ignore_lib5.cc (removed)
@@ -1,83 +0,0 @@
-// RUN: rm -rf %t-dir
-// RUN: mkdir %t-dir
-
-// RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -fno-sanitize=thread -shared -o %t-dir/libignore_lib1.so
-// RUN: %clangxx_tsan -O1 %s %link_libcxx_tsan -o %t-dir/executable
-// RUN: echo running w/o suppressions:
-// RUN: %deflake %run %t-dir/executable | FileCheck %s --check-prefix=CHECK-NOSUPP
-// RUN: echo running with suppressions:
-// RUN: %env_tsan_opts=suppressions='%s.supp' %run %t-dir/executable 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP
-
-// REQUIRES: stable-runtime
-// UNSUPPORTED: powerpc64le
-// FIXME: This test occasionally fails on powerpc64 LE possibly starting with
-// r279664. Re-enable the test once the problem(s) have been fixed.
-
-// Previously the test episodically failed with:
-// ThreadSanitizer: called_from_lib suppression '/libignore_lib1.so$' is
-// matched against 2 libraries: '/libignore_lib1.so' and '/libignore_lib1.so'
-// This was caused by non-atomicity of reading of /proc/self/maps.
-
-// ReadProcMaps() on NetBSD does not handle >=1MB of memory layout information
-// UNSUPPORTED: netbsd
-
-#ifndef LIB
-
-#include <dlfcn.h>
-#include <sys/mman.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <libgen.h>
-#include <string>
-#include "test.h"
-
-#ifndef MAP_32BIT
-# define MAP_32BIT 0
-#endif
-
-#ifdef __APPLE__
-# define TSAN_MAP_ANON MAP_ANON
-#else
-# define TSAN_MAP_ANON MAP_ANONYMOUS
-#endif
-
-void *thr(void *arg) {
- // This thread creates lots of separate mappings in /proc/self/maps before
- // the ignored library.
- for (int i = 0; i < 10000; i++) {
- if (i == 5000)
- barrier_wait(&barrier);
- mmap(0, 4096, PROT_READ, TSAN_MAP_ANON | MAP_PRIVATE | MAP_32BIT, -1 , 0);
- mmap(0, 4096, PROT_WRITE, TSAN_MAP_ANON | MAP_PRIVATE | MAP_32BIT, -1 , 0);
- }
- return 0;
-}
-
-int main(int argc, char **argv) {
- barrier_init(&barrier, 2);
- pthread_t th;
- pthread_create(&th, 0, thr, 0);
- barrier_wait(&barrier);
- std::string lib = std::string(dirname(argv[0])) + "/libignore_lib1.so";
- void *h = dlopen(lib.c_str(), RTLD_GLOBAL | RTLD_NOW);
- if (h == 0)
- exit(printf("failed to load the library (%d)\n", errno));
- void (*f)() = (void(*)())dlsym(h, "libfunc");
- if (f == 0)
- exit(printf("failed to find the func (%d)\n", errno));
- pthread_join(th, 0);
- f();
-}
-
-#else // #ifdef LIB
-
-#include "ignore_lib_lib.h"
-
-#endif // #ifdef LIB
-
-// CHECK-NOSUPP: WARNING: ThreadSanitizer: data race
-// CHECK-NOSUPP: OK
-
-// CHECK-WITHSUPP-NOT: WARNING: ThreadSanitizer: data race
-// CHECK-WITHSUPP: OK
Removed: compiler-rt/trunk/test/tsan/ignore_lib5.cc.supp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib5.cc.supp?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/ignore_lib5.cc.supp (original)
+++ compiler-rt/trunk/test/tsan/ignore_lib5.cc.supp (removed)
@@ -1,2 +0,0 @@
-called_from_lib:/libignore_lib1.so$
-
Copied: compiler-rt/trunk/test/tsan/ignore_lib5.cpp (from r367653, compiler-rt/trunk/test/tsan/ignore_lib5.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib5.cpp?p2=compiler-rt/trunk/test/tsan/ignore_lib5.cpp&p1=compiler-rt/trunk/test/tsan/ignore_lib5.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Copied: compiler-rt/trunk/test/tsan/ignore_lib5.cpp.supp (from r367653, compiler-rt/trunk/test/tsan/ignore_lib5.cc.supp)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_lib5.cpp.supp?p2=compiler-rt/trunk/test/tsan/ignore_lib5.cpp.supp&p1=compiler-rt/trunk/test/tsan/ignore_lib5.cc.supp&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/ignore_malloc.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_malloc.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/ignore_malloc.cc (original)
+++ compiler-rt/trunk/test/tsan/ignore_malloc.cc (removed)
@@ -1,35 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "test.h"
-
-extern "C" {
-void AnnotateIgnoreReadsBegin(const char *f, int l);
-void AnnotateIgnoreReadsEnd(const char *f, int l);
-void AnnotateIgnoreWritesBegin(const char *f, int l);
-void AnnotateIgnoreWritesEnd(const char *f, int l);
-}
-
-int *g;
-
-void *Thread(void *a) {
- int *p = 0;
- while ((p = __atomic_load_n(&g, __ATOMIC_RELAXED)) == 0)
- usleep(100); // spin-wait
- *p = 42;
- return 0;
-}
-
-int main() {
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- AnnotateIgnoreWritesBegin(__FILE__, __LINE__);
- int *p = new int(0);
- AnnotateIgnoreWritesEnd(__FILE__, __LINE__);
- __atomic_store_n(&g, p, __ATOMIC_RELAXED);
- pthread_join(t, 0);
- delete p;
- fprintf(stderr, "OK\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK: OK
Copied: compiler-rt/trunk/test/tsan/ignore_malloc.cpp (from r367653, compiler-rt/trunk/test/tsan/ignore_malloc.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_malloc.cpp?p2=compiler-rt/trunk/test/tsan/ignore_malloc.cpp&p1=compiler-rt/trunk/test/tsan/ignore_malloc.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/ignore_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/ignore_race.cc (original)
+++ compiler-rt/trunk/test/tsan/ignore_race.cc (removed)
@@ -1,31 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "test.h"
-
-int Global;
-
-extern "C" void AnnotateIgnoreWritesBegin(const char *f, int l);
-extern "C" void AnnotateIgnoreWritesEnd(const char *f, int l);
-extern "C" void AnnotateIgnoreReadsBegin(const char *f, int l);
-extern "C" void AnnotateIgnoreReadsEnd(const char *f, int l);
-
-void *Thread(void *x) {
- AnnotateIgnoreWritesBegin(__FILE__, __LINE__);
- AnnotateIgnoreReadsBegin(__FILE__, __LINE__);
- Global = 42;
- AnnotateIgnoreReadsEnd(__FILE__, __LINE__);
- AnnotateIgnoreWritesEnd(__FILE__, __LINE__);
- barrier_wait(&barrier);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- barrier_wait(&barrier);
- Global = 43;
- pthread_join(t, 0);
- fprintf(stderr, "OK\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/ignore_race.cpp (from r367653, compiler-rt/trunk/test/tsan/ignore_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_race.cpp?p2=compiler-rt/trunk/test/tsan/ignore_race.cpp&p1=compiler-rt/trunk/test/tsan/ignore_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/ignore_sync.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_sync.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/ignore_sync.cc (original)
+++ compiler-rt/trunk/test/tsan/ignore_sync.cc (removed)
@@ -1,30 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include <pthread.h>
-#include <stdio.h>
-
-extern "C" void AnnotateIgnoreSyncBegin(const char*, int);
-extern "C" void AnnotateIgnoreSyncEnd(const char*, int);
-
-int Global;
-pthread_mutex_t Mutex = PTHREAD_MUTEX_INITIALIZER;
-
-void *Thread(void *x) {
- AnnotateIgnoreSyncBegin(0, 0);
- pthread_mutex_lock(&Mutex);
- Global++;
- pthread_mutex_unlock(&Mutex);
- AnnotateIgnoreSyncEnd(0, 0);
- return 0;
-}
-
-int main() {
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- pthread_mutex_lock(&Mutex);
- Global++;
- pthread_mutex_unlock(&Mutex);
- pthread_join(t, 0);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-
Copied: compiler-rt/trunk/test/tsan/ignore_sync.cpp (from r367653, compiler-rt/trunk/test/tsan/ignore_sync.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignore_sync.cpp?p2=compiler-rt/trunk/test/tsan/ignore_sync.cpp&p1=compiler-rt/trunk/test/tsan/ignore_sync.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/ignored-interceptors-mmap.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignored-interceptors-mmap.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/ignored-interceptors-mmap.cc (original)
+++ compiler-rt/trunk/test/tsan/ignored-interceptors-mmap.cc (removed)
@@ -1,61 +0,0 @@
-// RUN: %clangxx_tsan -O0 %s -o %t
-// RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-RACE
-// RUN: %run %t ignore 2>&1 | FileCheck %s --check-prefix=CHECK-IGNORE
-// XFAIL: freebsd,netbsd
-
-#include <sys/mman.h>
-#include <string.h>
-#include <assert.h>
-#include <atomic>
-
-#include "test.h"
-
-extern "C" {
-void AnnotateIgnoreReadsBegin(const char *f, int l);
-void AnnotateIgnoreReadsEnd(const char *f, int l);
-void AnnotateIgnoreWritesBegin(const char *f, int l);
-void AnnotateIgnoreWritesEnd(const char *f, int l);
-}
-
-// Use atomic to ensure we do not have a race for the pointer value itself. We
-// only want to check races in the mmap'd memory to isolate the test that mmap
-// respects ignore annotations.
-std::atomic<int*> global_p;
-
-void mmap_ignored(bool ignore) {
- const size_t kSize = sysconf(_SC_PAGESIZE);
-
- if (ignore) AnnotateIgnoreWritesBegin(__FILE__, __LINE__);
- void *p = mmap(0, kSize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0);
- if (ignore) AnnotateIgnoreWritesEnd(__FILE__, __LINE__);
-
- // Use relaxed to retain the race between the mmap call and the memory write
- global_p.store((int *)p, std::memory_order_relaxed);
- barrier_wait(&barrier);
-}
-
-void *WriteToMemory(void *unused) {
- barrier_wait(&barrier);
- global_p[0] = 7;
- return 0;
-}
-
-// Create race between allocating (mmap) and writing memory
-int main(int argc, const char *argv[]) {
- bool ignore = (argc > 1) && (strcmp(argv[1], "ignore") == 0);
-
- barrier_init(&barrier, 2);
- pthread_t t;
- pthread_create(&t, 0, WriteToMemory, 0);
- mmap_ignored(ignore);
- pthread_join(t, 0);
-
- assert(global_p[0] == 7);
- printf("OK\n");
- return 0;
-}
-
-// CHECK-RACE: WARNING: ThreadSanitizer: data race
-// CHECK-RACE: OK
-// CHECK-IGNORE-NOT: WARNING: ThreadSanitizer: data race
-// CHECK-IGNORE: OK
Copied: compiler-rt/trunk/test/tsan/ignored-interceptors-mmap.cpp (from r367653, compiler-rt/trunk/test/tsan/ignored-interceptors-mmap.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/ignored-interceptors-mmap.cpp?p2=compiler-rt/trunk/test/tsan/ignored-interceptors-mmap.cpp&p1=compiler-rt/trunk/test/tsan/ignored-interceptors-mmap.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/inlined_memcpy_race.cc (original)
+++ compiler-rt/trunk/test/tsan/inlined_memcpy_race.cc (removed)
@@ -1,37 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
-#include "test.h"
-#include <string.h>
-
-int x[4], z[4];
-
-void *MemCpyThread(void *a) {
- memcpy((int*)a, z, 16);
- barrier_wait(&barrier);
- return NULL;
-}
-
-void *MemSetThread(void *a) {
- barrier_wait(&barrier);
- memset((int*)a, 0, 16);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t[2];
- // Race on x between memcpy and memset
- pthread_create(&t[0], NULL, MemCpyThread, x);
- pthread_create(&t[1], NULL, MemSetThread, x);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- fprintf(stderr, "PASS\n");
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: #0 memset
-// CHECK: #1 MemSetThread
-// CHECK: Previous write
-// CHECK: #0 {{(memcpy|memmove)}}
-// CHECK: #1 MemCpyThread
-
Copied: compiler-rt/trunk/test/tsan/inlined_memcpy_race.cpp (from r367653, compiler-rt/trunk/test/tsan/inlined_memcpy_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/inlined_memcpy_race.cpp?p2=compiler-rt/trunk/test/tsan/inlined_memcpy_race.cpp&p1=compiler-rt/trunk/test/tsan/inlined_memcpy_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/inlined_memcpy_race2.cc (original)
+++ compiler-rt/trunk/test/tsan/inlined_memcpy_race2.cc (removed)
@@ -1,37 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
-#include "test.h"
-#include <string.h>
-
-int y[4], z[4];
-
-void *MemMoveThread(void *a) {
- memmove((int*)a, z, 16);
- barrier_wait(&barrier);
- return NULL;
-}
-
-void *MemSetThread(void *a) {
- barrier_wait(&barrier);
- memset((int*)a, 0, 16);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t[2];
- // Race on y between memmove and memset
- pthread_create(&t[0], NULL, MemMoveThread, y);
- pthread_create(&t[1], NULL, MemSetThread, y);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
-
- fprintf(stderr, "PASS\n");
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: #0 memset
-// CHECK: #1 MemSetThread
-// CHECK: Previous write
-// CHECK: #0 {{(memcpy|memmove)}}
-// CHECK: #1 MemMoveThread
Copied: compiler-rt/trunk/test/tsan/inlined_memcpy_race2.cpp (from r367653, compiler-rt/trunk/test/tsan/inlined_memcpy_race2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/inlined_memcpy_race2.cpp?p2=compiler-rt/trunk/test/tsan/inlined_memcpy_race2.cpp&p1=compiler-rt/trunk/test/tsan/inlined_memcpy_race2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/java_alloc.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_alloc.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/java_alloc.cc (original)
+++ compiler-rt/trunk/test/tsan/java_alloc.cc (removed)
@@ -1,38 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "java.h"
-
-int const kHeapSize = 1024 * 1024;
-
-void stress(jptr addr) {
- for (jptr sz = 8; sz <= 32; sz <<= 1) {
- for (jptr i = 0; i < kHeapSize / 4 / sz; i++) {
- __tsan_java_alloc(addr + i * sz, sz);
- }
- __tsan_java_move(addr, addr + kHeapSize / 2, kHeapSize / 4);
- __tsan_java_free(addr + kHeapSize / 2, kHeapSize / 4);
- }
-}
-
-void *Thread(void *p) {
- stress((jptr)p);
- return 0;
-}
-
-int main() {
- jptr jheap = (jptr)malloc(kHeapSize + 8) + 8;
- __tsan_java_init(jheap, kHeapSize);
- pthread_t th;
- pthread_create(&th, 0, Thread, (void*)(jheap + kHeapSize / 4));
- stress(jheap);
- pthread_join(th, 0);
- if (__tsan_java_fini() != 0) {
- fprintf(stderr, "FAILED\n");
- return 1;
- }
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK-NOT: FAILED
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/java_alloc.cpp (from r367653, compiler-rt/trunk/test/tsan/java_alloc.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_alloc.cpp?p2=compiler-rt/trunk/test/tsan/java_alloc.cpp&p1=compiler-rt/trunk/test/tsan/java_alloc.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/java_finalizer.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_finalizer.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/java_finalizer.cc (original)
+++ compiler-rt/trunk/test/tsan/java_finalizer.cc (removed)
@@ -1,29 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "java.h"
-
-void *Thread(void *p) {
- barrier_wait(&barrier);
- __tsan_java_finalize();
- *(int*)p = 42;
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- int const kHeapSize = 1024 * 1024;
- jptr jheap = (jptr)malloc(kHeapSize + 8) + 8;
- __tsan_java_init(jheap, kHeapSize);
- const int kBlockSize = 16;
- __tsan_java_alloc(jheap, kBlockSize);
- pthread_t th;
- pthread_create(&th, 0, Thread, (void*)jheap);
- *(int*)jheap = 43;
- barrier_wait(&barrier);
- pthread_join(th, 0);
- __tsan_java_free(jheap, kBlockSize);
- fprintf(stderr, "DONE\n");
- return __tsan_java_fini();
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/java_finalizer.cpp (from r367653, compiler-rt/trunk/test/tsan/java_finalizer.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_finalizer.cpp?p2=compiler-rt/trunk/test/tsan/java_finalizer.cpp&p1=compiler-rt/trunk/test/tsan/java_finalizer.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/java_find.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_find.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/java_find.cc (original)
+++ compiler-rt/trunk/test/tsan/java_find.cc (removed)
@@ -1,69 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "java.h"
-
-int const kHeapSize = 1024 * 1024;
-
-static void verify_find(jptr from, jptr to, jptr expected_addr,
- jptr expected_size) {
- jptr addr = from;
- jptr size = __tsan_java_find(&addr, to);
- if (expected_size) {
- if (!size) {
- fprintf(stderr, "FAILED: range: [%p..%p): found nothing\n", (void *)from,
- (void *)to);
- return;
- } else if (expected_size != size) {
- fprintf(stderr, "FAILED: range: [%p..%p): wrong size, %lu instead of %lu\n",
- (void *)from, (void *)to, size, expected_size);
- return;
- }
- } else if (size) {
- fprintf(stderr,
- "FAILED: range [%p..%p): did not expect to find anything here\n",
- (void *)from, (void *)to);
- return;
- } else {
- return;
- }
- if (expected_addr != addr) {
- fprintf(
- stderr,
- "FAILED: range [%p..%p): expected to find object at %p, found at %p\n",
- (void *)from, (void *)to, (void *)expected_addr, (void *)addr);
- }
-}
-
-int main() {
- const jptr jheap = (jptr)malloc(kHeapSize + 8) + 8;
- const jptr jheap_end = jheap + kHeapSize;
- __tsan_java_init(jheap, kHeapSize);
- const jptr addr1 = jheap;
- const int size1 = 16;
- __tsan_java_alloc(jheap, size1);
-
- const jptr addr2 = addr1 + size1;
- const int size2 = 32;
- __tsan_java_alloc(jheap + size1, size2);
-
- const jptr addr3 = addr2 + size2;
- const int size3 = 1024;
- __tsan_java_alloc(jheap + size1 + size2, size3);
-
- const jptr addr4 = addr3 + size3;
-
- verify_find(jheap, jheap_end, addr1, size1);
- verify_find(jheap + 8, jheap_end, addr2, size2);
- verify_find(addr2 + 8, jheap_end, addr3, size3);
- verify_find(addr3 + 8, jheap_end, 0, 0);
-
- __tsan_java_move(addr2, addr4, size2);
- verify_find(jheap + 8, jheap_end, addr3, size3);
- verify_find(addr3 + 8, jheap_end, addr4, size2);
- verify_find(addr4 + 8, jheap_end, 0, 0);
-
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK-NOT: FAILED
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/java_find.cpp (from r367653, compiler-rt/trunk/test/tsan/java_find.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_find.cpp?p2=compiler-rt/trunk/test/tsan/java_find.cpp&p1=compiler-rt/trunk/test/tsan/java_find.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/java_heap_init.cc (original)
+++ compiler-rt/trunk/test/tsan/java_heap_init.cc (removed)
@@ -1,28 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "java.h"
-#include <errno.h>
-#include <sys/mman.h>
-
-int main() {
- // Test that munmap interceptor resets meta shadow for the memory range.
- // Previously __tsan_java_move failed because it encountered non-zero meta
- // shadow for the destination.
- int const kHeapSize = 1024 * 1024;
- jptr jheap = (jptr)mmap(0, kHeapSize, PROT_READ | PROT_WRITE,
- MAP_ANON | MAP_PRIVATE, -1, 0);
- if (jheap == (jptr)MAP_FAILED)
- return printf("mmap failed with %d\n", errno);
- __atomic_store_n((int*)jheap, 1, __ATOMIC_RELEASE);
- munmap((void*)jheap, kHeapSize);
- jheap = (jptr)mmap((void*)jheap, kHeapSize, PROT_READ | PROT_WRITE,
- MAP_ANON | MAP_PRIVATE, -1, 0);
- if (jheap == (jptr)MAP_FAILED)
- return printf("second mmap failed with %d\n", errno);
- __tsan_java_init(jheap, kHeapSize);
- __tsan_java_move(jheap + 16, jheap, 16);
- fprintf(stderr, "DONE\n");
- return __tsan_java_fini();
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/java_heap_init.cpp (from r367653, compiler-rt/trunk/test/tsan/java_heap_init.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_heap_init.cpp?p2=compiler-rt/trunk/test/tsan/java_heap_init.cpp&p1=compiler-rt/trunk/test/tsan/java_heap_init.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/java_lock.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_lock.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/java_lock.cc (original)
+++ compiler-rt/trunk/test/tsan/java_lock.cc (removed)
@@ -1,37 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "java.h"
-
-jptr varaddr;
-jptr lockaddr;
-
-void *Thread(void *p) {
- barrier_wait(&barrier);
- __tsan_java_mutex_lock(lockaddr);
- *(int*)varaddr = 42;
- __tsan_java_mutex_unlock(lockaddr);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- int const kHeapSize = 1024 * 1024;
- jptr jheap = (jptr)malloc(kHeapSize + 8) + 8;
- __tsan_java_init(jheap, kHeapSize);
- const int kBlockSize = 16;
- __tsan_java_alloc(jheap, kBlockSize);
- varaddr = jheap;
- lockaddr = jheap + 8;
- pthread_t th;
- pthread_create(&th, 0, Thread, 0);
- __tsan_java_mutex_lock(lockaddr);
- *(int*)varaddr = 43;
- __tsan_java_mutex_unlock(lockaddr);
- barrier_wait(&barrier);
- pthread_join(th, 0);
- __tsan_java_free(jheap, kBlockSize);
- fprintf(stderr, "DONE\n");
- return __tsan_java_fini();
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/java_lock.cpp (from r367653, compiler-rt/trunk/test/tsan/java_lock.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_lock.cpp?p2=compiler-rt/trunk/test/tsan/java_lock.cpp&p1=compiler-rt/trunk/test/tsan/java_lock.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/java_lock_move.cc (original)
+++ compiler-rt/trunk/test/tsan/java_lock_move.cc (removed)
@@ -1,43 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "java.h"
-
-jptr varaddr;
-jptr lockaddr;
-jptr varaddr2;
-jptr lockaddr2;
-
-void *Thread(void *p) {
- barrier_wait(&barrier);
- __tsan_java_mutex_lock(lockaddr2);
- *(int*)varaddr2 = 42;
- __tsan_java_mutex_unlock(lockaddr2);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- int const kHeapSize = 1024 * 1024;
- jptr jheap = (jptr)malloc(kHeapSize + 8) + 8;
- __tsan_java_init(jheap, kHeapSize);
- const int kBlockSize = 64;
- int const kMove = 1024;
- __tsan_java_alloc(jheap, kBlockSize);
- varaddr = jheap;
- lockaddr = jheap + 46;
- varaddr2 = varaddr + kMove;
- lockaddr2 = lockaddr + kMove;
- pthread_t th;
- pthread_create(&th, 0, Thread, 0);
- __tsan_java_mutex_lock(lockaddr);
- *(int*)varaddr = 43;
- __tsan_java_mutex_unlock(lockaddr);
- __tsan_java_move(varaddr, varaddr2, kBlockSize);
- barrier_wait(&barrier);
- pthread_join(th, 0);
- __tsan_java_free(varaddr2, kBlockSize);
- fprintf(stderr, "DONE\n");
- return __tsan_java_fini();
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/java_lock_move.cpp (from r367653, compiler-rt/trunk/test/tsan/java_lock_move.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_lock_move.cpp?p2=compiler-rt/trunk/test/tsan/java_lock_move.cpp&p1=compiler-rt/trunk/test/tsan/java_lock_move.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/java_lock_rec.cc (original)
+++ compiler-rt/trunk/test/tsan/java_lock_rec.cc (removed)
@@ -1,57 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "java.h"
-
-jptr varaddr;
-jptr lockaddr;
-
-void *Thread(void *p) {
- __tsan_java_mutex_lock(lockaddr);
- __tsan_java_mutex_lock(lockaddr);
- *(int*)varaddr = 42;
- int rec = __tsan_java_mutex_unlock_rec(lockaddr);
- if (rec != 2) {
- 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) {
- fprintf(stderr, "FAILED 3 var=%d\n", *(int*)varaddr);
- exit(1);
- }
- __tsan_java_mutex_unlock(lockaddr);
- __tsan_java_mutex_unlock(lockaddr);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- int const kHeapSize = 1024 * 1024;
- jptr jheap = (jptr)malloc(kHeapSize + 8) + 8;
- __tsan_java_init(jheap, kHeapSize);
- const int kBlockSize = 16;
- __tsan_java_alloc(jheap, kBlockSize);
- varaddr = jheap;
- *(int*)varaddr = 0;
- lockaddr = jheap + 8;
- pthread_t th;
- pthread_create(&th, 0, Thread, 0);
- barrier_wait(&barrier);
- __tsan_java_mutex_lock(lockaddr);
- if (*(int*)varaddr != 42) {
- fprintf(stderr, "FAILED 1 var=%d\n", *(int*)varaddr);
- exit(1);
- }
- *(int*)varaddr = 43;
- __tsan_java_mutex_unlock(lockaddr);
- barrier_wait(&barrier);
- pthread_join(th, 0);
- __tsan_java_free(jheap, kBlockSize);
- fprintf(stderr, "DONE\n");
- return __tsan_java_fini();
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK-NOT: FAILED
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/java_lock_rec.cpp (from r367653, compiler-rt/trunk/test/tsan/java_lock_rec.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_lock_rec.cpp?p2=compiler-rt/trunk/test/tsan/java_lock_rec.cpp&p1=compiler-rt/trunk/test/tsan/java_lock_rec.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/java_lock_rec_race.cc (original)
+++ compiler-rt/trunk/test/tsan/java_lock_rec_race.cc (removed)
@@ -1,51 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
-#include "java.h"
-
-jptr varaddr;
-jptr lockaddr;
-
-void *Thread(void *p) {
- __tsan_java_mutex_lock(lockaddr);
- __tsan_java_mutex_lock(lockaddr);
- __tsan_java_mutex_lock(lockaddr);
- int rec = __tsan_java_mutex_unlock_rec(lockaddr);
- if (rec != 3) {
- fprintf(stderr, "FAILED 0 rec=%d\n", rec);
- exit(1);
- }
- *(int*)varaddr = 42;
- barrier_wait(&barrier);
- barrier_wait(&barrier);
- __tsan_java_mutex_lock_rec(lockaddr, rec);
- __tsan_java_mutex_unlock(lockaddr);
- __tsan_java_mutex_unlock(lockaddr);
- __tsan_java_mutex_unlock(lockaddr);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- int const kHeapSize = 1024 * 1024;
- jptr jheap = (jptr)malloc(kHeapSize + 8) + 8;
- __tsan_java_init(jheap, kHeapSize);
- const int kBlockSize = 16;
- __tsan_java_alloc(jheap, kBlockSize);
- varaddr = jheap;
- *(int*)varaddr = 0;
- lockaddr = jheap + 8;
- pthread_t th;
- pthread_create(&th, 0, Thread, 0);
- barrier_wait(&barrier);
- __tsan_java_mutex_lock(lockaddr);
- *(int*)varaddr = 43;
- __tsan_java_mutex_unlock(lockaddr);
- barrier_wait(&barrier);
- pthread_join(th, 0);
- __tsan_java_free(jheap, kBlockSize);
- fprintf(stderr, "DONE\n");
- return __tsan_java_fini();
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK-NOT: FAILED
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/java_lock_rec_race.cpp (from r367653, 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.cpp?p2=compiler-rt/trunk/test/tsan/java_lock_rec_race.cpp&p1=compiler-rt/trunk/test/tsan/java_lock_rec_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/java_move_overlap.cc (original)
+++ compiler-rt/trunk/test/tsan/java_move_overlap.cc (removed)
@@ -1,74 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t
-// RUN: %run %t 2>&1 | FileCheck %s
-// RUN: %run %t arg 2>&1 | FileCheck %s
-#include "java.h"
-
-jptr varaddr1_old;
-jptr varaddr2_old;
-jptr lockaddr1_old;
-jptr lockaddr2_old;
-jptr varaddr1_new;
-jptr varaddr2_new;
-jptr lockaddr1_new;
-jptr lockaddr2_new;
-
-void *Thread(void *p) {
- barrier_wait(&barrier);
- __tsan_java_mutex_lock(lockaddr1_new);
- *(char*)varaddr1_new = 43;
- __tsan_java_mutex_unlock(lockaddr1_new);
- __tsan_java_mutex_lock(lockaddr2_new);
- *(char*)varaddr2_new = 43;
- __tsan_java_mutex_unlock(lockaddr2_new);
- return 0;
-}
-
-int main(int argc, char **argv) {
- barrier_init(&barrier, 2);
- int const kHeapSize = 1024 * 1024;
- void *jheap = malloc(kHeapSize);
- jheap = (char*)jheap + 8;
- __tsan_java_init((jptr)jheap, kHeapSize);
- const int kBlockSize = 64;
- int const kMove = 32;
- varaddr1_old = (jptr)jheap;
- lockaddr1_old = (jptr)jheap + 1;
- varaddr2_old = (jptr)jheap + kBlockSize - 1;
- lockaddr2_old = (jptr)jheap + kBlockSize - 16;
- varaddr1_new = varaddr1_old + kMove;
- lockaddr1_new = lockaddr1_old + kMove;
- varaddr2_new = varaddr2_old + kMove;
- lockaddr2_new = lockaddr2_old + kMove;
- if (argc > 1) {
- // Move memory backwards.
- varaddr1_old += kMove;
- lockaddr1_old += kMove;
- varaddr2_old += kMove;
- lockaddr2_old += kMove;
- varaddr1_new -= kMove;
- lockaddr1_new -= kMove;
- varaddr2_new -= kMove;
- lockaddr2_new -= kMove;
- }
- __tsan_java_alloc(varaddr1_old, kBlockSize);
-
- pthread_t th;
- pthread_create(&th, 0, Thread, 0);
-
- __tsan_java_mutex_lock(lockaddr1_old);
- *(char*)varaddr1_old = 43;
- __tsan_java_mutex_unlock(lockaddr1_old);
- __tsan_java_mutex_lock(lockaddr2_old);
- *(char*)varaddr2_old = 43;
- __tsan_java_mutex_unlock(lockaddr2_old);
-
- __tsan_java_move(varaddr1_old, varaddr1_new, kBlockSize);
- barrier_wait(&barrier);
- pthread_join(th, 0);
- __tsan_java_free(varaddr1_new, kBlockSize);
- fprintf(stderr, "DONE\n");
- return __tsan_java_fini();
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/java_move_overlap.cpp (from r367653, compiler-rt/trunk/test/tsan/java_move_overlap.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_move_overlap.cpp?p2=compiler-rt/trunk/test/tsan/java_move_overlap.cpp&p1=compiler-rt/trunk/test/tsan/java_move_overlap.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/java_move_overlap_race.cc (original)
+++ compiler-rt/trunk/test/tsan/java_move_overlap_race.cc (removed)
@@ -1,55 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t
-// RUN: %deflake %run %t 2>&1 | FileCheck %s
-// RUN: %deflake %run %t arg 2>&1 | FileCheck %s
-#include "java.h"
-
-jptr varaddr1_old;
-jptr varaddr2_old;
-jptr varaddr1_new;
-jptr varaddr2_new;
-
-void *Thread(void *p) {
- barrier_wait(&barrier);
- *(int*)varaddr1_new = 43;
- *(int*)varaddr2_new = 43;
- return 0;
-}
-
-int main(int argc, char **argv) {
- barrier_init(&barrier, 2);
- int const kHeapSize = 1024 * 1024;
- void *jheap = malloc(kHeapSize);
- jheap = (char*)jheap + 8;
- __tsan_java_init((jptr)jheap, kHeapSize);
- const int kBlockSize = 64;
- int const kMove = 32;
- varaddr1_old = (jptr)jheap;
- varaddr2_old = (jptr)jheap + kBlockSize - 1;
- varaddr1_new = varaddr1_old + kMove;
- varaddr2_new = varaddr2_old + kMove;
- if (argc > 1) {
- // Move memory backwards.
- varaddr1_old += kMove;
- varaddr2_old += kMove;
- varaddr1_new -= kMove;
- varaddr2_new -= kMove;
- }
- __tsan_java_alloc(varaddr1_old, kBlockSize);
-
- pthread_t th;
- pthread_create(&th, 0, Thread, 0);
-
- *(int*)varaddr1_old = 43;
- *(int*)varaddr2_old = 43;
-
- __tsan_java_move(varaddr1_old, varaddr1_new, kBlockSize);
- barrier_wait(&barrier);
- pthread_join(th, 0);
- __tsan_java_free(varaddr1_new, kBlockSize);
- fprintf(stderr, "DONE\n");
- return __tsan_java_fini();
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/java_move_overlap_race.cpp (from r367653, 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.cpp?p2=compiler-rt/trunk/test/tsan/java_move_overlap_race.cpp&p1=compiler-rt/trunk/test/tsan/java_move_overlap_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/java_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/java_race.cc (original)
+++ compiler-rt/trunk/test/tsan/java_race.cc (removed)
@@ -1,28 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "java.h"
-
-void *Thread(void *p) {
- barrier_wait(&barrier);
- *(int*)p = 42;
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- int const kHeapSize = 1024 * 1024;
- jptr jheap = (jptr)malloc(kHeapSize + 8) + 8;
- __tsan_java_init(jheap, kHeapSize);
- const int kBlockSize = 16;
- __tsan_java_alloc(jheap, kBlockSize);
- pthread_t th;
- pthread_create(&th, 0, Thread, (void*)jheap);
- *(int*)jheap = 43;
- barrier_wait(&barrier);
- pthread_join(th, 0);
- __tsan_java_free(jheap, kBlockSize);
- fprintf(stderr, "DONE\n");
- return __tsan_java_fini();
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/java_race.cpp (from r367653, compiler-rt/trunk/test/tsan/java_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_race.cpp?p2=compiler-rt/trunk/test/tsan/java_race.cpp&p1=compiler-rt/trunk/test/tsan/java_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/java_race_move.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_race_move.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/java_race_move.cc (original)
+++ compiler-rt/trunk/test/tsan/java_race_move.cc (removed)
@@ -1,35 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "java.h"
-
-jptr varaddr;
-jptr varaddr2;
-
-void *Thread(void *p) {
- barrier_wait(&barrier);
- *(int*)varaddr2 = 42;
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- int const kHeapSize = 1024 * 1024;
- jptr jheap = (jptr)malloc(kHeapSize + 8) + 8;
- __tsan_java_init(jheap, kHeapSize);
- const int kBlockSize = 64;
- int const kMove = 1024;
- __tsan_java_alloc(jheap, kBlockSize);
- varaddr = jheap + 16;
- varaddr2 = varaddr + kMove;
- pthread_t th;
- pthread_create(&th, 0, Thread, 0);
- *(int*)varaddr = 43;
- __tsan_java_move(varaddr, varaddr2, kBlockSize);
- barrier_wait(&barrier);
- pthread_join(th, 0);
- __tsan_java_free(varaddr2, kBlockSize);
- fprintf(stderr, "DONE\n");
- return __tsan_java_fini();
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/java_race_move.cpp (from r367653, compiler-rt/trunk/test/tsan/java_race_move.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_race_move.cpp?p2=compiler-rt/trunk/test/tsan/java_race_move.cpp&p1=compiler-rt/trunk/test/tsan/java_race_move.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/java_race_pc.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_race_pc.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/java_race_pc.cc (original)
+++ compiler-rt/trunk/test/tsan/java_race_pc.cc (removed)
@@ -1,40 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-// This test fails on powerpc64 big endian.
-// The Tsan report is returning wrong information about
-// the location of the race.
-// XFAIL: powerpc64-unknown-linux-gnu
-#include "java.h"
-
-void foobar() {
-}
-
-void barbaz() {
-}
-
-void *Thread(void *p) {
- barrier_wait(&barrier);
- __tsan_read1_pc((jptr)p, (jptr)foobar + kPCInc);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- int const kHeapSize = 1024 * 1024;
- jptr jheap = (jptr)malloc(kHeapSize + 8) + 8;
- __tsan_java_init(jheap, kHeapSize);
- const int kBlockSize = 16;
- __tsan_java_alloc(jheap, kBlockSize);
- pthread_t th;
- pthread_create(&th, 0, Thread, (void*)jheap);
- __tsan_write1_pc((jptr)jheap, (jptr)barbaz + kPCInc);
- barrier_wait(&barrier);
- pthread_join(th, 0);
- __tsan_java_free(jheap, kBlockSize);
- fprintf(stderr, "DONE\n");
- return __tsan_java_fini();
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: #0 foobar
-// CHECK: #0 barbaz
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/java_race_pc.cpp (from r367653, compiler-rt/trunk/test/tsan/java_race_pc.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_race_pc.cpp?p2=compiler-rt/trunk/test/tsan/java_race_pc.cpp&p1=compiler-rt/trunk/test/tsan/java_race_pc.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/java_rwlock.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_rwlock.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/java_rwlock.cc (original)
+++ compiler-rt/trunk/test/tsan/java_rwlock.cc (removed)
@@ -1,37 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "java.h"
-
-jptr varaddr;
-jptr lockaddr;
-
-void *Thread(void *p) {
- barrier_wait(&barrier);
- __tsan_java_mutex_read_lock(lockaddr);
- *(int*)varaddr = 42;
- __tsan_java_mutex_read_unlock(lockaddr);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- int const kHeapSize = 1024 * 1024;
- jptr jheap = (jptr)malloc(kHeapSize + 8) + 8;
- __tsan_java_init(jheap, kHeapSize);
- const int kBlockSize = 16;
- __tsan_java_alloc(jheap, kBlockSize);
- varaddr = jheap;
- lockaddr = jheap + 8;
- pthread_t th;
- pthread_create(&th, 0, Thread, 0);
- __tsan_java_mutex_lock(lockaddr);
- *(int*)varaddr = 43;
- __tsan_java_mutex_unlock(lockaddr);
- barrier_wait(&barrier);
- pthread_join(th, 0);
- __tsan_java_free(jheap, kBlockSize);
- fprintf(stderr, "DONE\n");
- return __tsan_java_fini();
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/java_rwlock.cpp (from r367653, compiler-rt/trunk/test/tsan/java_rwlock.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_rwlock.cpp?p2=compiler-rt/trunk/test/tsan/java_rwlock.cpp&p1=compiler-rt/trunk/test/tsan/java_rwlock.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/java_symbolization.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_symbolization.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/java_symbolization.cc (original)
+++ compiler-rt/trunk/test/tsan/java_symbolization.cc (removed)
@@ -1,40 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "java.h"
-#include <memory.h>
-
-extern "C" void __tsan_symbolize_external_ex(
- jptr pc, void (*add_frame)(void *, const char *, const char *, int, int),
- void *ctx) {
- if (pc == (1234 | kExternalPCBit)) {
- add_frame(ctx, "MyInnerFunc", "MyInnerFile.java", 1234, 56);
- add_frame(ctx, "MyOuterFunc", "MyOuterFile.java", 4321, 65);
- }
-}
-
-void *Thread(void *p) {
- barrier_wait(&barrier);
- __tsan_write1_pc((jptr)p, 1234 | kExternalPCBit);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- int const kHeapSize = 1024 * 1024;
- jptr jheap = (jptr)malloc(kHeapSize + 8) + 8;
- __tsan_java_init(jheap, kHeapSize);
- const int kBlockSize = 16;
- __tsan_java_alloc(jheap, kBlockSize);
- pthread_t th;
- pthread_create(&th, 0, Thread, (void*)jheap);
- __tsan_write1_pc((jptr)jheap, 1234 | kExternalPCBit);
- barrier_wait(&barrier);
- pthread_join(th, 0);
- __tsan_java_free(jheap, kBlockSize);
- fprintf(stderr, "DONE\n");
- return __tsan_java_fini();
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: #0 MyInnerFunc MyInnerFile.java:1234:56
-// CHECK: #1 MyOuterFunc MyOuterFile.java:4321:65
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/java_symbolization.cpp (from r367653, compiler-rt/trunk/test/tsan/java_symbolization.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_symbolization.cpp?p2=compiler-rt/trunk/test/tsan/java_symbolization.cpp&p1=compiler-rt/trunk/test/tsan/java_symbolization.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/java_symbolization_legacy.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_symbolization_legacy.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/java_symbolization_legacy.cc (original)
+++ compiler-rt/trunk/test/tsan/java_symbolization_legacy.cc (removed)
@@ -1,44 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "java.h"
-#include <memory.h>
-
-extern "C" bool __tsan_symbolize_external(jptr pc,
- char *func_buf, jptr func_siz,
- char *file_buf, jptr file_siz,
- int *line, int *col) {
- if (pc == (1234 | kExternalPCBit)) {
- memcpy(func_buf, "MyFunc", sizeof("MyFunc"));
- memcpy(file_buf, "MyFile.java", sizeof("MyFile.java"));
- *line = 1234;
- *col = 56;
- return true;
- }
- return false;
-}
-
-void *Thread(void *p) {
- barrier_wait(&barrier);
- __tsan_write1_pc((jptr)p, 1234 | kExternalPCBit);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- int const kHeapSize = 1024 * 1024;
- jptr jheap = (jptr)malloc(kHeapSize + 8) + 8;
- __tsan_java_init(jheap, kHeapSize);
- const int kBlockSize = 16;
- __tsan_java_alloc(jheap, kBlockSize);
- pthread_t th;
- pthread_create(&th, 0, Thread, (void*)jheap);
- __tsan_write1_pc((jptr)jheap, 1234 | kExternalPCBit);
- barrier_wait(&barrier);
- pthread_join(th, 0);
- __tsan_java_free(jheap, kBlockSize);
- fprintf(stderr, "DONE\n");
- return __tsan_java_fini();
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: #0 MyFunc MyFile.java:1234:56
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/java_symbolization_legacy.cpp (from r367653, compiler-rt/trunk/test/tsan/java_symbolization_legacy.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_symbolization_legacy.cpp?p2=compiler-rt/trunk/test/tsan/java_symbolization_legacy.cpp&p1=compiler-rt/trunk/test/tsan/java_symbolization_legacy.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/java_volatile.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_volatile.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/java_volatile.cc (original)
+++ compiler-rt/trunk/test/tsan/java_volatile.cc (removed)
@@ -1,42 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "java.h"
-
-jptr varaddr;
-jptr lockaddr;
-
-void *Thread(void *p) {
- while (__atomic_load_n((int*)lockaddr, __ATOMIC_RELAXED) == 0)
- usleep(1000); // spin-wait
- __tsan_java_acquire(lockaddr);
- *(int*)varaddr = 42;
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- int const kHeapSize = 1024 * 1024;
- jptr jheap = (jptr)malloc(kHeapSize + 8) + 8;
- __tsan_java_init(jheap, kHeapSize);
- const int kBlockSize = 16;
- __tsan_java_alloc(jheap, kBlockSize);
- varaddr = jheap;
- lockaddr = jheap + 8;
- pthread_t th;
- pthread_create(&th, 0, Thread, 0);
- *(int*)varaddr = 43;
- __tsan_java_release(lockaddr);
- __atomic_store_n((int*)lockaddr, 1, __ATOMIC_RELAXED);
- pthread_join(th, 0);
- *(int*)lockaddr = 0;
- pthread_create(&th, 0, Thread, 0);
- *(int*)varaddr = 43;
- __tsan_java_release_store(lockaddr);
- __atomic_store_n((int*)lockaddr, 1, __ATOMIC_RELAXED);
- pthread_join(th, 0);
- __tsan_java_free(jheap, kBlockSize);
- fprintf(stderr, "DONE\n");
- return __tsan_java_fini();
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/java_volatile.cpp (from r367653, compiler-rt/trunk/test/tsan/java_volatile.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/java_volatile.cpp?p2=compiler-rt/trunk/test/tsan/java_volatile.cpp&p1=compiler-rt/trunk/test/tsan/java_volatile.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/large_malloc_meta.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/large_malloc_meta.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/large_malloc_meta.cc (original)
+++ compiler-rt/trunk/test/tsan/large_malloc_meta.cc (removed)
@@ -1,31 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-
-// UNSUPPORTED: ios
-
-#include "test.h"
-#include <sys/mman.h>
-
-// Test for previously unbounded memory consumption for large mallocs.
-// Code allocates a large memory block (that is handled by LargeMmapAllocator),
-// and forces allocation of meta shadow for the block. Then freed the block.
-// But meta shadow was not unmapped. Then code occupies the virtual memory
-// range of the block with something else (that does not need meta shadow).
-// And repeats. As the result meta shadow growed infinitely.
-// This program used to consume >2GB. Now it consumes <50MB.
-
-int main() {
- for (int i = 0; i < 1000; i++) {
- const int kSize = 1 << 20;
- const int kPageSize = 4 << 10;
- volatile int *p = new int[kSize];
- for (int j = 0; j < kSize; j += kPageSize / sizeof(*p))
- __atomic_store_n(&p[i], 1, __ATOMIC_RELEASE);
- delete[] p;
- mmap(0, kSize * sizeof(*p) + kPageSize, PROT_NONE, MAP_PRIVATE | MAP_ANON,
- -1, 0);
- }
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/large_malloc_meta.cpp (from r367653, compiler-rt/trunk/test/tsan/large_malloc_meta.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/large_malloc_meta.cpp?p2=compiler-rt/trunk/test/tsan/large_malloc_meta.cpp&p1=compiler-rt/trunk/test/tsan/large_malloc_meta.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/libcxx/std_shared_ptr.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/libcxx/std_shared_ptr.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/libcxx/std_shared_ptr.cc (original)
+++ compiler-rt/trunk/test/tsan/libcxx/std_shared_ptr.cc (removed)
@@ -1,24 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s %link_libcxx_tsan -o %t && %run %t 2>&1 | FileCheck %s
-#include <stdio.h>
-#include <memory>
-#include <thread>
-
-int main() {
- int v1 = 0;
- int v2 = 0;
- std::thread t1;
- std::thread t2;
-
- {
- auto thingy = std::make_shared<int>(42);
- t1 = std::thread([thingy, &v1] { v1 = *thingy; });
- t2 = std::thread([thingy, &v2] { v2 = *thingy; });
- }
-
- t1.join();
- t2.join();
- printf("%d %d\n", v1, v2);
- // CHECK-NOT: ThreadSanitizer: data race
- // CHECK: 42 42
- return 0;
-}
Copied: compiler-rt/trunk/test/tsan/libcxx/std_shared_ptr.cpp (from r367653, compiler-rt/trunk/test/tsan/libcxx/std_shared_ptr.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/libcxx/std_shared_ptr.cpp?p2=compiler-rt/trunk/test/tsan/libcxx/std_shared_ptr.cpp&p1=compiler-rt/trunk/test/tsan/libcxx/std_shared_ptr.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/libdispatch/groups-destructor.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/libdispatch/groups-destructor.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/libdispatch/groups-destructor.cc (original)
+++ compiler-rt/trunk/test/tsan/libdispatch/groups-destructor.cc (removed)
@@ -1,43 +0,0 @@
-// RUN: %clangxx_tsan %s %link_libcxx_tsan -o %t
-// RUN: %run %t 2>&1 | FileCheck %s --implicit-check-not='ThreadSanitizer'
-
-#include <dispatch/dispatch.h>
-
-#include <memory>
-#include <stdatomic.h>
-#include <cstdio>
-
-_Atomic(long) destructor_counter = 0;
-
-struct MyStruct {
- virtual ~MyStruct() {
- usleep(10000);
- atomic_fetch_add_explicit(&destructor_counter, 1, memory_order_relaxed);
- }
-};
-
-int main(int argc, const char *argv[]) {
- fprintf(stderr, "Hello world.\n");
-
- dispatch_queue_t q = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
- dispatch_group_t g = dispatch_group_create();
-
- for (int i = 0; i < 100; i++) {
- std::shared_ptr<MyStruct> shared(new MyStruct());
-
- dispatch_group_async(g, q, ^{
- shared.get(); // just to make sure the object is captured by the block
- });
- }
-
- dispatch_group_wait(g, DISPATCH_TIME_FOREVER);
-
- if (destructor_counter != 100) {
- abort();
- }
-
- fprintf(stderr, "Done.\n");
-}
-
-// CHECK: Hello world.
-// CHECK: Done.
Copied: compiler-rt/trunk/test/tsan/libdispatch/groups-destructor.cpp (from r367653, compiler-rt/trunk/test/tsan/libdispatch/groups-destructor.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/libdispatch/groups-destructor.cpp?p2=compiler-rt/trunk/test/tsan/libdispatch/groups-destructor.cpp&p1=compiler-rt/trunk/test/tsan/libdispatch/groups-destructor.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/libdispatch/sync-block-copy.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/libdispatch/sync-block-copy.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/libdispatch/sync-block-copy.cc (original)
+++ compiler-rt/trunk/test/tsan/libdispatch/sync-block-copy.cc (removed)
@@ -1,45 +0,0 @@
-// This test verifies that dispatch_sync() doesn't actually copy the block under TSan (without TSan, it doesn't).
-
-// RUN: %clangxx_tsan %s -o %t_no_tsan -fno-sanitize=thread
-// RUN: %clangxx_tsan %s -o %t_with_tsan
-
-// RUN: %run %t_no_tsan 2>&1 | FileCheck %s
-// RUN: %run %t_with_tsan 2>&1 | FileCheck %s --implicit-check-not='ThreadSanitizer'
-
-#include <dispatch/dispatch.h>
-
-#include <stdio.h>
-
-struct MyClass {
- static int copyCount;
- static void printCopyCount() {
- fprintf(stderr, "copyCount = %d\n", copyCount);
- }
- MyClass(){};
- MyClass(const MyClass &obj) { copyCount++; };
- void foo() const {
- fprintf(stderr, "MyClass::foo\n");
- }
-};
-int MyClass::copyCount = 0;
-
-int main(int argc, const char* argv[]) {
- dispatch_queue_t q = dispatch_queue_create("my.queue", NULL);
- MyClass obj;
- MyClass::printCopyCount();
- void (^block)(void) = ^{
- obj.foo();
- };
- MyClass::printCopyCount();
- dispatch_sync(q, block);
- MyClass::printCopyCount();
-
- fprintf(stderr, "Done.\n");
- return 0;
-}
-
-// CHECK: copyCount = 0
-// CHECK: copyCount = 1
-// CHECK: MyClass::foo
-// CHECK: copyCount = 1
-// CHECK: Done.
Copied: compiler-rt/trunk/test/tsan/libdispatch/sync-block-copy.cpp (from r367653, compiler-rt/trunk/test/tsan/libdispatch/sync-block-copy.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/libdispatch/sync-block-copy.cpp?p2=compiler-rt/trunk/test/tsan/libdispatch/sync-block-copy.cpp&p1=compiler-rt/trunk/test/tsan/libdispatch/sync-block-copy.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/load_shared_lib.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/load_shared_lib.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/load_shared_lib.cc (original)
+++ compiler-rt/trunk/test/tsan/load_shared_lib.cc (removed)
@@ -1,74 +0,0 @@
-// Check that if the list of shared libraries changes between the two race
-// reports, the second report occurring in a new shared library is still
-// symbolized correctly.
-
-// RUN: %clangxx_tsan -O1 %s -DBUILD_SO -fPIC -shared -o %t-so.so
-// RUN: %clangxx_tsan -O1 %s %link_libcxx_tsan -o %t -rdynamic && %deflake %run %t | FileCheck %s
-
-#ifdef BUILD_SO
-
-#include "test.h"
-
-int GLOB_SHARED = 0;
-
-extern "C"
-void init_so() {
- barrier_init(&barrier, 2);
-}
-
-extern "C"
-void *write_from_so(void *unused) {
- if (unused == 0)
- barrier_wait(&barrier);
- GLOB_SHARED++;
- if (unused != 0)
- barrier_wait(&barrier);
- return NULL;
-}
-
-#else // BUILD_SO
-
-#include "test.h"
-#include <dlfcn.h>
-#include <string>
-
-int GLOB = 0;
-
-void *write_glob(void *unused) {
- if (unused == 0)
- barrier_wait(&barrier);
- GLOB++;
- if (unused != 0)
- barrier_wait(&barrier);
- return NULL;
-}
-
-void race_two_threads(void *(*access_callback)(void *unused)) {
- pthread_t t1, t2;
- pthread_create(&t1, NULL, access_callback, (void*)1);
- pthread_create(&t2, NULL, access_callback, NULL);
- pthread_join(t1, NULL);
- pthread_join(t2, NULL);
-}
-
-int main(int argc, char *argv[]) {
- barrier_init(&barrier, 2);
- std::string path = std::string(argv[0]) + std::string("-so.so");
- race_two_threads(write_glob);
- // CHECK: write_glob
- void *lib = dlopen(path.c_str(), RTLD_NOW);
- if (!lib) {
- printf("error in dlopen(): %s\n", dlerror());
- return 1;
- }
- void (*init_so)();
- *(void **)&init_so = dlsym(lib, "init_so");
- init_so();
- void *(*write_from_so)(void *unused);
- *(void **)&write_from_so = dlsym(lib, "write_from_so");
- race_two_threads(write_from_so);
- // CHECK: write_from_so
- return 0;
-}
-
-#endif // BUILD_SO
Copied: compiler-rt/trunk/test/tsan/load_shared_lib.cpp (from r367653, compiler-rt/trunk/test/tsan/load_shared_lib.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/load_shared_lib.cpp?p2=compiler-rt/trunk/test/tsan/load_shared_lib.cpp&p1=compiler-rt/trunk/test/tsan/load_shared_lib.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/longjmp.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/longjmp.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/longjmp.cc (original)
+++ compiler-rt/trunk/test/tsan/longjmp.cc (removed)
@@ -1,23 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <setjmp.h>
-
-int foo(jmp_buf env) {
- longjmp(env, 42);
-}
-
-int main() {
- jmp_buf env;
- if (setjmp(env) == 42) {
- fprintf(stderr, "JUMPED\n");
- return 0;
- }
- foo(env);
- fprintf(stderr, "FAILED\n");
- return 0;
-}
-
-// CHECK-NOT: FAILED
-// CHECK: JUMPED
Copied: compiler-rt/trunk/test/tsan/longjmp.cpp (from r367653, compiler-rt/trunk/test/tsan/longjmp.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/longjmp.cpp?p2=compiler-rt/trunk/test/tsan/longjmp.cpp&p1=compiler-rt/trunk/test/tsan/longjmp.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/longjmp2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/longjmp2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/longjmp2.cc (original)
+++ compiler-rt/trunk/test/tsan/longjmp2.cc (removed)
@@ -1,25 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <setjmp.h>
-
-int foo(sigjmp_buf env) {
- printf("env=%p\n", env);
- siglongjmp(env, 42);
-}
-
-int main() {
- sigjmp_buf env;
- printf("env=%p\n", env);
- if (sigsetjmp(env, 1) == 42) {
- fprintf(stderr, "JUMPED\n");
- return 0;
- }
- foo(env);
- fprintf(stderr, "FAILED\n");
- return 0;
-}
-
-// CHECK-NOT: FAILED
-// CHECK: JUMPED
Copied: compiler-rt/trunk/test/tsan/longjmp2.cpp (from r367653, compiler-rt/trunk/test/tsan/longjmp2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/longjmp2.cpp?p2=compiler-rt/trunk/test/tsan/longjmp2.cpp&p1=compiler-rt/trunk/test/tsan/longjmp2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/longjmp3.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/longjmp3.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/longjmp3.cc (original)
+++ compiler-rt/trunk/test/tsan/longjmp3.cc (removed)
@@ -1,49 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
-
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <setjmp.h>
-
-void bar(jmp_buf env) {
- volatile int x = 42;
- longjmp(env, 42);
- x++;
-}
-
-void foo(jmp_buf env) {
- volatile int x = 42;
- bar(env);
- x++;
-}
-
-void badguy() {
- pthread_mutex_t mtx;
- pthread_mutex_init(&mtx, 0);
- pthread_mutex_lock(&mtx);
- pthread_mutex_destroy(&mtx);
-}
-
-void mymain() {
- jmp_buf env;
- if (setjmp(env) == 42) {
- badguy();
- return;
- }
- foo(env);
- fprintf(stderr, "FAILED\n");
-}
-
-int main() {
- volatile int x = 42;
- mymain();
- return x;
-}
-
-// CHECK-NOT: FAILED
-// CHECK: WARNING: ThreadSanitizer: destroy of a locked mutex
-// CHECK: #0 pthread_mutex_destroy
-// CHECK: #1 badguy
-// CHECK: #2 mymain
-// CHECK: #3 main
-
Copied: compiler-rt/trunk/test/tsan/longjmp3.cpp (from r367653, compiler-rt/trunk/test/tsan/longjmp3.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/longjmp3.cpp?p2=compiler-rt/trunk/test/tsan/longjmp3.cpp&p1=compiler-rt/trunk/test/tsan/longjmp3.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/longjmp4.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/longjmp4.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/longjmp4.cc (original)
+++ compiler-rt/trunk/test/tsan/longjmp4.cc (removed)
@@ -1,52 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
-
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <setjmp.h>
-#include <string.h>
-
-void bar(jmp_buf env) {
- volatile int x = 42;
- jmp_buf env2;
- memcpy(env2, env, sizeof(jmp_buf));
- longjmp(env2, 42);
- x++;
-}
-
-void foo(jmp_buf env) {
- volatile int x = 42;
- bar(env);
- x++;
-}
-
-void badguy() {
- pthread_mutex_t mtx;
- pthread_mutex_init(&mtx, 0);
- pthread_mutex_lock(&mtx);
- pthread_mutex_destroy(&mtx);
-}
-
-void mymain() {
- jmp_buf env;
- if (setjmp(env) == 42) {
- badguy();
- return;
- }
- foo(env);
- fprintf(stderr, "FAILED\n");
-}
-
-int main() {
- volatile int x = 42;
- mymain();
- return x;
-}
-
-// CHECK-NOT: FAILED
-// CHECK: WARNING: ThreadSanitizer: destroy of a locked mutex
-// CHECK: #0 pthread_mutex_destroy
-// CHECK: #1 badguy
-// CHECK: #2 mymain
-// CHECK: #3 main
-
Copied: compiler-rt/trunk/test/tsan/longjmp4.cpp (from r367653, compiler-rt/trunk/test/tsan/longjmp4.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/longjmp4.cpp?p2=compiler-rt/trunk/test/tsan/longjmp4.cpp&p1=compiler-rt/trunk/test/tsan/longjmp4.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/malloc_overflow.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/malloc_overflow.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/malloc_overflow.cc (original)
+++ compiler-rt/trunk/test/tsan/malloc_overflow.cc (removed)
@@ -1,23 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t
-// RUN: %env_tsan_opts=allocator_may_return_null=1 %run %t 2>&1 | FileCheck %s
-#include <stdio.h>
-#include <stdlib.h>
-
-int main() {
- void *p = malloc((size_t)-1);
- if (p != 0)
- fprintf(stderr, "FAIL malloc(-1) = %p\n", p);
- p = malloc((size_t)-1 / 2);
- if (p != 0)
- fprintf(stderr, "FAIL malloc(-1/2) = %p\n", p);
- p = calloc((size_t)-1, (size_t)-1);
- if (p != 0)
- fprintf(stderr, "FAIL calloc(-1, -1) = %p\n", p);
- p = calloc((size_t)-1 / 2, (size_t)-1 / 2);
- if (p != 0)
- fprintf(stderr, "FAIL calloc(-1/2, -1/2) = %p\n", p);
- fprintf(stderr, "OK\n");
-}
-
-// CHECK-NOT: FAIL
-// CHECK-NOT: failed to allocate
Copied: compiler-rt/trunk/test/tsan/malloc_overflow.cpp (from r367653, compiler-rt/trunk/test/tsan/malloc_overflow.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/malloc_overflow.cpp?p2=compiler-rt/trunk/test/tsan/malloc_overflow.cpp&p1=compiler-rt/trunk/test/tsan/malloc_overflow.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/malloc_stack.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/malloc_stack.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/malloc_stack.cc (original)
+++ compiler-rt/trunk/test/tsan/malloc_stack.cc (removed)
@@ -1,26 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-_Atomic(int*) p;
-
-void *thr(void *a) {
- barrier_wait(&barrier);
- int *pp = __c11_atomic_load(&p, __ATOMIC_RELAXED);
- *pp = 42;
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t th;
- pthread_create(&th, 0, thr, p);
- __c11_atomic_store(&p, new int, __ATOMIC_RELAXED);
- barrier_wait(&barrier);
- pthread_join(th, 0);
-}
-
-// CHECK: data race
-// CHECK: Previous write
-// CHECK: #0 operator new
-// CHECK: Location is heap block
-// CHECK: #0 operator new
Copied: compiler-rt/trunk/test/tsan/malloc_stack.cpp (from r367653, compiler-rt/trunk/test/tsan/malloc_stack.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/malloc_stack.cpp?p2=compiler-rt/trunk/test/tsan/malloc_stack.cpp&p1=compiler-rt/trunk/test/tsan/malloc_stack.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/map32bit.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/map32bit.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/map32bit.cc (original)
+++ compiler-rt/trunk/test/tsan/map32bit.cc (removed)
@@ -1,47 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
-#include "test.h"
-#include <stdint.h>
-#include <errno.h>
-#include <sys/mman.h>
-
-// Test for issue:
-// https://github.com/google/sanitizers/issues/412
-
-// MAP_32BIT flag for mmap is supported only for x86_64.
-// XFAIL: mips
-// XFAIL: aarch64
-// XFAIL: powerpc64
-
-// MAP_32BIT doesn't exist on OS X and NetBSD.
-// UNSUPPORTED: darwin,netbsd
-
-void *Thread(void *ptr) {
- *(int*)ptr = 42;
- barrier_wait(&barrier);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- void *ptr = mmap(0, 128 << 10, PROT_READ|PROT_WRITE,
- MAP_32BIT|MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
- fprintf(stderr, "ptr=%p\n", ptr);
- if (ptr == MAP_FAILED) {
- fprintf(stderr, "mmap failed: %d\n", errno);
- return 1;
- }
- if ((uintptr_t)ptr >= (1ull << 32)) {
- fprintf(stderr, "ptr is too high\n");
- return 1;
- }
- pthread_t t;
- pthread_create(&t, 0, Thread, ptr);
- barrier_wait(&barrier);
- *(int*)ptr = 42;
- pthread_join(t, 0);
- munmap(ptr, 128 << 10);
- fprintf(stderr, "DONE\n");
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/map32bit.cpp (from r367653, compiler-rt/trunk/test/tsan/map32bit.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/map32bit.cpp?p2=compiler-rt/trunk/test/tsan/map32bit.cpp&p1=compiler-rt/trunk/test/tsan/map32bit.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/memcmp_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/memcmp_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/memcmp_race.cc (original)
+++ compiler-rt/trunk/test/tsan/memcmp_race.cc (removed)
@@ -1,42 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-#include <string.h>
-
-char *data0 = new char[10];
-char *data1 = new char[10];
-char *data2 = new char[10];
-
-void *Thread1(void *x) {
- static volatile int size = 1;
- static volatile int sink;
- sink = memcmp(data0+5, data1, size);
- barrier_wait(&barrier);
- return NULL;
-}
-
-void *Thread2(void *x) {
- static volatile int size = 4;
- barrier_wait(&barrier);
- memcpy(data0+5, data2, size);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- print_address("addr=", 1, &data0[5]);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- return 0;
-}
-
-// CHECK: addr=[[ADDR:0x[0-9,a-f]+]]
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Write of size 1 at [[ADDR]] by thread T2:
-// CHECK: #0 {{(memcpy|memmove)}}
-// CHECK: #1 Thread2
-// CHECK: Previous read of size 1 at [[ADDR]] by thread T1:
-// CHECK: #0 memcmp
-// CHECK: #1 Thread1
Copied: compiler-rt/trunk/test/tsan/memcmp_race.cpp (from r367653, compiler-rt/trunk/test/tsan/memcmp_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/memcmp_race.cpp?p2=compiler-rt/trunk/test/tsan/memcmp_race.cpp&p1=compiler-rt/trunk/test/tsan/memcmp_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/memcpy_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/memcpy_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/memcpy_race.cc (original)
+++ compiler-rt/trunk/test/tsan/memcpy_race.cc (removed)
@@ -1,41 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-#include <string.h>
-
-char *data = new char[10];
-char *data1 = new char[10];
-char *data2 = new char[10];
-
-void *Thread1(void *x) {
- static volatile int size = 1;
- memcpy(data+5, data1, size);
- barrier_wait(&barrier);
- return NULL;
-}
-
-void *Thread2(void *x) {
- static volatile int size = 4;
- barrier_wait(&barrier);
- memcpy(data+3, data2, size);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- print_address("addr=", 1, &data[5]);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- return 0;
-}
-
-// CHECK: addr=[[ADDR:0x[0-9,a-f]+]]
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Write of size 1 at [[ADDR]] by thread T2:
-// CHECK: #0 {{(memcpy|memmove)}}
-// CHECK: #1 Thread2
-// CHECK: Previous write of size 1 at [[ADDR]] by thread T1:
-// CHECK: #0 {{(memcpy|memmove)}}
-// CHECK: #1 Thread1
Copied: compiler-rt/trunk/test/tsan/memcpy_race.cpp (from r367653, compiler-rt/trunk/test/tsan/memcpy_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/memcpy_race.cpp?p2=compiler-rt/trunk/test/tsan/memcpy_race.cpp&p1=compiler-rt/trunk/test/tsan/memcpy_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/mmap_large.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mmap_large.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mmap_large.cc (original)
+++ compiler-rt/trunk/test/tsan/mmap_large.cc (removed)
@@ -1,36 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-
-// UNSUPPORTED: ios
-
-#include <stdint.h>
-#include <stdio.h>
-#include <errno.h>
-#include <sys/mman.h>
-
-#if defined(__FreeBSD__)
-// The MAP_NORESERVE define has been removed in FreeBSD 11.x, and even before
-// that, it was never implemented. So just define it to zero.
-#undef MAP_NORESERVE
-#define MAP_NORESERVE 0
-#endif
-
-int main() {
-#ifdef __x86_64__
- const size_t kLog2Size = 39;
-#elif defined(__mips64) || defined(__aarch64__)
- const size_t kLog2Size = 32;
-#elif defined(__powerpc64__)
- const size_t kLog2Size = 39;
-#endif
- const uintptr_t kLocation = 0x40ULL << kLog2Size;
- void *p = mmap(
- reinterpret_cast<void*>(kLocation),
- 1ULL << kLog2Size,
- PROT_READ|PROT_WRITE,
- MAP_PRIVATE|MAP_ANON|MAP_NORESERVE,
- -1, 0);
- fprintf(stderr, "DONE %p %d\n", p, errno);
- return p == MAP_FAILED;
-}
-
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/mmap_large.cpp (from r367653, compiler-rt/trunk/test/tsan/mmap_large.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mmap_large.cpp?p2=compiler-rt/trunk/test/tsan/mmap_large.cpp&p1=compiler-rt/trunk/test/tsan/mmap_large.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/mmap_stress.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mmap_stress.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mmap_stress.cc (original)
+++ compiler-rt/trunk/test/tsan/mmap_stress.cc (removed)
@@ -1,67 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "test.h"
-#include <errno.h>
-#include <sys/mman.h>
-
-void *SubWorker(void *arg) {
- (void)arg;
- const int kMmapSize = 65536;
- for (int i = 0; i < 500; i++) {
- int *ptr = (int*)mmap(0, kMmapSize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANON, -1, 0);
- if (ptr == MAP_FAILED)
- exit(printf("mmap failed: %d\n", errno));
- *ptr = 42;
- if (munmap(ptr, kMmapSize))
- exit(printf("munmap failed: %d\n", errno));
- }
- return 0;
-}
-
-void *Worker1(void *arg) {
- (void)arg;
- pthread_t th[4];
- for (int i = 0; i < 4; i++) {
- if (pthread_create(&th[i], 0, SubWorker, 0))
- exit(printf("pthread_create failed: %d\n", errno));
- }
- for (int i = 0; i < 4; i++) {
- if (pthread_join(th[i], 0))
- exit(printf("pthread_join failed: %d\n", errno));
- }
- return 0;
-}
-
-void *Worker(void *arg) {
- (void)arg;
- pthread_t th[4];
- for (int i = 0; i < 4; i++) {
- if (pthread_create(&th[i], 0, Worker1, 0))
- exit(printf("pthread_create failed: %d\n", errno));
- }
- for (int i = 0; i < 4; i++) {
- if (pthread_join(th[i], 0))
- exit(printf("pthread_join failed: %d\n", errno));
- }
- return 0;
-}
-
-int main() {
- // This test is flaky on several builders:
- // https://groups.google.com/d/msg/llvm-dev/KUFPdLhBN3Q/L75rwW9xBgAJ
- // The cause is unknown (lit hides test output on failures).
-#if 0
- pthread_t th[4];
- for (int i = 0; i < 4; i++) {
- if (pthread_create(&th[i], 0, Worker, 0))
- exit(printf("pthread_create failed: %d\n", errno));
- }
- for (int i = 0; i < 4; i++) {
- if (pthread_join(th[i], 0))
- exit(printf("pthread_join failed: %d\n", errno));
- }
-#endif
- fprintf(stderr, "DONE\n");
-}
-
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/mmap_stress.cpp (from r367653, compiler-rt/trunk/test/tsan/mmap_stress.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mmap_stress.cpp?p2=compiler-rt/trunk/test/tsan/mmap_stress.cpp&p1=compiler-rt/trunk/test/tsan/mmap_stress.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/mop_with_offset.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mop_with_offset.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mop_with_offset.cc (original)
+++ compiler-rt/trunk/test/tsan/mop_with_offset.cc (removed)
@@ -1,35 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-void *Thread1(void *x) {
- int *p = (int*)x;
- p[0] = 1;
- barrier_wait(&barrier);
- return NULL;
-}
-
-void *Thread2(void *x) {
- barrier_wait(&barrier);
- char *p = (char*)x;
- p[2] = 1;
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- int *data = new int(42);
- print_address("ptr1=", 1, data);
- print_address("ptr2=", 1, (char*)data + 2);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, data);
- pthread_create(&t[1], NULL, Thread2, data);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- delete data;
-}
-
-// CHECK: ptr1=[[PTR1:0x[0-9,a-f]+]]
-// CHECK: ptr2=[[PTR2:0x[0-9,a-f]+]]
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Write of size 1 at [[PTR2]] by thread T2:
-// CHECK: Previous write of size 4 at [[PTR1]] by thread T1:
Copied: compiler-rt/trunk/test/tsan/mop_with_offset.cpp (from r367653, compiler-rt/trunk/test/tsan/mop_with_offset.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mop_with_offset.cpp?p2=compiler-rt/trunk/test/tsan/mop_with_offset.cpp&p1=compiler-rt/trunk/test/tsan/mop_with_offset.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/mop_with_offset2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mop_with_offset2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mop_with_offset2.cc (original)
+++ compiler-rt/trunk/test/tsan/mop_with_offset2.cc (removed)
@@ -1,35 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-void *Thread1(void *x) {
- barrier_wait(&barrier);
- int *p = (int*)x;
- p[0] = 1;
- return NULL;
-}
-
-void *Thread2(void *x) {
- char *p = (char*)x;
- p[2] = 1;
- barrier_wait(&barrier);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- int *data = new int(42);
- print_address("ptr1=", 1, data);
- print_address("ptr2=", 1, (char*)data + 2);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, data);
- pthread_create(&t[1], NULL, Thread2, data);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- delete data;
-}
-
-// CHECK: ptr1=[[PTR1:0x[0-9,a-f]+]]
-// CHECK: ptr2=[[PTR2:0x[0-9,a-f]+]]
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Write of size 4 at [[PTR1]] by thread T1:
-// CHECK: Previous write of size 1 at [[PTR2]] by thread T2:
Copied: compiler-rt/trunk/test/tsan/mop_with_offset2.cpp (from r367653, compiler-rt/trunk/test/tsan/mop_with_offset2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mop_with_offset2.cpp?p2=compiler-rt/trunk/test/tsan/mop_with_offset2.cpp&p1=compiler-rt/trunk/test/tsan/mop_with_offset2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/must_deadlock.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/must_deadlock.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/must_deadlock.cc (original)
+++ compiler-rt/trunk/test/tsan/must_deadlock.cc (removed)
@@ -1,50 +0,0 @@
-// Test that the deadlock detector can find a deadlock that actually happened.
-// Currently we will fail to report such a deadlock because we check for
-// cycles in lock-order graph after pthread_mutex_lock.
-
-// RUN: %clangxx_tsan %s -o %t
-// RUN: not %run %t 2>&1 | FileCheck %s
-// XFAIL: *
-#include <pthread.h>
-#include <stdio.h>
-#include <unistd.h>
-
-pthread_mutex_t mu1, mu2;
-pthread_barrier_t barrier;
-
-void *Thread(void *p) {
- // mu2 => mu1
- pthread_mutex_lock(&mu2);
- pthread_barrier_wait(&barrier);
- pthread_mutex_lock(&mu1);
- // CHECK: ThreadSanitizer: lock-order-inversion (potential deadlock)
- pthread_mutex_unlock(&mu1);
- pthread_mutex_unlock(&mu2);
- return p;
-}
-
-int main() {
- pthread_mutex_init(&mu1, NULL);
- pthread_mutex_init(&mu2, NULL);
- pthread_barrier_init(&barrier, 0, 2);
-
- fprintf(stderr, "This test is going to deadlock and die in 3 seconds\n");
- alarm(3);
-
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
-
- // mu1 => mu2
- pthread_mutex_lock(&mu1);
- pthread_barrier_wait(&barrier);
- pthread_mutex_lock(&mu2);
- pthread_mutex_unlock(&mu2);
- pthread_mutex_unlock(&mu1);
-
- pthread_join(t, 0);
-
- pthread_mutex_destroy(&mu1);
- pthread_mutex_destroy(&mu2);
- pthread_barrier_destroy(&barrier);
- fprintf(stderr, "FAILED\n");
-}
Copied: compiler-rt/trunk/test/tsan/must_deadlock.cpp (from r367653, compiler-rt/trunk/test/tsan/must_deadlock.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/must_deadlock.cpp?p2=compiler-rt/trunk/test/tsan/must_deadlock.cpp&p1=compiler-rt/trunk/test/tsan/must_deadlock.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/mutex_annotations.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutex_annotations.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mutex_annotations.cc (original)
+++ compiler-rt/trunk/test/tsan/mutex_annotations.cc (removed)
@@ -1,49 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "test.h"
-
-// Test that a linker-initialized mutex can be created/destroyed while in use.
-
-// Stub for testing, just invokes annotations.
-// Meant to be synchronized externally with test barrier.
-class Mutex {
- public:
- void Create(bool linker_initialized = false) {
- if (linker_initialized)
- ANNOTATE_RWLOCK_CREATE_STATIC(&state_);
- else
- ANNOTATE_RWLOCK_CREATE(&state_);
- }
-
- void Destroy() {
- ANNOTATE_RWLOCK_DESTROY(&state_);
- }
-
- void Lock() {
- ANNOTATE_RWLOCK_ACQUIRED(&state_, true);
- }
-
- void Unlock() {
- ANNOTATE_RWLOCK_RELEASED(&state_, true);
- }
-
- private:
- long long state_;
-};
-
-int main() {
- Mutex m;
-
- m.Lock();
- m.Create(true);
- m.Unlock();
-
- m.Lock();
- m.Destroy();
- m.Unlock();
-
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer:
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/mutex_annotations.cpp (from r367653, compiler-rt/trunk/test/tsan/mutex_annotations.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutex_annotations.cpp?p2=compiler-rt/trunk/test/tsan/mutex_annotations.cpp&p1=compiler-rt/trunk/test/tsan/mutex_annotations.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/mutex_bad_read_lock.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutex_bad_read_lock.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mutex_bad_read_lock.cc (original)
+++ compiler-rt/trunk/test/tsan/mutex_bad_read_lock.cc (removed)
@@ -1,19 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-extern "C" void AnnotateRWLockAcquired(const char *f, int l, void *m, long rw);
-
-int main() {
- int m = 0;
- AnnotateRWLockAcquired(__FILE__, __LINE__, &m, 1);
- AnnotateRWLockAcquired(__FILE__, __LINE__, &m, 0);
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: read lock of a write locked mutex
-// CHECK: #0 AnnotateRWLockAcquired
-// CHECK: #1 main
-// CHECK: Location is stack of main thread.
-// CHECK: Mutex {{.*}}) created at:
-// CHECK: #0 AnnotateRWLockAcquired
-// CHECK: #1 main
-// CHECK: SUMMARY: ThreadSanitizer: read lock of a write locked mutex
-
Copied: compiler-rt/trunk/test/tsan/mutex_bad_read_lock.cpp (from r367653, compiler-rt/trunk/test/tsan/mutex_bad_read_lock.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutex_bad_read_lock.cpp?p2=compiler-rt/trunk/test/tsan/mutex_bad_read_lock.cpp&p1=compiler-rt/trunk/test/tsan/mutex_bad_read_lock.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/mutex_bad_read_unlock.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutex_bad_read_unlock.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mutex_bad_read_unlock.cc (original)
+++ compiler-rt/trunk/test/tsan/mutex_bad_read_unlock.cc (removed)
@@ -1,20 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-extern "C" void AnnotateRWLockAcquired(const char *f, int l, void *m, long rw);
-extern "C" void AnnotateRWLockReleased(const char *f, int l, void *m, long rw);
-
-int main() {
- int m = 0;
- AnnotateRWLockAcquired(__FILE__, __LINE__, &m, 1);
- AnnotateRWLockReleased(__FILE__, __LINE__, &m, 0);
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: read unlock of a write locked mutex
-// CHECK: #0 AnnotateRWLockReleased
-// CHECK: #1 main
-// CHECK: Location is stack of main thread.
-// CHECK: Mutex {{.*}}) created at:
-// CHECK: #0 AnnotateRWLockAcquired
-// CHECK: #1 main
-// CHECK: SUMMARY: ThreadSanitizer: read unlock of a write locked mutex
-
Copied: compiler-rt/trunk/test/tsan/mutex_bad_read_unlock.cpp (from r367653, compiler-rt/trunk/test/tsan/mutex_bad_read_unlock.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutex_bad_read_unlock.cpp?p2=compiler-rt/trunk/test/tsan/mutex_bad_read_unlock.cpp&p1=compiler-rt/trunk/test/tsan/mutex_bad_read_unlock.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/mutex_bad_unlock.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutex_bad_unlock.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mutex_bad_unlock.cc (original)
+++ compiler-rt/trunk/test/tsan/mutex_bad_unlock.cc (removed)
@@ -1,18 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-extern "C" void AnnotateRWLockReleased(const char *f, int l, void *m, long rw);
-
-int main() {
- int m = 0;
- AnnotateRWLockReleased(__FILE__, __LINE__, &m, 1);
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: unlock of an unlocked mutex (or by a wrong thread)
-// CHECK: #0 AnnotateRWLockReleased
-// CHECK: #1 main
-// CHECK: Location is stack of main thread.
-// CHECK: Mutex {{.*}} created at:
-// CHECK: #0 AnnotateRWLockReleased
-// CHECK: #1 main
-// CHECK: SUMMARY: ThreadSanitizer: unlock of an unlocked mutex (or by a wrong thread)
-
Copied: compiler-rt/trunk/test/tsan/mutex_bad_unlock.cpp (from r367653, compiler-rt/trunk/test/tsan/mutex_bad_unlock.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutex_bad_unlock.cpp?p2=compiler-rt/trunk/test/tsan/mutex_bad_unlock.cpp&p1=compiler-rt/trunk/test/tsan/mutex_bad_unlock.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/mutex_destroy_locked.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutex_destroy_locked.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mutex_destroy_locked.cc (original)
+++ compiler-rt/trunk/test/tsan/mutex_destroy_locked.cc (removed)
@@ -1,22 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include <pthread.h>
-#include <unistd.h>
-
-int main() {
- pthread_mutex_t m;
- pthread_mutex_init(&m, 0);
- pthread_mutex_lock(&m);
- pthread_mutex_destroy(&m);
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: destroy of a locked mutex
-// CHECK: #0 pthread_mutex_destroy
-// CHECK: #1 main
-// CHECK: and:
-// CHECK: #0 pthread_mutex_lock
-// CHECK: #1 main
-// CHECK: Mutex {{.*}} created at:
-// CHECK: #0 pthread_mutex_init
-// CHECK: #1 main
-// CHECK: SUMMARY: ThreadSanitizer: destroy of a locked mutex{{.*}}main
Copied: compiler-rt/trunk/test/tsan/mutex_destroy_locked.cpp (from r367653, compiler-rt/trunk/test/tsan/mutex_destroy_locked.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutex_destroy_locked.cpp?p2=compiler-rt/trunk/test/tsan/mutex_destroy_locked.cpp&p1=compiler-rt/trunk/test/tsan/mutex_destroy_locked.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/mutex_destroy_locked2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutex_destroy_locked2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mutex_destroy_locked2.cc (original)
+++ compiler-rt/trunk/test/tsan/mutex_destroy_locked2.cc (removed)
@@ -1,29 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include <pthread.h>
-#include <unistd.h>
-
-void *thread(void *arg) {
- pthread_mutex_t m;
- pthread_mutex_init(&m, 0);
- pthread_mutex_lock(&m);
- pthread_mutex_destroy(&m);
- return 0;
-}
-
-int main() {
- pthread_t th;
- pthread_create(&th, 0, thread, 0);
- pthread_join(th, 0);
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: destroy of a locked mutex
-// CHECK: #0 pthread_mutex_destroy
-// CHECK: #1 thread
-// CHECK: and:
-// CHECK: #0 pthread_mutex_lock
-// CHECK: #1 thread
-// CHECK: Mutex {{.*}} created at:
-// CHECK: #0 pthread_mutex_init
-// CHECK: #1 thread
-// CHECK: SUMMARY: ThreadSanitizer: destroy of a locked mutex {{.*}} in thread
Copied: compiler-rt/trunk/test/tsan/mutex_destroy_locked2.cpp (from r367653, compiler-rt/trunk/test/tsan/mutex_destroy_locked2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutex_destroy_locked2.cpp?p2=compiler-rt/trunk/test/tsan/mutex_destroy_locked2.cpp&p1=compiler-rt/trunk/test/tsan/mutex_destroy_locked2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/mutex_double_lock.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutex_double_lock.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mutex_double_lock.cc (original)
+++ compiler-rt/trunk/test/tsan/mutex_double_lock.cc (removed)
@@ -1,29 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include <pthread.h>
-#include <unistd.h>
-
-extern "C" void AnnotateRWLockAcquired(const char *f, int l, void *m, long rw);
-
-void *ThreadFunc(void *m) {
- AnnotateRWLockAcquired(__FILE__, __LINE__, m, 1);
- return 0;
-}
-
-int main() {
- int m = 0;
- AnnotateRWLockAcquired(__FILE__, __LINE__, &m, 1);
- pthread_t th;
- pthread_create(&th, 0, ThreadFunc, &m);
- pthread_join(th, 0);
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: double lock of a mutex
-// CHECK: #0 AnnotateRWLockAcquired
-// CHECK: #1 ThreadFunc
-// CHECK: Location is stack of main thread.
-// CHECK: Mutex {{.*}} created at:
-// CHECK: #0 AnnotateRWLockAcquired
-// CHECK: #1 main
-// CHECK: SUMMARY: ThreadSanitizer: double lock of a mutex {{.*}}mutex_double_lock.cc{{.*}}ThreadFunc
-
Copied: compiler-rt/trunk/test/tsan/mutex_double_lock.cpp (from r367653, compiler-rt/trunk/test/tsan/mutex_double_lock.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutex_double_lock.cpp?p2=compiler-rt/trunk/test/tsan/mutex_double_lock.cpp&p1=compiler-rt/trunk/test/tsan/mutex_double_lock.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/mutex_double_lock.cc (original)
+++ compiler-rt/trunk/test/tsan/mutex_double_lock.cpp Fri Aug 2 00:18:07 2019
@@ -25,5 +25,5 @@ int main() {
// CHECK: Mutex {{.*}} created at:
// CHECK: #0 AnnotateRWLockAcquired
// CHECK: #1 main
-// CHECK: SUMMARY: ThreadSanitizer: double lock of a mutex {{.*}}mutex_double_lock.cc{{.*}}ThreadFunc
+// CHECK: SUMMARY: ThreadSanitizer: double lock of a mutex {{.*}}mutex_double_lock.cpp{{.*}}ThreadFunc
Removed: compiler-rt/trunk/test/tsan/mutex_lock_destroyed.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutex_lock_destroyed.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mutex_lock_destroyed.cc (original)
+++ compiler-rt/trunk/test/tsan/mutex_lock_destroyed.cc (removed)
@@ -1,28 +0,0 @@
-// RUN: %clangxx_tsan %s -o %t
-// RUN: %deflake %run %t | FileCheck %s
-// RUN: %deflake %run %t 1 | FileCheck %s
-
-// The pthread_mutex_lock interceptor assumes incompatible internals w/ NetBSD
-// XFAIL: netbsd
-
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-int main(int argc, char *argv[]) {
- pthread_mutex_t *m = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
- pthread_mutex_init(m, 0);
- pthread_mutex_lock(m);
- pthread_mutex_unlock(m);
- pthread_mutex_destroy(m);
-
- if (argc > 1 && argv[1][0] == '1')
- free(m);
-
- pthread_mutex_lock(m);
- // CHECK: WARNING: ThreadSanitizer: use of an invalid mutex (e.g. uninitialized or destroyed)
- // CHECK: #0 pthread_mutex_lock
- // CHECK: #1 main {{.*}}mutex_lock_destroyed.cc:[[@LINE-3]]
-
- return 0;
-}
Copied: compiler-rt/trunk/test/tsan/mutex_lock_destroyed.cpp (from r367653, compiler-rt/trunk/test/tsan/mutex_lock_destroyed.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutex_lock_destroyed.cpp?p2=compiler-rt/trunk/test/tsan/mutex_lock_destroyed.cpp&p1=compiler-rt/trunk/test/tsan/mutex_lock_destroyed.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/mutex_lock_destroyed.cc (original)
+++ compiler-rt/trunk/test/tsan/mutex_lock_destroyed.cpp Fri Aug 2 00:18:07 2019
@@ -22,7 +22,7 @@ int main(int argc, char *argv[]) {
pthread_mutex_lock(m);
// CHECK: WARNING: ThreadSanitizer: use of an invalid mutex (e.g. uninitialized or destroyed)
// CHECK: #0 pthread_mutex_lock
- // CHECK: #1 main {{.*}}mutex_lock_destroyed.cc:[[@LINE-3]]
+ // CHECK: #1 main {{.*}}mutex_lock_destroyed.cpp:[[@LINE-3]]
return 0;
}
Removed: compiler-rt/trunk/test/tsan/mutexset1.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutexset1.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mutexset1.cc (original)
+++ compiler-rt/trunk/test/tsan/mutexset1.cc (removed)
@@ -1,37 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-int Global;
-pthread_mutex_t mtx;
-
-void *Thread1(void *x) {
- barrier_wait(&barrier);
- pthread_mutex_lock(&mtx);
- Global++;
- pthread_mutex_unlock(&mtx);
- return NULL;
-}
-
-void *Thread2(void *x) {
- Global--;
- barrier_wait(&barrier);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- // CHECK: WARNING: ThreadSanitizer: data race
- // CHECK: Write of size 4 at {{.*}} by thread T1
- // CHECK: (mutexes: write [[M1:M[0-9]+]]):
- // CHECK: Previous write of size 4 at {{.*}} by thread T2:
- // CHECK: Mutex [[M1]] (0x{{.*}}) created at:
- // CHECK: #0 pthread_mutex_init
- // CHECK: #1 main {{.*}}mutexset1.cc:[[@LINE+1]]
- pthread_mutex_init(&mtx, 0);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- pthread_mutex_destroy(&mtx);
-}
Copied: compiler-rt/trunk/test/tsan/mutexset1.cpp (from r367653, compiler-rt/trunk/test/tsan/mutexset1.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutexset1.cpp?p2=compiler-rt/trunk/test/tsan/mutexset1.cpp&p1=compiler-rt/trunk/test/tsan/mutexset1.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/mutexset1.cc (original)
+++ compiler-rt/trunk/test/tsan/mutexset1.cpp Fri Aug 2 00:18:07 2019
@@ -26,7 +26,7 @@ int main() {
// CHECK: Previous write of size 4 at {{.*}} by thread T2:
// CHECK: Mutex [[M1]] (0x{{.*}}) created at:
// CHECK: #0 pthread_mutex_init
- // CHECK: #1 main {{.*}}mutexset1.cc:[[@LINE+1]]
+ // CHECK: #1 main {{.*}}mutexset1.cpp:[[@LINE+1]]
pthread_mutex_init(&mtx, 0);
pthread_t t[2];
pthread_create(&t[0], NULL, Thread1, NULL);
Removed: compiler-rt/trunk/test/tsan/mutexset2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutexset2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mutexset2.cc (original)
+++ compiler-rt/trunk/test/tsan/mutexset2.cc (removed)
@@ -1,37 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-int Global;
-pthread_mutex_t mtx;
-
-void *Thread1(void *x) {
- pthread_mutex_lock(&mtx);
- Global++;
- pthread_mutex_unlock(&mtx);
- barrier_wait(&barrier);
- return NULL;
-}
-
-void *Thread2(void *x) {
- barrier_wait(&barrier);
- Global--;
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- // CHECK: WARNING: ThreadSanitizer: data race
- // CHECK: Write of size 4 at {{.*}} by thread T2:
- // CHECK: Previous write of size 4 at {{.*}} by thread T1
- // CHECK: (mutexes: write [[M1:M[0-9]+]]):
- // CHECK: Mutex [[M1]] (0x{{.*}}) created at:
- // CHECK: #0 pthread_mutex_init
- // CHECK: #1 main {{.*}}mutexset2.cc:[[@LINE+1]]
- pthread_mutex_init(&mtx, 0);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- pthread_mutex_destroy(&mtx);
-}
Copied: compiler-rt/trunk/test/tsan/mutexset2.cpp (from r367653, compiler-rt/trunk/test/tsan/mutexset2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutexset2.cpp?p2=compiler-rt/trunk/test/tsan/mutexset2.cpp&p1=compiler-rt/trunk/test/tsan/mutexset2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/mutexset2.cc (original)
+++ compiler-rt/trunk/test/tsan/mutexset2.cpp Fri Aug 2 00:18:07 2019
@@ -26,7 +26,7 @@ int main() {
// CHECK: (mutexes: write [[M1:M[0-9]+]]):
// CHECK: Mutex [[M1]] (0x{{.*}}) created at:
// CHECK: #0 pthread_mutex_init
- // CHECK: #1 main {{.*}}mutexset2.cc:[[@LINE+1]]
+ // CHECK: #1 main {{.*}}mutexset2.cpp:[[@LINE+1]]
pthread_mutex_init(&mtx, 0);
pthread_t t[2];
pthread_create(&t[0], NULL, Thread1, NULL);
Removed: compiler-rt/trunk/test/tsan/mutexset3.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutexset3.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mutexset3.cc (original)
+++ compiler-rt/trunk/test/tsan/mutexset3.cc (removed)
@@ -1,45 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-int Global;
-pthread_mutex_t mtx1;
-pthread_mutex_t mtx2;
-
-void *Thread1(void *x) {
- barrier_wait(&barrier);
- pthread_mutex_lock(&mtx1);
- pthread_mutex_lock(&mtx2);
- Global++;
- pthread_mutex_unlock(&mtx2);
- pthread_mutex_unlock(&mtx1);
- return NULL;
-}
-
-void *Thread2(void *x) {
- Global--;
- barrier_wait(&barrier);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- // CHECK: WARNING: ThreadSanitizer: data race
- // CHECK: Write of size 4 at {{.*}} by thread T1
- // CHECK: (mutexes: write [[M1:M[0-9]+]], write [[M2:M[0-9]+]]):
- // CHECK: Previous write of size 4 at {{.*}} by thread T2:
- // CHECK: Mutex [[M1]] (0x{{.*}}) created at:
- // CHECK: #0 pthread_mutex_init
- // CHECK: #1 main {{.*}}mutexset3.cc:[[@LINE+4]]
- // CHECK: Mutex [[M2]] (0x{{.*}}) created at:
- // CHECK: #0 pthread_mutex_init
- // CHECK: #1 main {{.*}}mutexset3.cc:[[@LINE+2]]
- pthread_mutex_init(&mtx1, 0);
- pthread_mutex_init(&mtx2, 0);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- pthread_mutex_destroy(&mtx1);
- pthread_mutex_destroy(&mtx2);
-}
Copied: compiler-rt/trunk/test/tsan/mutexset3.cpp (from r367653, compiler-rt/trunk/test/tsan/mutexset3.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutexset3.cpp?p2=compiler-rt/trunk/test/tsan/mutexset3.cpp&p1=compiler-rt/trunk/test/tsan/mutexset3.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/mutexset3.cc (original)
+++ compiler-rt/trunk/test/tsan/mutexset3.cpp Fri Aug 2 00:18:07 2019
@@ -29,10 +29,10 @@ int main() {
// CHECK: Previous write of size 4 at {{.*}} by thread T2:
// CHECK: Mutex [[M1]] (0x{{.*}}) created at:
// CHECK: #0 pthread_mutex_init
- // CHECK: #1 main {{.*}}mutexset3.cc:[[@LINE+4]]
+ // CHECK: #1 main {{.*}}mutexset3.cpp:[[@LINE+4]]
// CHECK: Mutex [[M2]] (0x{{.*}}) created at:
// CHECK: #0 pthread_mutex_init
- // CHECK: #1 main {{.*}}mutexset3.cc:[[@LINE+2]]
+ // CHECK: #1 main {{.*}}mutexset3.cpp:[[@LINE+2]]
pthread_mutex_init(&mtx1, 0);
pthread_mutex_init(&mtx2, 0);
pthread_t t[2];
Removed: compiler-rt/trunk/test/tsan/mutexset4.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutexset4.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mutexset4.cc (original)
+++ compiler-rt/trunk/test/tsan/mutexset4.cc (removed)
@@ -1,45 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-int Global;
-pthread_mutex_t mtx1;
-pthread_mutex_t mtx2;
-
-void *Thread1(void *x) {
- pthread_mutex_lock(&mtx1);
- pthread_mutex_lock(&mtx2);
- Global++;
- pthread_mutex_unlock(&mtx2);
- pthread_mutex_unlock(&mtx1);
- barrier_wait(&barrier);
- return NULL;
-}
-
-void *Thread2(void *x) {
- barrier_wait(&barrier);
- Global--;
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- // CHECK: WARNING: ThreadSanitizer: data race
- // CHECK: Write of size 4 at {{.*}} by thread T2:
- // CHECK: Previous write of size 4 at {{.*}} by thread T1
- // CHECK: (mutexes: write [[M1:M[0-9]+]], write [[M2:M[0-9]+]]):
- // CHECK: Mutex [[M1]] (0x{{.*}}) created at:
- // CHECK: #0 pthread_mutex_init
- // CHECK: #1 main {{.*}}mutexset4.cc:[[@LINE+4]]
- // CHECK: Mutex [[M2]] (0x{{.*}}) created at:
- // CHECK: #0 pthread_mutex_init
- // CHECK: #1 main {{.*}}mutexset4.cc:[[@LINE+2]]
- pthread_mutex_init(&mtx1, 0);
- pthread_mutex_init(&mtx2, 0);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- pthread_mutex_destroy(&mtx1);
- pthread_mutex_destroy(&mtx2);
-}
Copied: compiler-rt/trunk/test/tsan/mutexset4.cpp (from r367653, compiler-rt/trunk/test/tsan/mutexset4.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutexset4.cpp?p2=compiler-rt/trunk/test/tsan/mutexset4.cpp&p1=compiler-rt/trunk/test/tsan/mutexset4.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/mutexset4.cc (original)
+++ compiler-rt/trunk/test/tsan/mutexset4.cpp Fri Aug 2 00:18:07 2019
@@ -29,10 +29,10 @@ int main() {
// CHECK: (mutexes: write [[M1:M[0-9]+]], write [[M2:M[0-9]+]]):
// CHECK: Mutex [[M1]] (0x{{.*}}) created at:
// CHECK: #0 pthread_mutex_init
- // CHECK: #1 main {{.*}}mutexset4.cc:[[@LINE+4]]
+ // CHECK: #1 main {{.*}}mutexset4.cpp:[[@LINE+4]]
// CHECK: Mutex [[M2]] (0x{{.*}}) created at:
// CHECK: #0 pthread_mutex_init
- // CHECK: #1 main {{.*}}mutexset4.cc:[[@LINE+2]]
+ // CHECK: #1 main {{.*}}mutexset4.cpp:[[@LINE+2]]
pthread_mutex_init(&mtx1, 0);
pthread_mutex_init(&mtx2, 0);
pthread_t t[2];
Removed: compiler-rt/trunk/test/tsan/mutexset5.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutexset5.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mutexset5.cc (original)
+++ compiler-rt/trunk/test/tsan/mutexset5.cc (removed)
@@ -1,46 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-int Global;
-pthread_mutex_t mtx1;
-pthread_mutex_t mtx2;
-
-void *Thread1(void *x) {
- barrier_wait(&barrier);
- pthread_mutex_lock(&mtx1);
- Global++;
- pthread_mutex_unlock(&mtx1);
- return NULL;
-}
-
-void *Thread2(void *x) {
- pthread_mutex_lock(&mtx2);
- Global--;
- pthread_mutex_unlock(&mtx2);
- barrier_wait(&barrier);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- // CHECK: WARNING: ThreadSanitizer: data race
- // CHECK: Write of size 4 at {{.*}} by thread T1
- // CHECK: (mutexes: write [[M1:M[0-9]+]]):
- // CHECK: Previous write of size 4 at {{.*}} by thread T2
- // CHECK: (mutexes: write [[M2:M[0-9]+]]):
- // CHECK: Mutex [[M1]] (0x{{.*}}) created at:
- // CHECK: #0 pthread_mutex_init
- // CHECK: #1 main {{.*}}mutexset5.cc:[[@LINE+4]]
- // CHECK: Mutex [[M2]] (0x{{.*}}) created at:
- // CHECK: #0 pthread_mutex_init
- // CHECK: #1 main {{.*}}mutexset5.cc:[[@LINE+5]]
- pthread_mutex_init(&mtx1, 0);
- pthread_mutex_init(&mtx2, 0);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- pthread_mutex_destroy(&mtx1);
- pthread_mutex_destroy(&mtx2);
-}
Copied: compiler-rt/trunk/test/tsan/mutexset5.cpp (from r367653, compiler-rt/trunk/test/tsan/mutexset5.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutexset5.cpp?p2=compiler-rt/trunk/test/tsan/mutexset5.cpp&p1=compiler-rt/trunk/test/tsan/mutexset5.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/mutexset5.cc (original)
+++ compiler-rt/trunk/test/tsan/mutexset5.cpp Fri Aug 2 00:18:07 2019
@@ -30,10 +30,10 @@ int main() {
// CHECK: (mutexes: write [[M2:M[0-9]+]]):
// CHECK: Mutex [[M1]] (0x{{.*}}) created at:
// CHECK: #0 pthread_mutex_init
- // CHECK: #1 main {{.*}}mutexset5.cc:[[@LINE+4]]
+ // CHECK: #1 main {{.*}}mutexset5.cpp:[[@LINE+4]]
// CHECK: Mutex [[M2]] (0x{{.*}}) created at:
// CHECK: #0 pthread_mutex_init
- // CHECK: #1 main {{.*}}mutexset5.cc:[[@LINE+5]]
+ // CHECK: #1 main {{.*}}mutexset5.cpp:[[@LINE+5]]
pthread_mutex_init(&mtx1, 0);
pthread_mutex_init(&mtx2, 0);
pthread_t t[2];
Removed: compiler-rt/trunk/test/tsan/mutexset6.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutexset6.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mutexset6.cc (original)
+++ compiler-rt/trunk/test/tsan/mutexset6.cc (removed)
@@ -1,53 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-int Global;
-pthread_mutex_t mtx1;
-pthread_mutex_t mtx2;
-pthread_rwlock_t mtx3;
-
-void *Thread1(void *x) {
- barrier_wait(&barrier);
- pthread_mutex_lock(&mtx1);
- Global++;
- pthread_mutex_unlock(&mtx1);
- return NULL;
-}
-
-void *Thread2(void *x) {
- pthread_mutex_lock(&mtx1);
- pthread_mutex_unlock(&mtx1);
- pthread_mutex_lock(&mtx2);
- pthread_rwlock_rdlock(&mtx3);
- Global--;
- pthread_mutex_unlock(&mtx2);
- pthread_rwlock_unlock(&mtx3);
- barrier_wait(&barrier);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- // CHECK: WARNING: ThreadSanitizer: data race
- // CHECK: Write of size 4 at {{.*}} by thread T1
- // CHECK: (mutexes: write [[M1:M[0-9]+]]):
- // CHECK: Previous write of size 4 at {{.*}} by thread T2
- // CHECK: (mutexes: write [[M2:M[0-9]+]], read [[M3:M[0-9]+]]):
- // CHECK: Mutex [[M1]] (0x{{.*}}) created at:
- // CHECK: #1 main {{.*}}mutexset6.cc:[[@LINE+5]]
- // CHECK: Mutex [[M2]] (0x{{.*}}) created at:
- // CHECK: #1 main {{.*}}mutexset6.cc:[[@LINE+4]]
- // CHECK: Mutex [[M3]] (0x{{.*}}) created at:
- // CHECK: #1 main {{.*}}mutexset6.cc:[[@LINE+3]]
- pthread_mutex_init(&mtx1, 0);
- pthread_mutex_init(&mtx2, 0);
- pthread_rwlock_init(&mtx3, 0);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- pthread_mutex_destroy(&mtx1);
- pthread_mutex_destroy(&mtx2);
- pthread_rwlock_destroy(&mtx3);
-}
Copied: compiler-rt/trunk/test/tsan/mutexset6.cpp (from r367653, compiler-rt/trunk/test/tsan/mutexset6.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutexset6.cpp?p2=compiler-rt/trunk/test/tsan/mutexset6.cpp&p1=compiler-rt/trunk/test/tsan/mutexset6.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/mutexset6.cc (original)
+++ compiler-rt/trunk/test/tsan/mutexset6.cpp Fri Aug 2 00:18:07 2019
@@ -34,11 +34,11 @@ int main() {
// CHECK: Previous write of size 4 at {{.*}} by thread T2
// CHECK: (mutexes: write [[M2:M[0-9]+]], read [[M3:M[0-9]+]]):
// CHECK: Mutex [[M1]] (0x{{.*}}) created at:
- // CHECK: #1 main {{.*}}mutexset6.cc:[[@LINE+5]]
+ // CHECK: #1 main {{.*}}mutexset6.cpp:[[@LINE+5]]
// CHECK: Mutex [[M2]] (0x{{.*}}) created at:
- // CHECK: #1 main {{.*}}mutexset6.cc:[[@LINE+4]]
+ // CHECK: #1 main {{.*}}mutexset6.cpp:[[@LINE+4]]
// CHECK: Mutex [[M3]] (0x{{.*}}) created at:
- // CHECK: #1 main {{.*}}mutexset6.cc:[[@LINE+3]]
+ // CHECK: #1 main {{.*}}mutexset6.cpp:[[@LINE+3]]
pthread_mutex_init(&mtx1, 0);
pthread_mutex_init(&mtx2, 0);
pthread_rwlock_init(&mtx3, 0);
Removed: compiler-rt/trunk/test/tsan/mutexset7.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutexset7.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mutexset7.cc (original)
+++ compiler-rt/trunk/test/tsan/mutexset7.cc (removed)
@@ -1,40 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-int Global;
-__thread int huge[1024*1024];
-
-void *Thread1(void *x) {
- barrier_wait(&barrier);
- Global++;
- return NULL;
-}
-
-void *Thread2(void *x) {
- pthread_mutex_t *mtx = new pthread_mutex_t;
- pthread_mutex_init(mtx, 0);
- pthread_mutex_lock(mtx);
- Global--;
- pthread_mutex_unlock(mtx);
- pthread_mutex_destroy(mtx);
- delete mtx;
- barrier_wait(&barrier);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Write of size 4 at {{.*}} by thread T1:
-// CHECK: Previous write of size 4 at {{.*}} by thread T2
-// CHECK: (mutexes: write [[M1:M[0-9]+]]):
-// CHECK: Mutex [[M1]] is already destroyed
-// CHECK-NOT: Mutex {{.*}} created at
-
Copied: compiler-rt/trunk/test/tsan/mutexset7.cpp (from r367653, compiler-rt/trunk/test/tsan/mutexset7.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutexset7.cpp?p2=compiler-rt/trunk/test/tsan/mutexset7.cpp&p1=compiler-rt/trunk/test/tsan/mutexset7.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/mutexset8.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutexset8.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/mutexset8.cc (original)
+++ compiler-rt/trunk/test/tsan/mutexset8.cc (removed)
@@ -1,39 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-int Global;
-pthread_mutex_t *mtx;
-
-void *Thread1(void *x) {
- barrier_wait(&barrier);
- pthread_mutex_lock(mtx);
- Global++;
- pthread_mutex_unlock(mtx);
- return NULL;
-}
-
-void *Thread2(void *x) {
- Global--;
- barrier_wait(&barrier);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- // CHECK: WARNING: ThreadSanitizer: data race
- // CHECK: Write of size 4 at {{.*}} by thread T1
- // CHECK: (mutexes: write [[M1:M[0-9]+]]):
- // CHECK: Previous write of size 4 at {{.*}} by thread T2:
- // CHECK: Mutex [[M1]] (0x{{.*}}) created at:
- // CHECK: #0 pthread_mutex_init
- // CHECK: #1 main {{.*}}mutexset8.cc
- mtx = new pthread_mutex_t;
- pthread_mutex_init(mtx, 0);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- pthread_mutex_destroy(mtx);
- delete mtx;
-}
Copied: compiler-rt/trunk/test/tsan/mutexset8.cpp (from r367653, compiler-rt/trunk/test/tsan/mutexset8.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutexset8.cpp?p2=compiler-rt/trunk/test/tsan/mutexset8.cpp&p1=compiler-rt/trunk/test/tsan/mutexset8.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/mutexset8.cc (original)
+++ compiler-rt/trunk/test/tsan/mutexset8.cpp Fri Aug 2 00:18:07 2019
@@ -26,7 +26,7 @@ int main() {
// CHECK: Previous write of size 4 at {{.*}} by thread T2:
// CHECK: Mutex [[M1]] (0x{{.*}}) created at:
// CHECK: #0 pthread_mutex_init
- // CHECK: #1 main {{.*}}mutexset8.cc
+ // CHECK: #1 main {{.*}}mutexset8.cpp
mtx = new pthread_mutex_t;
pthread_mutex_init(mtx, 0);
pthread_t t[2];
Removed: compiler-rt/trunk/test/tsan/pie_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/pie_test.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/pie_test.cc (original)
+++ compiler-rt/trunk/test/tsan/pie_test.cc (removed)
@@ -1,6 +0,0 @@
-// Check if tsan work with PIE binaries.
-// RUN: %clang_tsan %s -pie -fpic -o %t && %run %t
-
-int main(void) {
- return 0;
-}
Copied: compiler-rt/trunk/test/tsan/pie_test.cpp (from r367653, compiler-rt/trunk/test/tsan/pie_test.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/pie_test.cpp?p2=compiler-rt/trunk/test/tsan/pie_test.cpp&p1=compiler-rt/trunk/test/tsan/pie_test.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/pthread_key.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/pthread_key.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/pthread_key.cc (original)
+++ compiler-rt/trunk/test/tsan/pthread_key.cc (removed)
@@ -1,39 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -DBUILD_SO -fPIC -shared -o %t-so.so
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-
-// Extracted from:
-// https://bugs.chromium.org/p/v8/issues/detail?id=4995
-
-#include "test.h"
-
-void* thr(void* arg) {
- const int N = 32;
- pthread_key_t keys_[N];
- for (size_t i = 0; i < N; ++i) {
- int err = pthread_key_create(&keys_[i], 0);
- if (err) {
- fprintf(stderr, "pthread_key_create failed with %d\n", err);
- exit(1);
- }
- }
- for (size_t i = 0; i < N; i++)
- pthread_setspecific(keys_[i], (void*)(long)i);
- for (size_t i = 0; i < N; i++)
- pthread_key_delete(keys_[i]);
- return 0;
-}
-
-int main() {
- for (int i = 0; i < 10; i++) {
- pthread_t th;
- pthread_create(&th, 0, thr, 0);
- pthread_join(th, 0);
- }
- pthread_t th[2];
- pthread_create(&th[0], 0, thr, 0);
- pthread_create(&th[1], 0, thr, 0);
- pthread_join(th[0], 0);
- pthread_join(th[1], 0);
- fprintf(stderr, "DONE\n");
- // CHECK: DONE
-}
Copied: compiler-rt/trunk/test/tsan/pthread_key.cpp (from r367653, compiler-rt/trunk/test/tsan/pthread_key.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/pthread_key.cpp?p2=compiler-rt/trunk/test/tsan/pthread_key.cpp&p1=compiler-rt/trunk/test/tsan/pthread_key.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/race_on_fputs.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_on_fputs.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/race_on_fputs.cc (original)
+++ compiler-rt/trunk/test/tsan/race_on_fputs.cc (removed)
@@ -1,29 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-char s[] = "abracadabra";
-
-void *Thread0(void *p) {
- fputs(s, stdout);
- barrier_wait(&barrier);
- return 0;
-}
-
-void *Thread1(void *p) {
- barrier_wait(&barrier);
- s[3] = 'z';
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t th[2];
- pthread_create(&th[0], 0, Thread0, 0);
- pthread_create(&th[1], 0, Thread1, 0);
- pthread_join(th[0], 0);
- pthread_join(th[1], 0);
- fprintf(stderr, "DONE");
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/race_on_fputs.cpp (from r367653, compiler-rt/trunk/test/tsan/race_on_fputs.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_on_fputs.cpp?p2=compiler-rt/trunk/test/tsan/race_on_fputs.cpp&p1=compiler-rt/trunk/test/tsan/race_on_fputs.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/race_on_heap.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_on_heap.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/race_on_heap.cc (original)
+++ compiler-rt/trunk/test/tsan/race_on_heap.cc (removed)
@@ -1,48 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include <pthread.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include "test.h"
-
-void *Thread1(void *p) {
- *(int*)p = 42;
- return 0;
-}
-
-void *Thread2(void *p) {
- *(int*)p = 44;
- return 0;
-}
-
-void *alloc() {
- return malloc(99);
-}
-
-void *AllocThread(void* arg) {
- return alloc();
-}
-
-int main() {
- void *p = 0;
- pthread_t t[2];
- pthread_create(&t[0], 0, AllocThread, 0);
- pthread_join(t[0], &p);
- print_address("addr=", 1, p);
- pthread_create(&t[0], 0, Thread1, (char*)p + 16);
- pthread_create(&t[1], 0, Thread2, (char*)p + 16);
- pthread_join(t[0], 0);
- pthread_join(t[1], 0);
- return 0;
-}
-
-// CHECK: addr=[[ADDR:0x[0-9,a-f]+]]
-// CHECK: WARNING: ThreadSanitizer: data race
-// ...
-// CHECK: Location is heap block of size 99 at [[ADDR]] allocated by thread T1:
-// CHECK: #0 malloc
-// CHECK: #{{1|2}} alloc
-// CHECK: #{{2|3}} AllocThread
-// ...
-// CHECK: Thread T1 (tid={{.*}}, finished) created by main thread at:
-// CHECK: #0 pthread_create
-// CHECK: #1 main
Copied: compiler-rt/trunk/test/tsan/race_on_heap.cpp (from r367653, compiler-rt/trunk/test/tsan/race_on_heap.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_on_heap.cpp?p2=compiler-rt/trunk/test/tsan/race_on_heap.cpp&p1=compiler-rt/trunk/test/tsan/race_on_heap.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/race_on_puts.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_on_puts.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/race_on_puts.cc (original)
+++ compiler-rt/trunk/test/tsan/race_on_puts.cc (removed)
@@ -1,30 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-char s[] = "abracadabra";
-
-void *Thread0(void *p) {
- puts(s);
- barrier_wait(&barrier);
- return 0;
-}
-
-void *Thread1(void *p) {
- barrier_wait(&barrier);
- s[3] = 'z';
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t th[2];
- pthread_create(&th[0], 0, Thread0, 0);
- pthread_create(&th[1], 0, Thread1, 0);
- pthread_join(th[0], 0);
- pthread_join(th[1], 0);
- fprintf(stderr, "DONE");
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: DONE
-
Copied: compiler-rt/trunk/test/tsan/race_on_puts.cpp (from r367653, compiler-rt/trunk/test/tsan/race_on_puts.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_on_puts.cpp?p2=compiler-rt/trunk/test/tsan/race_on_puts.cpp&p1=compiler-rt/trunk/test/tsan/race_on_puts.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/race_on_read.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_on_read.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/race_on_read.cc (original)
+++ compiler-rt/trunk/test/tsan/race_on_read.cc (removed)
@@ -1,45 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-
-int fd;
-char buf;
-
-void *Thread1(void *x) {
- barrier_wait(&barrier);
- read(fd, &buf, 1);
- return NULL;
-}
-
-void *Thread2(void *x) {
- read(fd, &buf, 1);
- barrier_wait(&barrier);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- fd = open("/dev/random", O_RDONLY);
- if (fd < 0) {
- fprintf(stderr, "failed to open /dev/random (%d)\n", errno);
- return 1;
- }
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- close(fd);
- fprintf(stderr, "DONE\n");
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Write of size 1
-// CHECK: #0 read
-// CHECK: Previous write of size 1
-// CHECK: #0 read
-// CHECK: DONE
-
Copied: compiler-rt/trunk/test/tsan/race_on_read.cpp (from r367653, compiler-rt/trunk/test/tsan/race_on_read.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_on_read.cpp?p2=compiler-rt/trunk/test/tsan/race_on_read.cpp&p1=compiler-rt/trunk/test/tsan/race_on_read.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/race_on_speculative_load.cc (original)
+++ compiler-rt/trunk/test/tsan/race_on_speculative_load.cc (removed)
@@ -1,30 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-// Regtest for https://github.com/google/sanitizers/issues/447
-// This is a correct program and tsan should not report a race.
-#include "test.h"
-
-int g;
-__attribute__((noinline))
-int foo(int cond) {
- if (cond)
- return g;
- return 0;
-}
-
-void *Thread1(void *p) {
- barrier_wait(&barrier);
- long res = foo((long)p);
- return (void*) res;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t;
- pthread_create(&t, 0, Thread1, 0);
- g = 1;
- barrier_wait(&barrier);
- pthread_join(t, 0);
- fprintf(stderr, "PASS\n");
- // CHECK-NOT: ThreadSanitizer: data race
- // CHECK: PASS
-}
Copied: compiler-rt/trunk/test/tsan/race_on_speculative_load.cpp (from r367653, 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.cpp?p2=compiler-rt/trunk/test/tsan/race_on_speculative_load.cpp&p1=compiler-rt/trunk/test/tsan/race_on_speculative_load.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/race_on_write.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_on_write.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/race_on_write.cc (original)
+++ compiler-rt/trunk/test/tsan/race_on_write.cc (removed)
@@ -1,38 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-int fd;
-char buf;
-
-void *Thread1(void *x) {
- buf = 1;
- barrier_wait(&barrier);
- return NULL;
-}
-
-void *Thread2(void *x) {
- write(fd, &buf, 1);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- fd = open("/dev/null", O_WRONLY);
- if (fd < 0) return 1;
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- barrier_wait(&barrier);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- close(fd);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Read of size 1
-// CHECK: #0 write
-// CHECK: Previous write of size 1
-// CHECK: #0 Thread1
Copied: compiler-rt/trunk/test/tsan/race_on_write.cpp (from r367653, compiler-rt/trunk/test/tsan/race_on_write.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_on_write.cpp?p2=compiler-rt/trunk/test/tsan/race_on_write.cpp&p1=compiler-rt/trunk/test/tsan/race_on_write.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/race_stress.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_stress.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/race_stress.cc (original)
+++ compiler-rt/trunk/test/tsan/race_stress.cc (removed)
@@ -1,25 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
-#include "test.h"
-
-const int kThreads = 16;
-const int kIters = 1000;
-
-volatile int X = 0;
-
-void *thr(void *arg) {
- for (int i = 0; i < kIters; i++)
- X++;
- return 0;
-}
-
-int main() {
- pthread_t th[kThreads];
- for (int i = 0; i < kThreads; i++)
- pthread_create(&th[i], 0, thr, 0);
- for (int i = 0; i < kThreads; i++)
- pthread_join(th[i], 0);
- fprintf(stderr, "DONE\n");
-}
-
-// CHECK: ThreadSanitizer: data race
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/race_stress.cpp (from r367653, compiler-rt/trunk/test/tsan/race_stress.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_stress.cpp?p2=compiler-rt/trunk/test/tsan/race_stress.cpp&p1=compiler-rt/trunk/test/tsan/race_stress.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/race_top_suppression.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_top_suppression.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/race_top_suppression.cc (original)
+++ compiler-rt/trunk/test/tsan/race_top_suppression.cc (removed)
@@ -1,29 +0,0 @@
-// RUN: echo "race_top:TopFunction" > %t.supp
-// RUN: %clangxx_tsan -O1 %s -o %t
-// RUN: %env_tsan_opts=suppressions='%t.supp' %run %t 2>&1 | FileCheck %s
-// RUN: rm %t.supp
-#include "test.h"
-
-int Global;
-
-void TopFunction(int *p) {
- *p = 1;
-}
-
-void *Thread(void *x) {
- barrier_wait(&barrier);
- TopFunction(&Global);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- Global--;
- barrier_wait(&barrier);
- pthread_join(t, 0);
- fprintf(stderr, "DONE\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/race_top_suppression.cpp (from r367653, compiler-rt/trunk/test/tsan/race_top_suppression.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_top_suppression.cpp?p2=compiler-rt/trunk/test/tsan/race_top_suppression.cpp&p1=compiler-rt/trunk/test/tsan/race_top_suppression.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/race_top_suppression1.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_top_suppression1.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/race_top_suppression1.cc (original)
+++ compiler-rt/trunk/test/tsan/race_top_suppression1.cc (removed)
@@ -1,32 +0,0 @@
-// RUN: echo "race_top:TopFunction" > %t.supp
-// RUN: %clangxx_tsan -O1 %s -o %t
-// RUN: %env_tsan_opts=suppressions='%t.supp' %deflake %run %t 2>&1 | FileCheck %s
-// RUN: rm %t.supp
-#include "test.h"
-
-int Global;
-
-void AnotherFunction(int *p) {
- *p = 1;
-}
-
-void TopFunction(int *p) {
- AnotherFunction(p);
-}
-
-void *Thread(void *x) {
- barrier_wait(&barrier);
- TopFunction(&Global);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- Global--;
- barrier_wait(&barrier);
- pthread_join(t, 0);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/race_top_suppression1.cpp (from r367653, compiler-rt/trunk/test/tsan/race_top_suppression1.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_top_suppression1.cpp?p2=compiler-rt/trunk/test/tsan/race_top_suppression1.cpp&p1=compiler-rt/trunk/test/tsan/race_top_suppression1.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/race_with_finished_thread.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_with_finished_thread.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/race_with_finished_thread.cc (original)
+++ compiler-rt/trunk/test/tsan/race_with_finished_thread.cc (removed)
@@ -1,42 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-// Ensure that we can restore a stack of a finished thread.
-
-int g_data;
-
-void __attribute__((noinline)) foobar(int *p) {
- *p = 42;
-}
-
-void *Thread1(void *x) {
- foobar(&g_data);
- barrier_wait(&barrier);
- return NULL;
-}
-
-void *Thread2(void *x) {
- barrier_wait(&barrier);
- sleep(1); // let the thread finish and exit
- g_data = 43;
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Write of size 4 at {{.*}} by thread T2:
-// CHECK: Previous write of size 4 at {{.*}} by thread T1:
-// CHECK: #0 foobar
-// CHECK: #1 Thread1
-// CHECK: Thread T1 (tid={{.*}}, finished) created by main thread at:
-// CHECK: #0 pthread_create
-// CHECK: #1 main
Copied: compiler-rt/trunk/test/tsan/race_with_finished_thread.cpp (from r367653, compiler-rt/trunk/test/tsan/race_with_finished_thread.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_with_finished_thread.cpp?p2=compiler-rt/trunk/test/tsan/race_with_finished_thread.cpp&p1=compiler-rt/trunk/test/tsan/race_with_finished_thread.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/real_deadlock_detector_stress_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/real_deadlock_detector_stress_test.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/real_deadlock_detector_stress_test.cc (original)
+++ compiler-rt/trunk/test/tsan/real_deadlock_detector_stress_test.cc (removed)
@@ -1,187 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s %link_libcxx_tsan -o %t && %run %t 2>&1 | FileCheck %s
-
-#include <pthread.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <time.h>
-#include <errno.h>
-#include <vector>
-#include <algorithm>
-#include <sys/time.h>
-
-const int kThreads = 4;
-const int kMutexes = 16 << 10;
-const int kIters = 400 << 10;
-const int kMaxPerThread = 10;
-
-const int kStateInited = 0;
-const int kStateNotInited = -1;
-const int kStateLocked = -2;
-
-struct Mutex {
- int state;
- pthread_rwlock_t m;
-};
-
-Mutex mtx[kMutexes];
-
-void check(int res) {
- if (res != 0) {
- printf("SOMETHING HAS FAILED\n");
- exit(1);
- }
-}
-
-bool cas(int *a, int oldval, int newval) {
- return __atomic_compare_exchange_n(a, &oldval, newval, false,
- __ATOMIC_ACQ_REL, __ATOMIC_RELAXED);
-}
-
-void *Thread(void *seed) {
- unsigned rnd = (unsigned)(unsigned long)seed;
- int err;
- std::vector<int> locked;
- for (int i = 0; i < kIters; i++) {
- int what = rand_r(&rnd) % 10;
- if (what < 4 && locked.size() < kMaxPerThread) {
- // lock
- int max_locked = -1;
- if (!locked.empty()) {
- max_locked = *std::max_element(locked.begin(), locked.end());
- if (max_locked == kMutexes - 1) {
- i--;
- continue;
- }
- }
- int id = (rand_r(&rnd) % (kMutexes - max_locked - 1)) + max_locked + 1;
- Mutex *m = &mtx[id];
- // init the mutex if necessary or acquire a reference
- for (;;) {
- int old = __atomic_load_n(&m->state, __ATOMIC_RELAXED);
- if (old == kStateLocked) {
- sched_yield();
- continue;
- }
- int newv = old + 1;
- if (old == kStateNotInited)
- newv = kStateLocked;
- if (cas(&m->state, old, newv)) {
- if (old == kStateNotInited) {
- if ((err = pthread_rwlock_init(&m->m, 0))) {
- fprintf(stderr, "pthread_rwlock_init failed with %d\n", err);
- exit(1);
- }
- if (!cas(&m->state, kStateLocked, 1)) {
- fprintf(stderr, "init commit failed\n");
- exit(1);
- }
- }
- break;
- }
- }
- // now we have an inited and referenced mutex, choose what to do
- bool failed = false;
- switch (rand_r(&rnd) % 4) {
- case 0:
- if ((err = pthread_rwlock_wrlock(&m->m))) {
- fprintf(stderr, "pthread_rwlock_wrlock failed with %d\n", err);
- exit(1);
- }
- break;
- case 1:
- if ((err = pthread_rwlock_rdlock(&m->m))) {
- fprintf(stderr, "pthread_rwlock_rdlock failed with %d\n", err);
- exit(1);
- }
- break;
- case 2:
- err = pthread_rwlock_trywrlock(&m->m);
- if (err != 0 && err != EBUSY) {
- fprintf(stderr, "pthread_rwlock_trywrlock failed with %d\n", err);
- exit(1);
- }
- failed = err == EBUSY;
- break;
- case 3:
- err = pthread_rwlock_tryrdlock(&m->m);
- if (err != 0 && err != EBUSY) {
- fprintf(stderr, "pthread_rwlock_tryrdlock failed with %d\n", err);
- exit(1);
- }
- failed = err == EBUSY;
- break;
- }
- if (failed) {
- if (__atomic_fetch_sub(&m->state, 1, __ATOMIC_ACQ_REL) <= 0) {
- fprintf(stderr, "failed to unref after failed trylock\n");
- exit(1);
- }
- continue;
- }
- locked.push_back(id);
- } else if (what < 9 && !locked.empty()) {
- // unlock
- int pos = rand_r(&rnd) % locked.size();
- int id = locked[pos];
- locked[pos] = locked[locked.size() - 1];
- locked.pop_back();
- Mutex *m = &mtx[id];
- if ((err = pthread_rwlock_unlock(&m->m))) {
- fprintf(stderr, "pthread_rwlock_unlock failed with %d\n", err);
- exit(1);
- }
- if (__atomic_fetch_sub(&m->state, 1, __ATOMIC_ACQ_REL) <= 0) {
- fprintf(stderr, "failed to unref after unlock\n");
- exit(1);
- }
- } else {
- // Destroy a random mutex.
- int id = rand_r(&rnd) % kMutexes;
- Mutex *m = &mtx[id];
- if (!cas(&m->state, kStateInited, kStateLocked)) {
- i--;
- continue;
- }
- if ((err = pthread_rwlock_destroy(&m->m))) {
- fprintf(stderr, "pthread_rwlock_destroy failed with %d\n", err);
- exit(1);
- }
- if (!cas(&m->state, kStateLocked, kStateNotInited)) {
- fprintf(stderr, "destroy commit failed\n");
- exit(1);
- }
- }
- }
- // Unlock all previously locked mutexes, otherwise other threads can deadlock.
- for (int i = 0; i < locked.size(); i++) {
- int id = locked[i];
- Mutex *m = &mtx[id];
- if ((err = pthread_rwlock_unlock(&m->m))) {
- fprintf(stderr, "pthread_rwlock_unlock failed with %d\n", err);
- exit(1);
- }
- }
- return 0;
-}
-
-int main() {
- struct timeval tv;
- gettimeofday(&tv, NULL);
- unsigned s = tv.tv_sec + tv.tv_usec;
- fprintf(stderr, "seed %d\n", s);
- srand(s);
- for (int i = 0; i < kMutexes; i++)
- mtx[i].state = kStateNotInited;
- pthread_t t[kThreads];
- for (int i = 0; i < kThreads; i++)
- pthread_create(&t[i], 0, Thread, (void*)(unsigned long)rand());
- for (int i = 0; i < kThreads; i++)
- pthread_join(t[i], 0);
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer
-// CHECK: DONE
-
Copied: compiler-rt/trunk/test/tsan/real_deadlock_detector_stress_test.cpp (from r367653, compiler-rt/trunk/test/tsan/real_deadlock_detector_stress_test.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/real_deadlock_detector_stress_test.cpp?p2=compiler-rt/trunk/test/tsan/real_deadlock_detector_stress_test.cpp&p1=compiler-rt/trunk/test/tsan/real_deadlock_detector_stress_test.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/restore_stack.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/restore_stack.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/restore_stack.cc (original)
+++ compiler-rt/trunk/test/tsan/restore_stack.cc (removed)
@@ -1,50 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
-#include "test.h"
-
-int Global;
-volatile int x;
-const int kSize = 64 << 10;
-volatile long data[kSize];
-
-void __attribute__((noinline)) foo() {
- for (int i = 0; i < kSize; i++)
- data[i]++;
-}
-
-void *Thread(void *a) {
- __atomic_store_n(&x, 1, __ATOMIC_RELEASE);
- foo();
- data[0]++;
- if (a != 0)
- barrier_wait(&barrier);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- for (int i = 0; i < 50; i++) {
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- pthread_join(t, 0);
- }
- pthread_t t;
- pthread_create(&t, 0, Thread, (void*)1);
- barrier_wait(&barrier);
- for (int i = 0; i < kSize; i++)
- data[i]++;
- pthread_join(t, 0);
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// Previously this test produced bogus stack traces like:
-// Previous write of size 8 at 0x0000006a8ff8 by thread T17:
-// #0 foo() restore_stack.cc:13:5 (restore_stack.cc.exe+0x00000040622c)
-// #1 Thread(void*) restore_stack.cc:18:3 (restore_stack.cc.exe+0x000000406283)
-// #2 __tsan_thread_start_func rtl/tsan_interceptors.cpp:886 (restore_stack.cc.exe+0x00000040a749)
-// #3 Thread(void*) restore_stack.cc:18:3 (restore_stack.cc.exe+0x000000406283)
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK-NOT: __tsan_thread_start_func
-// CHECK-NOT: #3 Thread
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/restore_stack.cpp (from r367653, compiler-rt/trunk/test/tsan/restore_stack.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/restore_stack.cpp?p2=compiler-rt/trunk/test/tsan/restore_stack.cpp&p1=compiler-rt/trunk/test/tsan/restore_stack.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/restore_stack.cc (original)
+++ compiler-rt/trunk/test/tsan/restore_stack.cpp Fri Aug 2 00:18:07 2019
@@ -39,10 +39,10 @@ int main() {
// Previously this test produced bogus stack traces like:
// Previous write of size 8 at 0x0000006a8ff8 by thread T17:
-// #0 foo() restore_stack.cc:13:5 (restore_stack.cc.exe+0x00000040622c)
-// #1 Thread(void*) restore_stack.cc:18:3 (restore_stack.cc.exe+0x000000406283)
-// #2 __tsan_thread_start_func rtl/tsan_interceptors.cpp:886 (restore_stack.cc.exe+0x00000040a749)
-// #3 Thread(void*) restore_stack.cc:18:3 (restore_stack.cc.exe+0x000000406283)
+// #0 foo() restore_stack.cpp:13:5 (restore_stack.cpp.exe+0x00000040622c)
+// #1 Thread(void*) restore_stack.cpp:18:3 (restore_stack.cpp.exe+0x000000406283)
+// #2 __tsan_thread_start_func rtl/tsan_interceptors.cpp:886 (restore_stack.cpp.exe+0x00000040a749)
+// #3 Thread(void*) restore_stack.cpp:18:3 (restore_stack.cpp.exe+0x000000406283)
// CHECK: WARNING: ThreadSanitizer: data race
// CHECK-NOT: __tsan_thread_start_func
Removed: compiler-rt/trunk/test/tsan/signal_block.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_block.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/signal_block.cc (original)
+++ compiler-rt/trunk/test/tsan/signal_block.cc (removed)
@@ -1,60 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-
-// Test that a signal is not delivered when it is blocked.
-
-#include "test.h"
-#include <semaphore.h>
-#include <signal.h>
-#include <errno.h>
-
-int stop;
-sig_atomic_t signal_blocked;
-
-void handler(int signum) {
- if (signal_blocked) {
- fprintf(stderr, "signal arrived when blocked\n");
- exit(1);
- }
-}
-
-void *thread(void *arg) {
- sigset_t myset;
- sigemptyset(&myset);
- sigaddset(&myset, SIGUSR1);
- while (!__atomic_load_n(&stop, __ATOMIC_RELAXED)) {
- usleep(1);
- if (pthread_sigmask(SIG_BLOCK, &myset, 0)) {
- fprintf(stderr, "pthread_sigmask failed %d\n", errno);
- exit(1);
- }
- signal_blocked = 1;
- usleep(1);
- signal_blocked = 0;
- if (pthread_sigmask(SIG_UNBLOCK, &myset, 0)) {
- fprintf(stderr, "pthread_sigmask failed %d\n", errno);
- exit(1);
- }
- }
- return 0;
-}
-
-int main(int argc, char** argv) {
- struct sigaction act = {};
- act.sa_handler = &handler;
- if (sigaction(SIGUSR1, &act, 0)) {
- fprintf(stderr, "sigaction failed %d\n", errno);
- return 1;
- }
- pthread_t th;
- pthread_create(&th, 0, thread, 0);
- for (int i = 0; i < 100000; i++)
- pthread_kill(th, SIGUSR1);
- __atomic_store_n(&stop, 1, __ATOMIC_RELAXED);
- pthread_join(th, 0);
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK-NOT: ThreadSanitizer CHECK
-// CHECK-NOT: WARNING: ThreadSanitizer:
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/signal_block.cpp (from r367653, compiler-rt/trunk/test/tsan/signal_block.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_block.cpp?p2=compiler-rt/trunk/test/tsan/signal_block.cpp&p1=compiler-rt/trunk/test/tsan/signal_block.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/signal_cond.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_cond.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/signal_cond.cc (original)
+++ compiler-rt/trunk/test/tsan/signal_cond.cc (removed)
@@ -1,53 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "test.h"
-#include <signal.h>
-#include <unistd.h>
-#include <errno.h>
-#include <semaphore.h>
-
-// Test that signals can be delivered to blocked pthread_cond_wait.
-// https://github.com/google/sanitizers/issues/498
-
-int g_thread_run = 1;
-pthread_mutex_t mutex;
-pthread_cond_t cond;
-
-void sig_handler(int sig) {
- (void)sig;
- write(2, "SIGNAL\n", sizeof("SIGNAL\n") - 1);
- barrier_wait(&barrier);
-}
-
-void* my_thread(void* arg) {
- pthread_mutex_lock(&mutex);
- while (g_thread_run)
- pthread_cond_wait(&cond, &mutex);
- pthread_mutex_unlock(&mutex);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
-
- pthread_mutex_init(&mutex, 0);
- pthread_cond_init(&cond, 0);
-
- signal(SIGUSR1, &sig_handler);
- pthread_t thr;
- pthread_create(&thr, 0, &my_thread, 0);
- // wait for thread to get inside pthread_cond_wait
- // (can't use barrier_wait for that)
- sleep(1);
- pthread_kill(thr, SIGUSR1);
- barrier_wait(&barrier);
- pthread_mutex_lock(&mutex);
- g_thread_run = 0;
- pthread_cond_signal(&cond);
- pthread_mutex_unlock(&mutex);
- pthread_join(thr, 0);
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK: SIGNAL
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/signal_cond.cpp (from r367653, compiler-rt/trunk/test/tsan/signal_cond.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_cond.cpp?p2=compiler-rt/trunk/test/tsan/signal_cond.cpp&p1=compiler-rt/trunk/test/tsan/signal_cond.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/signal_errno.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_errno.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/signal_errno.cc (original)
+++ compiler-rt/trunk/test/tsan/signal_errno.cc (removed)
@@ -1,52 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-// This test fails on powerpc64 BE (VMA=44), it does not appear to be
-// a functional problem, but the Tsan report is missing some info.
-// XFAIL: powerpc64-unknown-linux-gnu
-
-#include "test.h"
-#include <signal.h>
-#include <sys/types.h>
-#include <errno.h>
-
-pthread_t mainth;
-volatile int done;
-
-static void MyHandler(int, siginfo_t *s, void *c) {
- errno = 1;
- done = 1;
-}
-
-static void* sendsignal(void *p) {
- barrier_wait(&barrier);
- pthread_kill(mainth, SIGPROF);
- return 0;
-}
-
-static __attribute__((noinline)) void loop() {
- barrier_wait(&barrier);
- while (done == 0) {
- volatile char *p = (char*)malloc(1);
- p[0] = 0;
- free((void*)p);
- sched_yield();
- }
-}
-
-int main() {
- barrier_init(&barrier, 2);
- mainth = pthread_self();
- struct sigaction act = {};
- act.sa_sigaction = &MyHandler;
- sigaction(SIGPROF, &act, 0);
- pthread_t th;
- pthread_create(&th, 0, sendsignal, 0);
- loop();
- pthread_join(th, 0);
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: signal handler spoils errno
-// CHECK: #0 MyHandler(int, {{(__)?}}siginfo{{(_t)?}}*, void*) {{.*}}signal_errno.cc
-// CHECK: main
-// CHECK: SUMMARY: ThreadSanitizer: signal handler spoils errno{{.*}}MyHandler
-
Copied: compiler-rt/trunk/test/tsan/signal_errno.cpp (from r367653, compiler-rt/trunk/test/tsan/signal_errno.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_errno.cpp?p2=compiler-rt/trunk/test/tsan/signal_errno.cpp&p1=compiler-rt/trunk/test/tsan/signal_errno.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/signal_errno.cc (original)
+++ compiler-rt/trunk/test/tsan/signal_errno.cpp Fri Aug 2 00:18:07 2019
@@ -46,7 +46,7 @@ int main() {
}
// CHECK: WARNING: ThreadSanitizer: signal handler spoils errno
-// CHECK: #0 MyHandler(int, {{(__)?}}siginfo{{(_t)?}}*, void*) {{.*}}signal_errno.cc
+// CHECK: #0 MyHandler(int, {{(__)?}}siginfo{{(_t)?}}*, void*) {{.*}}signal_errno.cpp
// CHECK: main
// CHECK: SUMMARY: ThreadSanitizer: signal handler spoils errno{{.*}}MyHandler
Removed: compiler-rt/trunk/test/tsan/signal_longjmp.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_longjmp.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/signal_longjmp.cc (original)
+++ compiler-rt/trunk/test/tsan/signal_longjmp.cc (removed)
@@ -1,80 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-
-// Test case for longjumping out of signal handler:
-// https://github.com/google/sanitizers/issues/482
-
-// This test fails on powerpc64 BE (VMA=44), a segmentation fault
-// error happens at the second assignment
-// "((volatile int *volatile)mem)[1] = 1".
-// XFAIL: powerpc64-unknown-linux-gnu
-
-#include <setjmp.h>
-#include <signal.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/mman.h>
-
-#ifdef __APPLE__
-#define SIGNAL_TO_HANDLE SIGBUS
-#else
-#define SIGNAL_TO_HANDLE SIGSEGV
-#endif
-
-sigjmp_buf fault_jmp;
-volatile int fault_expected;
-
-void sigfault_handler(int sig) {
- if (!fault_expected)
- abort();
-
- /* just return from sighandler to proper place */
- fault_expected = 0;
- siglongjmp(fault_jmp, 1);
-}
-
-#define MUST_FAULT(code) do { \
- fault_expected = 1; \
- if (!sigsetjmp(fault_jmp, 1)) { \
- code; /* should pagefault -> sihandler does longjmp */ \
- fprintf(stderr, "%s not faulted\n", #code); \
- abort(); \
- } else { \
- fprintf(stderr, "%s faulted ok\n", #code); \
- } \
-} while (0)
-
-int main() {
- struct sigaction act;
- act.sa_handler = sigfault_handler;
- act.sa_flags = 0;
- if (sigemptyset(&act.sa_mask)) {
- perror("sigemptyset");
- exit(1);
- }
-
- if (sigaction(SIGNAL_TO_HANDLE, &act, NULL)) {
- perror("sigaction");
- exit(1);
- }
-
- void *mem = mmap(0, 4096, PROT_NONE, MAP_PRIVATE | MAP_ANON,
- -1, 0);
-
- MUST_FAULT(((volatile int *volatile)mem)[0] = 0);
- MUST_FAULT(((volatile int *volatile)mem)[1] = 1);
- MUST_FAULT(((volatile int *volatile)mem)[3] = 1);
-
- // Ensure that tsan does not think that we are
- // in a signal handler.
- void *volatile p = malloc(10);
- ((volatile int*)p)[1] = 1;
- free((void*)p);
-
- munmap(p, 4096);
-
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/signal_longjmp.cpp (from r367653, compiler-rt/trunk/test/tsan/signal_longjmp.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_longjmp.cpp?p2=compiler-rt/trunk/test/tsan/signal_longjmp.cpp&p1=compiler-rt/trunk/test/tsan/signal_longjmp.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/signal_malloc.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_malloc.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/signal_malloc.cc (original)
+++ compiler-rt/trunk/test/tsan/signal_malloc.cc (removed)
@@ -1,24 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-#include <signal.h>
-#include <sys/types.h>
-
-static void handler(int, siginfo_t*, void*) {
- // CHECK: WARNING: ThreadSanitizer: signal-unsafe call inside of a signal
- // CHECK: #0 malloc
- // CHECK: #{{(1|2)}} handler(int, {{(__)?}}siginfo{{(_t)?}}*, void*) {{.*}}signal_malloc.cc:[[@LINE+2]]
- // CHECK: SUMMARY: ThreadSanitizer: signal-unsafe call inside of a signal{{.*}}handler
- volatile char *p = (char*)malloc(1);
- p[0] = 0;
- free((void*)p);
-}
-
-int main() {
- struct sigaction act = {};
- act.sa_sigaction = &handler;
- sigaction(SIGPROF, &act, 0);
- kill(getpid(), SIGPROF);
- sleep(1); // let the signal handler run
- return 0;
-}
-
Copied: compiler-rt/trunk/test/tsan/signal_malloc.cpp (from r367653, compiler-rt/trunk/test/tsan/signal_malloc.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_malloc.cpp?p2=compiler-rt/trunk/test/tsan/signal_malloc.cpp&p1=compiler-rt/trunk/test/tsan/signal_malloc.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/signal_malloc.cc (original)
+++ compiler-rt/trunk/test/tsan/signal_malloc.cpp Fri Aug 2 00:18:07 2019
@@ -6,7 +6,7 @@
static void handler(int, siginfo_t*, void*) {
// CHECK: WARNING: ThreadSanitizer: signal-unsafe call inside of a signal
// CHECK: #0 malloc
- // CHECK: #{{(1|2)}} handler(int, {{(__)?}}siginfo{{(_t)?}}*, void*) {{.*}}signal_malloc.cc:[[@LINE+2]]
+ // CHECK: #{{(1|2)}} handler(int, {{(__)?}}siginfo{{(_t)?}}*, void*) {{.*}}signal_malloc.cpp:[[@LINE+2]]
// CHECK: SUMMARY: ThreadSanitizer: signal-unsafe call inside of a signal{{.*}}handler
volatile char *p = (char*)malloc(1);
p[0] = 0;
Removed: compiler-rt/trunk/test/tsan/signal_pause.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_pause.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/signal_pause.cc (original)
+++ compiler-rt/trunk/test/tsan/signal_pause.cc (removed)
@@ -1,35 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-
-// Test that pause loop handles signals.
-
-#include "test.h"
-#include <signal.h>
-#include <errno.h>
-
-void handler(int signum) {
- write(2, "DONE\n", 5);
- _exit(0);
-}
-
-void *thread(void *arg) {
- for (;;)
- pause();
- return 0;
-}
-
-int main(int argc, char** argv) {
- struct sigaction act = {};
- act.sa_handler = &handler;
- if (sigaction(SIGUSR1, &act, 0)) {
- fprintf(stderr, "sigaction failed %d\n", errno);
- return 1;
- }
- pthread_t th;
- pthread_create(&th, 0, thread, 0);
- sleep(1); // give it time to block in pause
- pthread_kill(th, SIGUSR1);
- sleep(10); // signal handler must exit the process while we are here
- return 0;
-}
-
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/signal_pause.cpp (from r367653, compiler-rt/trunk/test/tsan/signal_pause.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_pause.cpp?p2=compiler-rt/trunk/test/tsan/signal_pause.cpp&p1=compiler-rt/trunk/test/tsan/signal_pause.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/signal_recursive.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_recursive.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/signal_recursive.cc (original)
+++ compiler-rt/trunk/test/tsan/signal_recursive.cc (removed)
@@ -1,126 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-
-// Test case for recursive signal handlers, adopted from:
-// https://github.com/google/sanitizers/issues/478
-
-// REQUIRES: disabled
-
-#include "test.h"
-#include <semaphore.h>
-#include <signal.h>
-#include <errno.h>
-
-static const int kSigSuspend = SIGUSR1;
-static const int kSigRestart = SIGUSR2;
-
-static sem_t g_thread_suspend_ack_sem;
-
-static bool g_busy_thread_received_restart;
-
-static volatile bool g_busy_thread_garbage_collected;
-
-static void SaveRegistersInStack() {
- // Mono walks thread stacks to detect unreferenced objects.
- // If last object reference is kept in register the object will be collected
- // This is why threads can't be suspended with something like pthread_suspend
-}
-
-static void fail(const char *what) {
- fprintf(stderr, "FAILED: %s (errno=%d)\n", what, errno);
- exit(1);
-}
-
-static void SuspendHandler(int sig) {
- int old_errno = errno;
- SaveRegistersInStack();
-
- // Enable kSigRestart handling, tsan disables signals around signal handlers.
- sigset_t sigset;
- sigemptyset(&sigset);
- pthread_sigmask(SIG_SETMASK, &sigset, 0);
-
- // Acknowledge that thread is saved and suspended
- if (sem_post(&g_thread_suspend_ack_sem) != 0)
- fail("sem_post failed");
-
- // Wait for wakeup signal.
- while (!g_busy_thread_received_restart)
- usleep(100); // wait for kSigRestart signal
-
- // Acknowledge that thread restarted
- if (sem_post(&g_thread_suspend_ack_sem) != 0)
- fail("sem_post failed");
-
- g_busy_thread_garbage_collected = true;
-
- errno = old_errno;
-}
-
-static void RestartHandler(int sig) {
- g_busy_thread_received_restart = true;
-}
-
-static void StopWorld(pthread_t thread) {
- if (pthread_kill(thread, kSigSuspend) != 0)
- fail("pthread_kill failed");
-
- while (sem_wait(&g_thread_suspend_ack_sem) != 0) {
- if (errno != EINTR)
- fail("sem_wait failed");
- }
-}
-
-static void StartWorld(pthread_t thread) {
- if (pthread_kill(thread, kSigRestart) != 0)
- fail("pthread_kill failed");
-
- while (sem_wait(&g_thread_suspend_ack_sem) != 0) {
- if (errno != EINTR)
- fail("sem_wait failed");
- }
-}
-
-static void CollectGarbage(pthread_t thread) {
- StopWorld(thread);
- // Walk stacks
- StartWorld(thread);
-}
-
-static void Init() {
- if (sem_init(&g_thread_suspend_ack_sem, 0, 0) != 0)
- fail("sem_init failed");
-
- struct sigaction act = {};
- act.sa_flags = SA_RESTART;
- act.sa_handler = &SuspendHandler;
- if (sigaction(kSigSuspend, &act, NULL) != 0)
- fail("sigaction failed");
- act.sa_handler = &RestartHandler;
- if (sigaction(kSigRestart, &act, NULL) != 0)
- fail("sigaction failed");
-}
-
-void* BusyThread(void *arg) {
- (void)arg;
- while (!g_busy_thread_garbage_collected) {
- usleep(100); // Tsan deadlocks without these sleeps
- }
- return NULL;
-}
-
-int main(int argc, const char *argv[]) {
- Init();
- pthread_t busy_thread;
- if (pthread_create(&busy_thread, NULL, &BusyThread, NULL) != 0)
- fail("pthread_create failed");
- CollectGarbage(busy_thread);
- if (pthread_join(busy_thread, 0) != 0)
- fail("pthread_join failed");
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK-NOT: FAILED
-// CHECK-NOT: ThreadSanitizer CHECK failed
-// CHECK-NOT: WARNING: ThreadSanitizer:
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/signal_recursive.cpp (from r367653, compiler-rt/trunk/test/tsan/signal_recursive.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_recursive.cpp?p2=compiler-rt/trunk/test/tsan/signal_recursive.cpp&p1=compiler-rt/trunk/test/tsan/signal_recursive.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/signal_reset.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_reset.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/signal_reset.cc (original)
+++ compiler-rt/trunk/test/tsan/signal_reset.cc (removed)
@@ -1,75 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-// UNSUPPORTED: darwin
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <errno.h>
-
-volatile int X;
-int stop;
-
-static void handler(int sig) {
- (void)sig;
- if (X != 0)
- printf("bad");
-}
-
-static void* busy(void *p) {
- while (__atomic_load_n(&stop, __ATOMIC_RELAXED) == 0) {
- }
- return 0;
-}
-
-static void* reset(void *p) {
- struct sigaction act = {};
- for (int i = 0; i < 1000000; i++) {
- act.sa_handler = &handler;
- if (sigaction(SIGPROF, &act, 0)) {
- perror("sigaction");
- exit(1);
- }
- act.sa_handler = SIG_IGN;
- if (sigaction(SIGPROF, &act, 0)) {
- perror("sigaction");
- exit(1);
- }
- }
- return 0;
-}
-
-int main() {
- struct sigaction act = {};
- act.sa_handler = SIG_IGN;
- if (sigaction(SIGPROF, &act, 0)) {
- perror("sigaction");
- exit(1);
- }
-
- itimerval t;
- t.it_value.tv_sec = 0;
- t.it_value.tv_usec = 10;
- t.it_interval = t.it_value;
- if (setitimer(ITIMER_PROF, &t, 0)) {
- perror("setitimer");
- exit(1);
- }
-
- pthread_t th[2];
- pthread_create(&th[0], 0, busy, 0);
- pthread_create(&th[1], 0, reset, 0);
-
- pthread_join(th[1], 0);
- __atomic_store_n(&stop, 1, __ATOMIC_RELAXED);
- pthread_join(th[0], 0);
-
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer:
-// CHECK: DONE
-// CHECK-NOT: WARNING: ThreadSanitizer:
Copied: compiler-rt/trunk/test/tsan/signal_reset.cpp (from r367653, compiler-rt/trunk/test/tsan/signal_reset.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_reset.cpp?p2=compiler-rt/trunk/test/tsan/signal_reset.cpp&p1=compiler-rt/trunk/test/tsan/signal_reset.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/signal_sync.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_sync.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/signal_sync.cc (original)
+++ compiler-rt/trunk/test/tsan/signal_sync.cc (removed)
@@ -1,56 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-// UNSUPPORTED: darwin
-#include "test.h"
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <errno.h>
-
-volatile int X;
-
-static void handler(int sig) {
- (void)sig;
- if (X != 42)
- printf("bad");
-}
-
-static void* thr(void *p) {
- for (int i = 0; i != 1000; i++)
- usleep(1000); // process signals
- return 0;
-}
-
-int main() {
- const int kThreads = 10;
- pthread_t th[kThreads];
- for (int i = 0; i < kThreads; i++)
- pthread_create(&th[i], 0, thr, 0);
-
- X = 42;
-
- struct sigaction act = {};
- act.sa_handler = &handler;
- if (sigaction(SIGPROF, &act, 0)) {
- perror("sigaction");
- exit(1);
- }
-
- itimerval t;
- t.it_value.tv_sec = 0;
- t.it_value.tv_usec = 10;
- t.it_interval = t.it_value;
- if (setitimer(ITIMER_PROF, &t, 0)) {
- perror("setitimer");
- exit(1);
- }
-
- for (int i = 0; i < kThreads; i++)
- pthread_join(th[i], 0);
-
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer:
-// CHECK: DONE
-// CHECK-NOT: WARNING: ThreadSanitizer:
Copied: compiler-rt/trunk/test/tsan/signal_sync.cpp (from r367653, compiler-rt/trunk/test/tsan/signal_sync.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_sync.cpp?p2=compiler-rt/trunk/test/tsan/signal_sync.cpp&p1=compiler-rt/trunk/test/tsan/signal_sync.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/signal_sync2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_sync2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/signal_sync2.cc (original)
+++ compiler-rt/trunk/test/tsan/signal_sync2.cc (removed)
@@ -1,77 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-// UNSUPPORTED: darwin
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <errno.h>
-
-// Test synchronization in signal handled within IgnoreSync region.
-
-extern "C" void AnnotateIgnoreSyncBegin(const char *f, int l);
-extern "C" void AnnotateIgnoreSyncEnd(const char *f, int l);
-
-const int kSignalCount = 500;
-
-__thread int process_signals;
-int signals_handled;
-int done;
-int ready[kSignalCount];
-long long data[kSignalCount];
-
-static void handler(int sig) {
- if (!__atomic_load_n(&process_signals, __ATOMIC_RELAXED))
- return;
- int pos = signals_handled++;
- if (pos >= kSignalCount)
- return;
- data[pos] = pos;
- __atomic_store_n(&ready[pos], 1, __ATOMIC_RELEASE);
-}
-
-static void* thr(void *p) {
- AnnotateIgnoreSyncBegin(__FILE__, __LINE__);
- __atomic_store_n(&process_signals, 1, __ATOMIC_RELAXED);
- while (!__atomic_load_n(&done, __ATOMIC_RELAXED)) {
- }
- AnnotateIgnoreSyncEnd(__FILE__, __LINE__);
- return 0;
-}
-
-int main() {
- struct sigaction act = {};
- act.sa_handler = handler;
- if (sigaction(SIGPROF, &act, 0)) {
- perror("sigaction");
- exit(1);
- }
- itimerval t;
- t.it_value.tv_sec = 0;
- t.it_value.tv_usec = 10;
- t.it_interval = t.it_value;
- if (setitimer(ITIMER_PROF, &t, 0)) {
- perror("setitimer");
- exit(1);
- }
-
- pthread_t th;
- pthread_create(&th, 0, thr, 0);
- for (int pos = 0; pos < kSignalCount; pos++) {
- while (__atomic_load_n(&ready[pos], __ATOMIC_ACQUIRE) == 0) {
- }
- if (data[pos] != pos) {
- printf("at pos %d, expect %d, got %lld\n", pos, pos, data[pos]);
- exit(1);
- }
- }
- __atomic_store_n(&done, 1, __ATOMIC_RELAXED);
- pthread_join(th, 0);
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer:
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/signal_sync2.cpp (from r367653, compiler-rt/trunk/test/tsan/signal_sync2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_sync2.cpp?p2=compiler-rt/trunk/test/tsan/signal_sync2.cpp&p1=compiler-rt/trunk/test/tsan/signal_sync2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/signal_thread.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_thread.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/signal_thread.cc (original)
+++ compiler-rt/trunk/test/tsan/signal_thread.cc (removed)
@@ -1,53 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-// UNSUPPORTED: darwin
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <errno.h>
-
-volatile int X;
-
-static void handler(int sig) {
- (void)sig;
- if (X != 0)
- printf("bad");
-}
-
-static void* thr(void *p) {
- return 0;
-}
-
-int main() {
- struct sigaction act = {};
- act.sa_handler = &handler;
- if (sigaction(SIGPROF, &act, 0)) {
- perror("sigaction");
- exit(1);
- }
-
- itimerval t;
- t.it_value.tv_sec = 0;
- t.it_value.tv_usec = 10;
- t.it_interval = t.it_value;
- if (setitimer(ITIMER_PROF, &t, 0)) {
- perror("setitimer");
- exit(1);
- }
-
- for (int i = 0; i < 10000; i++) {
- pthread_t th;
- pthread_create(&th, 0, thr, 0);
- pthread_join(th, 0);
- }
-
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer:
-// CHECK: DONE
-// CHECK-NOT: WARNING: ThreadSanitizer:
Copied: compiler-rt/trunk/test/tsan/signal_thread.cpp (from r367653, compiler-rt/trunk/test/tsan/signal_thread.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_thread.cpp?p2=compiler-rt/trunk/test/tsan/signal_thread.cpp&p1=compiler-rt/trunk/test/tsan/signal_thread.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/signal_write.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_write.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/signal_write.cc (original)
+++ compiler-rt/trunk/test/tsan/signal_write.cc (removed)
@@ -1,27 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <stdio.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <string.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-static void handler(int, siginfo_t*, void*) {
- const char *str = "HELLO FROM SIGNAL\n";
- write(2, str, strlen(str));
-}
-
-int main() {
- struct sigaction act = {};
- act.sa_sigaction = &handler;
- sigaction(SIGPROF, &act, 0);
- kill(getpid(), SIGPROF);
- sleep(1); // let the signal handler run, can't use barrier in sig handler
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer
-// CHECK: HELLO FROM SIGNAL
-// CHECK: DONE
-
Copied: compiler-rt/trunk/test/tsan/signal_write.cpp (from r367653, compiler-rt/trunk/test/tsan/signal_write.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/signal_write.cpp?p2=compiler-rt/trunk/test/tsan/signal_write.cpp&p1=compiler-rt/trunk/test/tsan/signal_write.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/sigsuspend.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/sigsuspend.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/sigsuspend.cc (original)
+++ compiler-rt/trunk/test/tsan/sigsuspend.cc (removed)
@@ -1,44 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-
-// Always enable asserts.
-#ifdef NDEBUG
-#undef NDEBUG
-#endif
-
-#include <assert.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <unistd.h>
-#include <stdio.h>
-
-static bool signal_handler_ran = false;
-
-void do_nothing_signal_handler(int signum) {
- write(1, "HANDLER\n", 8);
- signal_handler_ran = true;
-}
-
-int main() {
- const int kSignalToTest = SIGSYS;
- assert(SIG_ERR != signal(kSignalToTest, do_nothing_signal_handler));
- sigset_t empty_set;
- assert(0 == sigemptyset(&empty_set));
- sigset_t one_signal = empty_set;
- assert(0 == sigaddset(&one_signal, kSignalToTest));
- sigset_t old_set;
- assert(0 == sigprocmask(SIG_BLOCK, &one_signal, &old_set));
- raise(kSignalToTest);
- assert(!signal_handler_ran);
- sigset_t all_but_one;
- assert(0 == sigfillset(&all_but_one));
- assert(0 == sigdelset(&all_but_one, kSignalToTest));
- sigsuspend(&all_but_one);
- assert(signal_handler_ran);
-
- // Restore the original set.
- assert(0 == sigprocmask(SIG_SETMASK, &old_set, NULL));
- printf("DONE\n");
-}
-
-// CHECK: HANDLER
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/sigsuspend.cpp (from r367653, compiler-rt/trunk/test/tsan/sigsuspend.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/sigsuspend.cpp?p2=compiler-rt/trunk/test/tsan/sigsuspend.cpp&p1=compiler-rt/trunk/test/tsan/sigsuspend.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/simple_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/simple_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/simple_race.cc (original)
+++ compiler-rt/trunk/test/tsan/simple_race.cc (removed)
@@ -1,29 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
-#include "test.h"
-
-int Global;
-
-void *Thread1(void *x) {
- barrier_wait(&barrier);
- Global++;
- return NULL;
-}
-
-void *Thread2(void *x) {
- Global--;
- barrier_wait(&barrier);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: SUMMARY: ThreadSanitizer: data race{{.*}}Thread
Copied: compiler-rt/trunk/test/tsan/simple_race.cpp (from r367653, compiler-rt/trunk/test/tsan/simple_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/simple_race.cpp?p2=compiler-rt/trunk/test/tsan/simple_race.cpp&p1=compiler-rt/trunk/test/tsan/simple_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/simple_stack2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/simple_stack2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/simple_stack2.cc (original)
+++ compiler-rt/trunk/test/tsan/simple_stack2.cc (removed)
@@ -1,53 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-int Global;
-
-void __attribute__((noinline)) foo1() {
- Global = 42;
-}
-
-void __attribute__((noinline)) bar1() {
- volatile int tmp = 42;
- int tmp2 = tmp;
- (void)tmp2;
- foo1();
-}
-
-void __attribute__((noinline)) foo2() {
- volatile int tmp = Global;
- int tmp2 = tmp;
- (void)tmp2;
-}
-
-void __attribute__((noinline)) bar2() {
- volatile int tmp = 42;
- int tmp2 = tmp;
- (void)tmp2;
- foo2();
-}
-
-void *Thread1(void *x) {
- barrier_wait(&barrier);
- bar1();
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t;
- pthread_create(&t, NULL, Thread1, NULL);
- bar2();
- barrier_wait(&barrier);
- pthread_join(t, NULL);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK-NEXT: Write of size 4 at {{.*}} by thread T1:
-// CHECK-NEXT: #0 foo1{{.*}} {{.*}}simple_stack2.cc:[[@LINE-40]]{{(:10)?}} ({{.*}})
-// CHECK-NEXT: #1 bar1{{.*}} {{.*}}simple_stack2.cc:[[@LINE-34]]{{(:3)?}} ({{.*}})
-// CHECK-NEXT: #2 Thread1{{.*}} {{.*}}simple_stack2.cc:[[@LINE-17]]{{(:3)?}} ({{.*}})
-// CHECK: Previous read of size 4 at {{.*}} by main thread:
-// CHECK-NEXT: #0 foo2{{.*}} {{.*}}simple_stack2.cc:[[@LINE-33]]{{(:22)?}} ({{.*}})
-// CHECK-NEXT: #1 bar2{{.*}} {{.*}}simple_stack2.cc:[[@LINE-25]]{{(:3)?}} ({{.*}})
-// CHECK-NEXT: #2 main{{.*}} {{.*}}simple_stack2.cc:[[@LINE-13]]{{(:3)?}} ({{.*}})
Copied: compiler-rt/trunk/test/tsan/simple_stack2.cpp (from r367653, compiler-rt/trunk/test/tsan/simple_stack2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/simple_stack2.cpp?p2=compiler-rt/trunk/test/tsan/simple_stack2.cpp&p1=compiler-rt/trunk/test/tsan/simple_stack2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/simple_stack2.cc (original)
+++ compiler-rt/trunk/test/tsan/simple_stack2.cpp Fri Aug 2 00:18:07 2019
@@ -44,10 +44,10 @@ int main() {
// CHECK: WARNING: ThreadSanitizer: data race
// CHECK-NEXT: Write of size 4 at {{.*}} by thread T1:
-// CHECK-NEXT: #0 foo1{{.*}} {{.*}}simple_stack2.cc:[[@LINE-40]]{{(:10)?}} ({{.*}})
-// CHECK-NEXT: #1 bar1{{.*}} {{.*}}simple_stack2.cc:[[@LINE-34]]{{(:3)?}} ({{.*}})
-// CHECK-NEXT: #2 Thread1{{.*}} {{.*}}simple_stack2.cc:[[@LINE-17]]{{(:3)?}} ({{.*}})
+// CHECK-NEXT: #0 foo1{{.*}} {{.*}}simple_stack2.cpp:[[@LINE-40]]{{(:10)?}} ({{.*}})
+// CHECK-NEXT: #1 bar1{{.*}} {{.*}}simple_stack2.cpp:[[@LINE-34]]{{(:3)?}} ({{.*}})
+// CHECK-NEXT: #2 Thread1{{.*}} {{.*}}simple_stack2.cpp:[[@LINE-17]]{{(:3)?}} ({{.*}})
// CHECK: Previous read of size 4 at {{.*}} by main thread:
-// CHECK-NEXT: #0 foo2{{.*}} {{.*}}simple_stack2.cc:[[@LINE-33]]{{(:22)?}} ({{.*}})
-// CHECK-NEXT: #1 bar2{{.*}} {{.*}}simple_stack2.cc:[[@LINE-25]]{{(:3)?}} ({{.*}})
-// CHECK-NEXT: #2 main{{.*}} {{.*}}simple_stack2.cc:[[@LINE-13]]{{(:3)?}} ({{.*}})
+// CHECK-NEXT: #0 foo2{{.*}} {{.*}}simple_stack2.cpp:[[@LINE-33]]{{(:22)?}} ({{.*}})
+// CHECK-NEXT: #1 bar2{{.*}} {{.*}}simple_stack2.cpp:[[@LINE-25]]{{(:3)?}} ({{.*}})
+// CHECK-NEXT: #2 main{{.*}} {{.*}}simple_stack2.cpp:[[@LINE-13]]{{(:3)?}} ({{.*}})
Removed: compiler-rt/trunk/test/tsan/sleep_sync.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/sleep_sync.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/sleep_sync.cc (original)
+++ compiler-rt/trunk/test/tsan/sleep_sync.cc (removed)
@@ -1,32 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-int X = 0;
-
-void MySleep() {
- sleep(1); // the sleep that must appear in the report
-}
-
-void *Thread(void *p) {
- barrier_wait(&barrier);
- MySleep(); // Assume the main thread has done the write.
- X = 42;
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- X = 43;
- barrier_wait(&barrier);
- pthread_join(t, 0);
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// ...
-// CHECK: As if synchronized via sleep:
-// CHECK-NEXT: #0 sleep
-// CHECK-NEXT: #1 MySleep
-// CHECK-NEXT: #2 Thread
Copied: compiler-rt/trunk/test/tsan/sleep_sync.cpp (from r367653, compiler-rt/trunk/test/tsan/sleep_sync.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/sleep_sync.cpp?p2=compiler-rt/trunk/test/tsan/sleep_sync.cpp&p1=compiler-rt/trunk/test/tsan/sleep_sync.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/sleep_sync2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/sleep_sync2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/sleep_sync2.cc (original)
+++ compiler-rt/trunk/test/tsan/sleep_sync2.cc (removed)
@@ -1,24 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-int X = 0;
-
-void *Thread(void *p) {
- X = 42;
- barrier_wait(&barrier);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t;
- sleep(1); // must not appear in the report
- pthread_create(&t, 0, Thread, 0);
- barrier_wait(&barrier);
- X = 43;
- pthread_join(t, 0);
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK-NOT: As if synchronized via sleep
Copied: compiler-rt/trunk/test/tsan/sleep_sync2.cpp (from r367653, compiler-rt/trunk/test/tsan/sleep_sync2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/sleep_sync2.cpp?p2=compiler-rt/trunk/test/tsan/sleep_sync2.cpp&p1=compiler-rt/trunk/test/tsan/sleep_sync2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/stack_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/stack_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/stack_race.cc (original)
+++ compiler-rt/trunk/test/tsan/stack_race.cc (removed)
@@ -1,22 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-void *Thread(void *a) {
- barrier_wait(&barrier);
- *(int*)a = 43;
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- int Var = 42;
- pthread_t t;
- pthread_create(&t, 0, Thread, &Var);
- Var = 43;
- barrier_wait(&barrier);
- pthread_join(t, 0);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Location is stack of main thread.
-
Copied: compiler-rt/trunk/test/tsan/stack_race.cpp (from r367653, compiler-rt/trunk/test/tsan/stack_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/stack_race.cpp?p2=compiler-rt/trunk/test/tsan/stack_race.cpp&p1=compiler-rt/trunk/test/tsan/stack_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/stack_race2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/stack_race2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/stack_race2.cc (original)
+++ compiler-rt/trunk/test/tsan/stack_race2.cc (removed)
@@ -1,29 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-void *Thread2(void *a) {
- barrier_wait(&barrier);
- *(int*)a = 43;
- return 0;
-}
-
-void *Thread(void *a) {
- int Var = 42;
- pthread_t t;
- pthread_create(&t, 0, Thread2, &Var);
- Var = 42;
- barrier_wait(&barrier);
- pthread_join(t, 0);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- pthread_join(t, 0);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Location is stack of thread T1.
-
Copied: compiler-rt/trunk/test/tsan/stack_race2.cpp (from r367653, compiler-rt/trunk/test/tsan/stack_race2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/stack_race2.cpp?p2=compiler-rt/trunk/test/tsan/stack_race2.cpp&p1=compiler-rt/trunk/test/tsan/stack_race2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/stack_sync_reuse.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/stack_sync_reuse.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/stack_sync_reuse.cc (original)
+++ compiler-rt/trunk/test/tsan/stack_sync_reuse.cc (removed)
@@ -1,67 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include "test.h"
-
-// Test case https://github.com/google/sanitizers/issues/494
-// Tsan sees false HB edge on address pointed to by syncp variable.
-// It is false because when acquire is done syncp points to a var in one frame,
-// and during release it points to a var in a different frame.
-// The code is somewhat tricky because it prevents compiler from optimizing
-// our accesses away, structured to not introduce other data races and
-// not introduce other synchronization, and to arrange the vars in different
-// frames to occupy the same address.
-
-// The data race CHECK-NOT below actually must be CHECK, because the program
-// does contain the data race on global.
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK: DONE
-
-long global;
-long *syncp;
-long *addr;
-long sink;
-
-void *Thread(void *x) {
- while (__atomic_load_n(&syncp, __ATOMIC_ACQUIRE) == 0)
- usleep(1000); // spin wait
- global = 42;
- __atomic_store_n(syncp, 1, __ATOMIC_RELEASE);
- __atomic_store_n(&syncp, 0, __ATOMIC_RELAXED);
- return NULL;
-}
-
-void __attribute__((noinline)) foobar() {
- __attribute__((aligned(64))) long s;
-
- addr = &s;
- __atomic_store_n(&s, 0, __ATOMIC_RELAXED);
- __atomic_store_n(&syncp, &s, __ATOMIC_RELEASE);
- while (__atomic_load_n(&syncp, __ATOMIC_RELAXED) != 0)
- usleep(1000); // spin wait
-}
-
-void __attribute__((noinline)) barfoo() {
- __attribute__((aligned(64))) long s;
-
- if (addr != &s) {
- printf("address mismatch addr=%p &s=%p\n", addr, &s);
- exit(1);
- }
- __atomic_store_n(&addr, &s, __ATOMIC_RELAXED);
- __atomic_store_n(&s, 0, __ATOMIC_RELAXED);
- sink = __atomic_load_n(&s, __ATOMIC_ACQUIRE);
- global = 43;
-}
-
-int main() {
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- foobar();
- barfoo();
- pthread_join(t, 0);
- if (sink != 0)
- exit(1);
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
Copied: compiler-rt/trunk/test/tsan/stack_sync_reuse.cpp (from r367653, compiler-rt/trunk/test/tsan/stack_sync_reuse.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/stack_sync_reuse.cpp?p2=compiler-rt/trunk/test/tsan/stack_sync_reuse.cpp&p1=compiler-rt/trunk/test/tsan/stack_sync_reuse.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/static_init1.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/static_init1.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/static_init1.cc (original)
+++ compiler-rt/trunk/test/tsan/static_init1.cc (removed)
@@ -1,27 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-struct P {
- int x;
- int y;
-};
-
-void *Thread(void *x) {
- static P p = {rand(), rand()};
- if (p.x > RAND_MAX || p.y > RAND_MAX)
- exit(1);
- return 0;
-}
-
-int main() {
- pthread_t t[2];
- pthread_create(&t[0], 0, Thread, 0);
- pthread_create(&t[1], 0, Thread, 0);
- pthread_join(t[0], 0);
- pthread_join(t[1], 0);
- fprintf(stderr, "PASS\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/static_init1.cpp (from r367653, compiler-rt/trunk/test/tsan/static_init1.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/static_init1.cpp?p2=compiler-rt/trunk/test/tsan/static_init1.cpp&p1=compiler-rt/trunk/test/tsan/static_init1.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/static_init2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/static_init2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/static_init2.cc (original)
+++ compiler-rt/trunk/test/tsan/static_init2.cc (removed)
@@ -1,33 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-struct Cache {
- int x;
- explicit Cache(int x)
- : x(x) {
- }
-};
-
-void foo(Cache *my) {
- static Cache *c = my ? my : new Cache(rand());
- if (c->x >= RAND_MAX)
- exit(1);
-}
-
-void *Thread(void *x) {
- foo(new Cache(rand()));
- return 0;
-}
-
-int main() {
- pthread_t t[2];
- pthread_create(&t[0], 0, Thread, 0);
- pthread_create(&t[1], 0, Thread, 0);
- pthread_join(t[0], 0);
- pthread_join(t[1], 0);
- fprintf(stderr, "PASS\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/static_init2.cpp (from r367653, compiler-rt/trunk/test/tsan/static_init2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/static_init2.cpp?p2=compiler-rt/trunk/test/tsan/static_init2.cpp&p1=compiler-rt/trunk/test/tsan/static_init2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/static_init3.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/static_init3.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/static_init3.cc (original)
+++ compiler-rt/trunk/test/tsan/static_init3.cc (removed)
@@ -1,47 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include <pthread.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <sched.h>
-
-struct Cache {
- int x;
-};
-
-Cache g_cache;
-
-Cache *CreateCache() {
- g_cache.x = rand();
- return &g_cache;
-}
-
-_Atomic(Cache*) queue;
-
-void *Thread1(void *x) {
- static Cache *c = CreateCache();
- __c11_atomic_store(&queue, c, 0);
- return 0;
-}
-
-void *Thread2(void *x) {
- Cache *c = 0;
- for (;;) {
- c = __c11_atomic_load(&queue, 0);
- if (c)
- break;
- sched_yield();
- }
- if (c->x >= RAND_MAX)
- exit(1);
- return 0;
-}
-
-int main() {
- pthread_t t[2];
- pthread_create(&t[0], 0, Thread1, 0);
- pthread_create(&t[1], 0, Thread2, 0);
- pthread_join(t[0], 0);
- pthread_join(t[1], 0);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/static_init3.cpp (from r367653, compiler-rt/trunk/test/tsan/static_init3.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/static_init3.cpp?p2=compiler-rt/trunk/test/tsan/static_init3.cpp&p1=compiler-rt/trunk/test/tsan/static_init3.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/static_init4.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/static_init4.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/static_init4.cc (original)
+++ compiler-rt/trunk/test/tsan/static_init4.cc (removed)
@@ -1,37 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <sched.h>
-
-struct Cache {
- int x;
- explicit Cache(int x)
- : x(x) {
- }
-};
-
-int g_other;
-
-Cache *CreateCache() {
- g_other = rand();
- return new Cache(rand());
-}
-
-void *Thread1(void *x) {
- static Cache *c = CreateCache();
- if (c->x == g_other)
- exit(1);
- return 0;
-}
-
-int main() {
- pthread_t t[2];
- pthread_create(&t[0], 0, Thread1, 0);
- pthread_create(&t[1], 0, Thread1, 0);
- pthread_join(t[0], 0);
- pthread_join(t[1], 0);
- fprintf(stderr, "PASS\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/static_init4.cpp (from r367653, compiler-rt/trunk/test/tsan/static_init4.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/static_init4.cpp?p2=compiler-rt/trunk/test/tsan/static_init4.cpp&p1=compiler-rt/trunk/test/tsan/static_init4.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/static_init5.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/static_init5.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/static_init5.cc (original)
+++ compiler-rt/trunk/test/tsan/static_init5.cc (removed)
@@ -1,42 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <sched.h>
-
-struct Cache {
- int x;
- explicit Cache(int x)
- : x(x) {
- }
-};
-
-void *AsyncInit(void *p) {
- return new Cache((int)(long)p);
-}
-
-Cache *CreateCache() {
- pthread_t t;
- pthread_create(&t, 0, AsyncInit, (void*)(long)rand());
- void *res;
- pthread_join(t, &res);
- return (Cache*)res;
-}
-
-void *Thread1(void *x) {
- static Cache *c = CreateCache();
- if (c->x >= RAND_MAX)
- exit(1);
- return 0;
-}
-
-int main() {
- pthread_t t[2];
- pthread_create(&t[0], 0, Thread1, 0);
- pthread_create(&t[1], 0, Thread1, 0);
- pthread_join(t[0], 0);
- pthread_join(t[1], 0);
- fprintf(stderr, "PASS\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/static_init5.cpp (from r367653, compiler-rt/trunk/test/tsan/static_init5.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/static_init5.cpp?p2=compiler-rt/trunk/test/tsan/static_init5.cpp&p1=compiler-rt/trunk/test/tsan/static_init5.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/static_init6.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/static_init6.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/static_init6.cc (original)
+++ compiler-rt/trunk/test/tsan/static_init6.cc (removed)
@@ -1,42 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <sched.h>
-
-struct Cache {
- int x;
- explicit Cache(int x)
- : x(x) {
- }
-};
-
-void *AsyncInit(void *p) {
- return new Cache((int)(long)p);
-}
-
-Cache *CreateCache() {
- pthread_t t;
- pthread_create(&t, 0, AsyncInit, (void*)(long)rand());
- void *res;
- pthread_join(t, &res);
- return (Cache*)res;
-}
-
-void *Thread1(void *x) {
- static Cache *c = CreateCache();
- if (c->x >= RAND_MAX)
- exit(1);
- return 0;
-}
-
-int main() {
- pthread_t t[2];
- pthread_create(&t[0], 0, Thread1, 0);
- pthread_create(&t[1], 0, Thread1, 0);
- pthread_join(t[0], 0);
- pthread_join(t[1], 0);
- fprintf(stderr, "PASS\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/static_init6.cpp (from r367653, compiler-rt/trunk/test/tsan/static_init6.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/static_init6.cpp?p2=compiler-rt/trunk/test/tsan/static_init6.cpp&p1=compiler-rt/trunk/test/tsan/static_init6.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/strerror_r.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/strerror_r.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/strerror_r.cc (original)
+++ compiler-rt/trunk/test/tsan/strerror_r.cc (removed)
@@ -1,32 +0,0 @@
-// RUN: %clangxx_tsan -O1 -DTEST_ERROR=ERANGE %s -o %t && %run %t 2>&1 | FileCheck --check-prefixes=CHECK,CHECK-SYS %s
-// RUN: %clangxx_tsan -O1 -DTEST_ERROR=-1 %s -o %t && not %run %t 2>&1 | FileCheck --check-prefixes=CHECK,CHECK-USER %s
-// This test is for GNU specific version of strerror_r()
-// UNSUPPORTED: darwin, netbsd, freebsd
-
-#include "test.h"
-
-#include <errno.h>
-#include <pthread.h>
-#include <string.h>
-
-char buffer[1000];
-
-void *Thread(void *p) {
- barrier_wait(&barrier);
- return strerror_r(TEST_ERROR, buffer, sizeof(buffer));
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t th;
- pthread_create(&th, 0, Thread, 0);
- strerror_r(TEST_ERROR, buffer, sizeof(buffer));
- barrier_wait(&barrier);
- pthread_join(th, 0);
- fprintf(stderr, "DONE\n");
-}
-
-// CHECK-USER: WARNING: ThreadSanitizer: data race
-// CHECK-SYS-NOT: WARNING: ThreadSanitizer: data race
-
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/strerror_r.cpp (from r367653, compiler-rt/trunk/test/tsan/strerror_r.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/strerror_r.cpp?p2=compiler-rt/trunk/test/tsan/strerror_r.cpp&p1=compiler-rt/trunk/test/tsan/strerror_r.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/sunrpc.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/sunrpc.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/sunrpc.cc (original)
+++ compiler-rt/trunk/test/tsan/sunrpc.cc (removed)
@@ -1,27 +0,0 @@
-// REQUIRES: sunrpc
-
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-
-#include <pthread.h>
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-#include <stdio.h>
-
-void *thr(void *p) {
- XDR xdrs;
- char buf[100];
- xdrmem_create(&xdrs, buf, sizeof(buf), XDR_ENCODE);
- xdr_destroy(&xdrs);
- return 0;
-}
-
-int main(int argc, char *argv[]) {
- pthread_t th[2];
- pthread_create(&th[0], 0, thr, 0);
- pthread_create(&th[1], 0, thr, 0);
- pthread_join(th[0], 0);
- pthread_join(th[1], 0);
- fprintf(stderr, "DONE\n");
- // CHECK: DONE
- return 0;
-}
Copied: compiler-rt/trunk/test/tsan/sunrpc.cpp (from r367653, compiler-rt/trunk/test/tsan/sunrpc.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/sunrpc.cpp?p2=compiler-rt/trunk/test/tsan/sunrpc.cpp&p1=compiler-rt/trunk/test/tsan/sunrpc.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/suppress_same_address.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppress_same_address.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/suppress_same_address.cc (original)
+++ compiler-rt/trunk/test/tsan/suppress_same_address.cc (removed)
@@ -1,30 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-volatile int X;
-
-void *Thread1(void *x) {
- barrier_wait(&barrier);
- X = 42;
- X = 66;
- X = 78;
- return 0;
-}
-
-void *Thread2(void *x) {
- X = 11;
- X = 99;
- X = 73;
- barrier_wait(&barrier);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t;
- pthread_create(&t, 0, Thread1, 0);
- Thread2(0);
- pthread_join(t, 0);
-}
-
-// CHECK: ThreadSanitizer: reported 1 warnings
Copied: compiler-rt/trunk/test/tsan/suppress_same_address.cpp (from r367653, compiler-rt/trunk/test/tsan/suppress_same_address.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppress_same_address.cpp?p2=compiler-rt/trunk/test/tsan/suppress_same_address.cpp&p1=compiler-rt/trunk/test/tsan/suppress_same_address.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/suppress_same_stacks.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppress_same_stacks.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/suppress_same_stacks.cc (original)
+++ compiler-rt/trunk/test/tsan/suppress_same_stacks.cc (removed)
@@ -1,27 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include <pthread.h>
-
-volatile int N; // Prevent loop unrolling.
-int **data;
-
-void *Thread1(void *x) {
- for (int i = 0; i < N; i++)
- data[i][0] = 42;
- return 0;
-}
-
-int main() {
- N = 4;
- data = new int*[N];
- for (int i = 0; i < N; i++)
- data[i] = new int;
- pthread_t t;
- pthread_create(&t, 0, Thread1, 0);
- Thread1(0);
- pthread_join(t, 0);
- for (int i = 0; i < N; i++)
- delete data[i];
- delete[] data;
-}
-
-// CHECK: ThreadSanitizer: reported 1 warnings
Copied: compiler-rt/trunk/test/tsan/suppress_same_stacks.cpp (from r367653, compiler-rt/trunk/test/tsan/suppress_same_stacks.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppress_same_stacks.cpp?p2=compiler-rt/trunk/test/tsan/suppress_same_stacks.cpp&p1=compiler-rt/trunk/test/tsan/suppress_same_stacks.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/suppressions_global.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppressions_global.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/suppressions_global.cc (original)
+++ compiler-rt/trunk/test/tsan/suppressions_global.cc (removed)
@@ -1,29 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %env_tsan_opts=suppressions='%s.supp' %run %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdio.h>
-
-int RacyGlobal;
-
-void *Thread1(void *x) {
- RacyGlobal = 42;
- return NULL;
-}
-
-void *Thread2(void *x) {
- RacyGlobal = 43;
- return NULL;
-}
-
-int main() {
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- fprintf(stderr, "OK\n");
- return 0;
-}
-
-// CHECK-NOT: failed to open suppressions file
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-
Removed: compiler-rt/trunk/test/tsan/suppressions_global.cc.supp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppressions_global.cc.supp?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/suppressions_global.cc.supp (original)
+++ compiler-rt/trunk/test/tsan/suppressions_global.cc.supp (removed)
@@ -1,2 +0,0 @@
-race:RacyGlobal
-
Copied: compiler-rt/trunk/test/tsan/suppressions_global.cpp (from r367653, compiler-rt/trunk/test/tsan/suppressions_global.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppressions_global.cpp?p2=compiler-rt/trunk/test/tsan/suppressions_global.cpp&p1=compiler-rt/trunk/test/tsan/suppressions_global.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Copied: compiler-rt/trunk/test/tsan/suppressions_global.cpp.supp (from r367653, compiler-rt/trunk/test/tsan/suppressions_global.cc.supp)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppressions_global.cpp.supp?p2=compiler-rt/trunk/test/tsan/suppressions_global.cpp.supp&p1=compiler-rt/trunk/test/tsan/suppressions_global.cc.supp&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/suppressions_mutex.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppressions_mutex.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/suppressions_mutex.cc (original)
+++ compiler-rt/trunk/test/tsan/suppressions_mutex.cc (removed)
@@ -1,19 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %env_tsan_opts=suppressions='%s.supp' %run %t 2>&1 | FileCheck %s
-#include "test.h"
-
-void __attribute__((noinline)) suppress_this(pthread_mutex_t *mu) {
- pthread_mutex_destroy(mu);
-}
-
-int main() {
- pthread_mutex_t mu;
- pthread_mutex_init(&mu, 0);
- pthread_mutex_lock(&mu);
- suppress_this(&mu);
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK-NOT: failed to open suppressions file
-// CHECK-NOT: WARNING: ThreadSanitizer:
-// CHECK: DONE
Removed: compiler-rt/trunk/test/tsan/suppressions_mutex.cc.supp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppressions_mutex.cc.supp?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/suppressions_mutex.cc.supp (original)
+++ compiler-rt/trunk/test/tsan/suppressions_mutex.cc.supp (removed)
@@ -1,2 +0,0 @@
-mutex:suppress_this
-
Copied: compiler-rt/trunk/test/tsan/suppressions_mutex.cpp (from r367653, compiler-rt/trunk/test/tsan/suppressions_mutex.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppressions_mutex.cpp?p2=compiler-rt/trunk/test/tsan/suppressions_mutex.cpp&p1=compiler-rt/trunk/test/tsan/suppressions_mutex.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Copied: compiler-rt/trunk/test/tsan/suppressions_mutex.cpp.supp (from r367653, compiler-rt/trunk/test/tsan/suppressions_mutex.cc.supp)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppressions_mutex.cpp.supp?p2=compiler-rt/trunk/test/tsan/suppressions_mutex.cpp.supp&p1=compiler-rt/trunk/test/tsan/suppressions_mutex.cc.supp&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/suppressions_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppressions_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/suppressions_race.cc (original)
+++ compiler-rt/trunk/test/tsan/suppressions_race.cc (removed)
@@ -1,31 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %env_tsan_opts=suppressions='%s.supp' %run %t 2>&1 | FileCheck %s
-#include "test.h"
-
-int Global;
-
-void *Thread1(void *x) {
- barrier_wait(&barrier);
- Global = 42;
- return NULL;
-}
-
-void *Thread2(void *x) {
- Global = 43;
- barrier_wait(&barrier);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- fprintf(stderr, "OK\n");
- return 0;
-}
-
-// CHECK-NOT: failed to open suppressions file
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-
Removed: compiler-rt/trunk/test/tsan/suppressions_race.cc.supp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppressions_race.cc.supp?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/suppressions_race.cc.supp (original)
+++ compiler-rt/trunk/test/tsan/suppressions_race.cc.supp (removed)
@@ -1,2 +0,0 @@
-race:Thread1
-
Copied: compiler-rt/trunk/test/tsan/suppressions_race.cpp (from r367653, compiler-rt/trunk/test/tsan/suppressions_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppressions_race.cpp?p2=compiler-rt/trunk/test/tsan/suppressions_race.cpp&p1=compiler-rt/trunk/test/tsan/suppressions_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Copied: compiler-rt/trunk/test/tsan/suppressions_race.cpp.supp (from r367653, compiler-rt/trunk/test/tsan/suppressions_race.cc.supp)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppressions_race.cpp.supp?p2=compiler-rt/trunk/test/tsan/suppressions_race.cpp.supp&p1=compiler-rt/trunk/test/tsan/suppressions_race.cc.supp&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/suppressions_race2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppressions_race2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/suppressions_race2.cc (original)
+++ compiler-rt/trunk/test/tsan/suppressions_race2.cc (removed)
@@ -1,31 +0,0 @@
-// RUN: %clang_tsan -O1 %s -o %t && %env_tsan_opts=suppressions='%s.supp' %run %t 2>&1 | FileCheck %s
-#include "test.h"
-
-int Global;
-
-void *Thread1(void *x) {
- Global = 42;
- barrier_wait(&barrier);
- return NULL;
-}
-
-void *Thread2(void *x) {
- barrier_wait(&barrier);
- Global = 43;
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- fprintf(stderr, "OK\n");
- return 0;
-}
-
-// CHECK-NOT: failed to open suppressions file
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-
Removed: compiler-rt/trunk/test/tsan/suppressions_race2.cc.supp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppressions_race2.cc.supp?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/suppressions_race2.cc.supp (original)
+++ compiler-rt/trunk/test/tsan/suppressions_race2.cc.supp (removed)
@@ -1,2 +0,0 @@
-race:Thread2
-
Copied: compiler-rt/trunk/test/tsan/suppressions_race2.cpp (from r367653, compiler-rt/trunk/test/tsan/suppressions_race2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppressions_race2.cpp?p2=compiler-rt/trunk/test/tsan/suppressions_race2.cpp&p1=compiler-rt/trunk/test/tsan/suppressions_race2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Copied: compiler-rt/trunk/test/tsan/suppressions_race2.cpp.supp (from r367653, compiler-rt/trunk/test/tsan/suppressions_race2.cc.supp)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/suppressions_race2.cpp.supp?p2=compiler-rt/trunk/test/tsan/suppressions_race2.cpp.supp&p1=compiler-rt/trunk/test/tsan/suppressions_race2.cc.supp&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/thread_end_with_ignore.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/thread_end_with_ignore.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/thread_end_with_ignore.cc (original)
+++ compiler-rt/trunk/test/tsan/thread_end_with_ignore.cc (removed)
@@ -1,24 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include <pthread.h>
-#include <stdio.h>
-
-extern "C" void AnnotateIgnoreReadsBegin(const char *f, int l);
-
-void *Thread(void *x) {
- AnnotateIgnoreReadsBegin("", 0);
- return 0;
-}
-
-int main() {
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- pthread_join(t, 0);
-}
-
-// CHECK: ThreadSanitizer: thread T1 finished with ignores enabled, created at:
-// CHECK: #0 pthread_create
-// CHECK: #1 main
-// CHECK: Ignore was enabled at:
-// CHECK: #0 AnnotateIgnoreReadsBegin
-// CHECK: #1 Thread
-
Copied: compiler-rt/trunk/test/tsan/thread_end_with_ignore.cpp (from r367653, compiler-rt/trunk/test/tsan/thread_end_with_ignore.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/thread_end_with_ignore.cpp?p2=compiler-rt/trunk/test/tsan/thread_end_with_ignore.cpp&p1=compiler-rt/trunk/test/tsan/thread_end_with_ignore.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/thread_end_with_ignore2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/thread_end_with_ignore2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/thread_end_with_ignore2.cc (original)
+++ compiler-rt/trunk/test/tsan/thread_end_with_ignore2.cc (removed)
@@ -1,12 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-extern "C" void AnnotateIgnoreWritesBegin(const char *f, int l);
-
-int main() {
- AnnotateIgnoreWritesBegin("", 0);
-}
-
-// CHECK: ThreadSanitizer: main thread finished with ignores enabled
-// CHECK: Ignore was enabled at:
-// CHECK: #0 AnnotateIgnoreWritesBegin
-// CHECK: #1 main
-
Copied: compiler-rt/trunk/test/tsan/thread_end_with_ignore2.cpp (from r367653, compiler-rt/trunk/test/tsan/thread_end_with_ignore2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/thread_end_with_ignore2.cpp?p2=compiler-rt/trunk/test/tsan/thread_end_with_ignore2.cpp&p1=compiler-rt/trunk/test/tsan/thread_end_with_ignore2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/thread_end_with_ignore3.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/thread_end_with_ignore3.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/thread_end_with_ignore3.cc (original)
+++ compiler-rt/trunk/test/tsan/thread_end_with_ignore3.cc (removed)
@@ -1,22 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-extern "C" void AnnotateIgnoreReadsBegin(const char *f, int l);
-extern "C" void AnnotateIgnoreReadsEnd(const char *f, int l);
-
-int main() {
- AnnotateIgnoreReadsBegin("", 0);
- AnnotateIgnoreReadsBegin("", 0);
- AnnotateIgnoreReadsEnd("", 0);
- AnnotateIgnoreReadsEnd("", 0);
- AnnotateIgnoreReadsBegin("", 0);
- AnnotateIgnoreReadsBegin("", 0);
- AnnotateIgnoreReadsEnd("", 0);
-}
-
-// CHECK: ThreadSanitizer: main thread finished with ignores enabled
-// CHECK: Ignore was enabled at:
-// CHECK: #0 AnnotateIgnoreReadsBegin
-// CHECK: #1 main {{.*}}thread_end_with_ignore3.cc:10
-// CHECK: Ignore was enabled at:
-// CHECK: #0 AnnotateIgnoreReadsBegin
-// CHECK: #1 main {{.*}}thread_end_with_ignore3.cc:11
-
Copied: compiler-rt/trunk/test/tsan/thread_end_with_ignore3.cpp (from r367653, compiler-rt/trunk/test/tsan/thread_end_with_ignore3.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/thread_end_with_ignore3.cpp?p2=compiler-rt/trunk/test/tsan/thread_end_with_ignore3.cpp&p1=compiler-rt/trunk/test/tsan/thread_end_with_ignore3.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/thread_end_with_ignore3.cc (original)
+++ compiler-rt/trunk/test/tsan/thread_end_with_ignore3.cpp Fri Aug 2 00:18:07 2019
@@ -15,8 +15,8 @@ int main() {
// CHECK: ThreadSanitizer: main thread finished with ignores enabled
// CHECK: Ignore was enabled at:
// CHECK: #0 AnnotateIgnoreReadsBegin
-// CHECK: #1 main {{.*}}thread_end_with_ignore3.cc:10
+// CHECK: #1 main {{.*}}thread_end_with_ignore3.cpp:10
// CHECK: Ignore was enabled at:
// CHECK: #0 AnnotateIgnoreReadsBegin
-// CHECK: #1 main {{.*}}thread_end_with_ignore3.cc:11
+// CHECK: #1 main {{.*}}thread_end_with_ignore3.cpp:11
Removed: compiler-rt/trunk/test/tsan/thread_name.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/thread_name.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/thread_name.cc (original)
+++ compiler-rt/trunk/test/tsan/thread_name.cc (removed)
@@ -1,51 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-#if defined(__linux__)
-#define USE_PTHREAD_SETNAME_NP __GLIBC_PREREQ(2, 12)
-#define tsan_pthread_setname_np pthread_setname_np
-#elif defined(__FreeBSD__)
-#include <pthread_np.h>
-#define USE_PTHREAD_SETNAME_NP 1
-#define tsan_pthread_setname_np pthread_set_name_np
-#elif defined(__NetBSD__)
-#define USE_PTHREAD_SETNAME_NP 1
-#define tsan_pthread_setname_np(a, b) pthread_setname_np((a), "%s", (void *)(b))
-#else
-#define USE_PTHREAD_SETNAME_NP 0
-#endif
-
-extern "C" void AnnotateThreadName(const char *f, int l, const char *name);
-
-int Global;
-
-void *Thread1(void *x) {
- barrier_wait(&barrier);
- AnnotateThreadName(__FILE__, __LINE__, "Thread1");
- Global++;
- return NULL;
-}
-
-void *Thread2(void *x) {
-#if USE_PTHREAD_SETNAME_NP
- tsan_pthread_setname_np(pthread_self(), "Thread2");
-#else
- AnnotateThreadName(__FILE__, __LINE__, "Thread2");
-#endif
- Global--;
- barrier_wait(&barrier);
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Thread T1 'Thread1'
-// CHECK: Thread T2 'Thread2'
Copied: compiler-rt/trunk/test/tsan/thread_name.cpp (from r367653, compiler-rt/trunk/test/tsan/thread_name.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/thread_name.cpp?p2=compiler-rt/trunk/test/tsan/thread_name.cpp&p1=compiler-rt/trunk/test/tsan/thread_name.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/thread_name2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/thread_name2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/thread_name2.cc (original)
+++ compiler-rt/trunk/test/tsan/thread_name2.cc (removed)
@@ -1,44 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-// OS X doesn't have pthread_setname_np(tid, name).
-// UNSUPPORTED: darwin
-
-#if defined(__FreeBSD__)
-#include <pthread_np.h>
-#define tsan_pthread_setname_np pthread_set_name_np
-#elif defined(__NetBSD__)
-#define tsan_pthread_setname_np(a, b) pthread_setname_np((a), "%s", (void *)(b))
-#else
-#define tsan_pthread_setname_np pthread_setname_np
-#endif
-
-long long Global;
-
-void *Thread1(void *x) {
- barrier_wait(&barrier);
- Global++;
- return 0;
-}
-
-void *Thread2(void *x) {
- tsan_pthread_setname_np(pthread_self(), "foobar2");
- Global--;
- barrier_wait(&barrier);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 3);
- pthread_t t[2];
- pthread_create(&t[0], 0, Thread1, 0);
- pthread_create(&t[1], 0, Thread2, 0);
- tsan_pthread_setname_np(t[0], "foobar1");
- barrier_wait(&barrier);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Thread T1 'foobar1'
-// CHECK: Thread T2 'foobar2'
Copied: compiler-rt/trunk/test/tsan/thread_name2.cpp (from r367653, compiler-rt/trunk/test/tsan/thread_name2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/thread_name2.cpp?p2=compiler-rt/trunk/test/tsan/thread_name2.cpp&p1=compiler-rt/trunk/test/tsan/thread_name2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/tls_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/tls_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/tls_race.cc (original)
+++ compiler-rt/trunk/test/tsan/tls_race.cc (removed)
@@ -1,24 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
-#include "test.h"
-
-void *Thread(void *a) {
- barrier_wait(&barrier);
- *(int*)a = 43;
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- static __thread int Var = 42;
- pthread_t t;
- pthread_create(&t, 0, Thread, &Var);
- Var = 43;
- barrier_wait(&barrier);
- pthread_join(t, 0);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK-Linux: Location is TLS of main thread.
-// CHECK-FreeBSD: Location is TLS of main thread.
-// CHECK-NetBSD: Location is TLS of main thread.
-// CHECK-Darwin: Location is heap block of size 4
Copied: compiler-rt/trunk/test/tsan/tls_race.cpp (from r367653, compiler-rt/trunk/test/tsan/tls_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/tls_race.cpp?p2=compiler-rt/trunk/test/tsan/tls_race.cpp&p1=compiler-rt/trunk/test/tsan/tls_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/tls_race2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/tls_race2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/tls_race2.cc (original)
+++ compiler-rt/trunk/test/tsan/tls_race2.cc (removed)
@@ -1,34 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
-#include "test.h"
-
-void *Thread2(void *a) {
- barrier_wait(&barrier);
- *(int*)a = 43;
- return 0;
-}
-
-void *Thread(void *a) {
- static __thread int Var = 42;
- pthread_t t;
- pthread_create(&t, 0, Thread2, &Var);
- Var = 42;
- barrier_wait(&barrier);
- pthread_join(t, 0);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t;
- pthread_create(&t, 0, Thread, 0);
- pthread_join(t, 0);
- fprintf(stderr, "DONE\n");
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK-Linux: Location is TLS of thread T1.
-// CHECK-FreeBSD: Location is TLS of thread T1.
-// CHECK-NetBSD: Location is TLS of thread T1.
-// CHECK-Darwin: Location is heap block of size 4
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/tls_race2.cpp (from r367653, compiler-rt/trunk/test/tsan/tls_race2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/tls_race2.cpp?p2=compiler-rt/trunk/test/tsan/tls_race2.cpp&p1=compiler-rt/trunk/test/tsan/tls_race2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/tsan-vs-gvn.cc (original)
+++ compiler-rt/trunk/test/tsan/tsan-vs-gvn.cc (removed)
@@ -1,38 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_tsan -O2 %s -o %t && %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_tsan -O3 %s -o %t && %run %t 2>&1 | FileCheck %s
-//
-// Check that load widening is not tsan-hostile.
-#include <pthread.h>
-#include <stdio.h>
-#include <string.h>
-
-struct {
- int i;
- char c1, c2, c3, c4;
-} S;
-
-int G;
-
-void *Thread1(void *x) {
- G = S.c1 + S.c3;
- return NULL;
-}
-
-void *Thread2(void *x) {
- S.c2 = 1;
- return NULL;
-}
-
-int main() {
- pthread_t t[2];
- memset(&S, 123, sizeof(S));
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- fprintf(stderr, "PASS\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK: PASS
Copied: compiler-rt/trunk/test/tsan/tsan-vs-gvn.cpp (from r367653, compiler-rt/trunk/test/tsan/tsan-vs-gvn.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/tsan-vs-gvn.cpp?p2=compiler-rt/trunk/test/tsan/tsan-vs-gvn.cpp&p1=compiler-rt/trunk/test/tsan/tsan-vs-gvn.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/unaligned_norace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/unaligned_norace.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/unaligned_norace.cc (original)
+++ compiler-rt/trunk/test/tsan/unaligned_norace.cc (removed)
@@ -1,84 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-
-uint64_t objs[8*3*3*2][3];
-
-extern "C" {
-void __tsan_unaligned_read2(void *addr);
-void __tsan_unaligned_read4(void *addr);
-void __tsan_unaligned_read8(void *addr);
-void __tsan_unaligned_write2(void *addr);
-void __tsan_unaligned_write4(void *addr);
-void __tsan_unaligned_write8(void *addr);
-}
-
-static void access(char *p, int sz, int rw) {
- if (rw) {
- switch (sz) {
- case 0: __tsan_unaligned_write2(p); break;
- case 1: __tsan_unaligned_write4(p); break;
- case 2: __tsan_unaligned_write8(p); break;
- default: exit(1);
- }
- } else {
- switch (sz) {
- case 0: __tsan_unaligned_read2(p); break;
- case 1: __tsan_unaligned_read4(p); break;
- case 2: __tsan_unaligned_read8(p); break;
- default: exit(1);
- }
- }
-}
-
-static int accesssize(int sz) {
- switch (sz) {
- case 0: return 2;
- case 1: return 4;
- case 2: return 8;
- }
- exit(1);
-}
-
-void Test(bool main) {
- uint64_t *obj = objs[0];
- for (int off = 0; off < 8; off++) {
- for (int sz1 = 0; sz1 < 3; sz1++) {
- for (int sz2 = 0; sz2 < 3; sz2++) {
- for (int rw = 0; rw < 2; rw++) {
- char *p = (char*)obj + off;
- if (main) {
- // printf("thr=%d off=%d sz1=%d sz2=%d rw=%d p=%p\n",
- // main, off, sz1, sz2, rw, p);
- access(p, sz1, true);
- } else {
- p += accesssize(sz1);
- // printf("thr=%d off=%d sz1=%d sz2=%d rw=%d p=%p\n",
- // main, off, sz1, sz2, rw, p);
- access(p, sz2, rw);
- }
- obj += 3;
- }
- }
- }
- }
-}
-
-void *Thread(void *p) {
- (void)p;
- Test(false);
- return 0;
-}
-
-int main() {
- pthread_t th;
- pthread_create(&th, 0, Thread, 0);
- Test(true);
- pthread_join(th, 0);
- fprintf(stderr, "OK\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer:
-// CHECK: OK
Copied: compiler-rt/trunk/test/tsan/unaligned_norace.cpp (from r367653, compiler-rt/trunk/test/tsan/unaligned_norace.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/unaligned_norace.cpp?p2=compiler-rt/trunk/test/tsan/unaligned_norace.cpp&p1=compiler-rt/trunk/test/tsan/unaligned_norace.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/unaligned_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/unaligned_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/unaligned_race.cc (original)
+++ compiler-rt/trunk/test/tsan/unaligned_race.cc (removed)
@@ -1,129 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-#include <stdint.h>
-
-#define NOINLINE __attribute__((noinline))
-
-volatile uint64_t objs[8*2*(2 + 4 + 8)][2];
-
-// All this mess is to generate unique stack for each race,
-// otherwise tsan will suppress similar stacks.
-
-static NOINLINE void access(volatile void *p, int sz, int rw) {
- if (rw) {
- switch (sz) {
- case 0: __sanitizer_unaligned_store16((void *)p, 0); break;
- case 1: __sanitizer_unaligned_store32((void *)p, 0); break;
- case 2: __sanitizer_unaligned_store64((void *)p, 0); break;
- default: exit(1);
- }
- } else {
- switch (sz) {
- case 0: __sanitizer_unaligned_load16((void *)p); break;
- case 1: __sanitizer_unaligned_load32((void *)p); break;
- case 2: __sanitizer_unaligned_load64((void *)p); break;
- default: exit(1);
- }
- }
-}
-
-static int accesssize(int sz) {
- switch (sz) {
- case 0: return 2;
- case 1: return 4;
- case 2: return 8;
- }
- exit(1);
-}
-
-template<int off, int off2>
-static NOINLINE void access3(bool main, int sz1, bool rw, volatile char *p) {
- p += off;
- if (main) {
- access(p, sz1, true);
- } else {
- p += off2;
- if (rw) {
- *p = 42;
- } else {
- if (*p == 42)
- printf("bingo!\n");
- }
- }
-}
-
-template<int off>
-static NOINLINE void
-access2(bool main, int sz1, int off2, bool rw, volatile char *obj) {
- if (off2 == 0)
- access3<off, 0>(main, sz1, rw, obj);
- else if (off2 == 1)
- access3<off, 1>(main, sz1, rw, obj);
- else if (off2 == 2)
- access3<off, 2>(main, sz1, rw, obj);
- else if (off2 == 3)
- access3<off, 3>(main, sz1, rw, obj);
- else if (off2 == 4)
- access3<off, 4>(main, sz1, rw, obj);
- else if (off2 == 5)
- access3<off, 5>(main, sz1, rw, obj);
- else if (off2 == 6)
- access3<off, 6>(main, sz1, rw, obj);
- else if (off2 == 7)
- access3<off, 7>(main, sz1, rw, obj);
-}
-
-static NOINLINE void
-access1(bool main, int off, int sz1, int off2, bool rw, char *obj) {
- if (off == 0)
- access2<0>(main, sz1, off2, rw, obj);
- else if (off == 1)
- access2<1>(main, sz1, off2, rw, obj);
- else if (off == 2)
- access2<2>(main, sz1, off2, rw, obj);
- else if (off == 3)
- access2<3>(main, sz1, off2, rw, obj);
- else if (off == 4)
- access2<4>(main, sz1, off2, rw, obj);
- else if (off == 5)
- access2<5>(main, sz1, off2, rw, obj);
- else if (off == 6)
- access2<6>(main, sz1, off2, rw, obj);
- else if (off == 7)
- access2<7>(main, sz1, off2, rw, obj);
-}
-
-NOINLINE void Test(bool main) {
- volatile uint64_t *obj = objs[0];
- for (int off = 0; off < 8; off++) {
- for (int sz1 = 0; sz1 < 3; sz1++) {
- for (int off2 = 0; off2 < accesssize(sz1); off2++) {
- for (int rw = 0; rw < 2; rw++) {
- // printf("thr=%d off=%d sz1=%d off2=%d rw=%d p=%p\n",
- // main, off, sz1, off2, rw, obj);
- access1(main, off, sz1, off2, rw, (char*)obj);
- obj += 2;
- }
- }
- }
- }
-}
-
-void *Thread(void *p) {
- (void)p;
- barrier_wait(&barrier);
- Test(false);
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t th;
- pthread_create(&th, 0, Thread, 0);
- Test(true);
- barrier_wait(&barrier);
- pthread_join(th, 0);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: ThreadSanitizer: reported 224 warnings
Copied: compiler-rt/trunk/test/tsan/unaligned_race.cpp (from r367653, compiler-rt/trunk/test/tsan/unaligned_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/unaligned_race.cpp?p2=compiler-rt/trunk/test/tsan/unaligned_race.cpp&p1=compiler-rt/trunk/test/tsan/unaligned_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/vfork.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/vfork.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/vfork.cc (original)
+++ compiler-rt/trunk/test/tsan/vfork.cc (removed)
@@ -1,51 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-
-int fds[2];
-int X;
-
-void *Thread1(void *x) {
- X = 42;
- write(fds[1], "a", 1);
- return NULL;
-}
-
-void *Thread2(void *x) {
- char buf;
- while (read(fds[0], &buf, 1) != 1) {
- }
- X = 43;
- return NULL;
-}
-
-int main() {
- pipe(fds);
- int pid = vfork();
- if (pid < 0) {
- fprintf(stderr, "FAIL to vfork\n");
- exit(1);
- }
- if (pid == 0) { // child
- // Closing of fds must not affect parent process.
- // Strictly saying this is undefined behavior, because vfork child is not
- // allowed to call any functions other than exec/exit. But this is what
- // openjdk does.
- close(fds[0]);
- close(fds[1]);
- _exit(0);
- }
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- fprintf(stderr, "DONE\n");
-}
-
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
-// CHECK-NOT: FAIL to vfork
-// CHECK: DONE
Copied: compiler-rt/trunk/test/tsan/vfork.cpp (from r367653, compiler-rt/trunk/test/tsan/vfork.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/vfork.cpp?p2=compiler-rt/trunk/test/tsan/vfork.cpp&p1=compiler-rt/trunk/test/tsan/vfork.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: 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=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/virtual_inheritance_compile_bug.cc (original)
+++ compiler-rt/trunk/test/tsan/virtual_inheritance_compile_bug.cc (removed)
@@ -1,15 +0,0 @@
-// Regression test for https://github.com/google/sanitizers/issues/410.
-// The C++ variant is much more compact that the LLVM IR equivalent.
-
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <stdio.h>
-struct AAA { virtual long aaa () { return 0; } }; // NOLINT
-struct BBB: virtual AAA { unsigned long bbb; }; // NOLINT
-struct CCC: virtual AAA { };
-struct DDD: CCC, BBB { DDD(); }; // NOLINT
-DDD::DDD() { }
-int main() {
- DDD d;
- fprintf(stderr, "OK\n");
-}
-// CHECK: OK
Copied: compiler-rt/trunk/test/tsan/virtual_inheritance_compile_bug.cpp (from r367653, 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.cpp?p2=compiler-rt/trunk/test/tsan/virtual_inheritance_compile_bug.cpp&p1=compiler-rt/trunk/test/tsan/virtual_inheritance_compile_bug.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/vptr_benign_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/vptr_benign_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/vptr_benign_race.cc (original)
+++ compiler-rt/trunk/test/tsan/vptr_benign_race.cc (removed)
@@ -1,59 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdio.h>
-
-struct A {
- A() {
- pthread_mutex_init(&m, 0);
- pthread_cond_init(&c, 0);
- signaled = false;
- }
- virtual void F() {
- }
- void Done() {
- pthread_mutex_lock(&m);
- signaled = true;
- pthread_cond_signal(&c);
- pthread_mutex_unlock(&m);
- }
- virtual ~A() {
- }
- pthread_mutex_t m;
- pthread_cond_t c;
- bool signaled;
-};
-
-struct B : A {
- virtual void F() {
- }
- virtual ~B() {
- pthread_mutex_lock(&m);
- while (!signaled)
- pthread_cond_wait(&c, &m);
- pthread_mutex_unlock(&m);
- }
-};
-
-static A *obj = new B;
-
-void *Thread1(void *x) {
- obj->F();
- obj->Done();
- return NULL;
-}
-
-void *Thread2(void *x) {
- delete obj;
- return NULL;
-}
-
-int main() {
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- fprintf(stderr, "PASS\n");
-}
-// CHECK: PASS
-// CHECK-NOT: WARNING: ThreadSanitizer: data race
Copied: compiler-rt/trunk/test/tsan/vptr_benign_race.cpp (from r367653, compiler-rt/trunk/test/tsan/vptr_benign_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/vptr_benign_race.cpp?p2=compiler-rt/trunk/test/tsan/vptr_benign_race.cpp&p1=compiler-rt/trunk/test/tsan/vptr_benign_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/vptr_harmful_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/vptr_harmful_race.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/vptr_harmful_race.cc (original)
+++ compiler-rt/trunk/test/tsan/vptr_harmful_race.cc (removed)
@@ -1,51 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-#include <semaphore.h>
-
-struct A {
- A() {
- sem_init(&sem_, 0, 0);
- }
- virtual void F() {
- }
- void Done() {
- sem_post(&sem_);
- }
- virtual ~A() {
- sem_wait(&sem_);
- sem_destroy(&sem_);
- }
- sem_t sem_;
-};
-
-struct B : A {
- virtual void F() {
- }
- virtual ~B() { }
-};
-
-static A *obj = new B;
-
-void *Thread1(void *x) {
- obj->F();
- obj->Done();
- barrier_wait(&barrier);
- return NULL;
-}
-
-void *Thread2(void *x) {
- barrier_wait(&barrier);
- delete obj;
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race on vptr
Copied: compiler-rt/trunk/test/tsan/vptr_harmful_race.cpp (from r367653, compiler-rt/trunk/test/tsan/vptr_harmful_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/vptr_harmful_race.cpp?p2=compiler-rt/trunk/test/tsan/vptr_harmful_race.cpp&p1=compiler-rt/trunk/test/tsan/vptr_harmful_race.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/vptr_harmful_race2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/vptr_harmful_race2.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/vptr_harmful_race2.cc (original)
+++ compiler-rt/trunk/test/tsan/vptr_harmful_race2.cc (removed)
@@ -1,51 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-#include <semaphore.h>
-
-struct A {
- A() {
- sem_init(&sem_, 0, 0);
- }
- virtual void F() {
- }
- void Done() {
- sem_post(&sem_);
- }
- virtual ~A() {
- sem_wait(&sem_);
- sem_destroy(&sem_);
- }
- sem_t sem_;
-};
-
-struct B : A {
- virtual void F() {
- }
- virtual ~B() { }
-};
-
-static A *obj = new B;
-
-void *Thread1(void *x) {
- obj->F();
- barrier_wait(&barrier);
- obj->Done();
- return NULL;
-}
-
-void *Thread2(void *x) {
- barrier_wait(&barrier);
- delete obj;
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race on vptr
Copied: compiler-rt/trunk/test/tsan/vptr_harmful_race2.cpp (from r367653, compiler-rt/trunk/test/tsan/vptr_harmful_race2.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/vptr_harmful_race2.cpp?p2=compiler-rt/trunk/test/tsan/vptr_harmful_race2.cpp&p1=compiler-rt/trunk/test/tsan/vptr_harmful_race2.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/vptr_harmful_race3.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/vptr_harmful_race3.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/vptr_harmful_race3.cc (original)
+++ compiler-rt/trunk/test/tsan/vptr_harmful_race3.cc (removed)
@@ -1,53 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-#include <semaphore.h>
-
-struct A {
- A() {
- sem_init(&sem_, 0, 0);
- }
- virtual void F() {
- }
- void Done() {
- sem_post(&sem_);
- }
- virtual ~A() {
- sem_wait(&sem_);
- sem_destroy(&sem_);
- }
- sem_t sem_;
-};
-
-struct B : A {
- virtual void F() {
- }
- virtual ~B() { }
-};
-
-static A *obj = new B;
-static void (A::*fn)() = &A::F;
-
-void *Thread1(void *x) {
- (obj->*fn)();
- barrier_wait(&barrier);
- obj->Done();
- return NULL;
-}
-
-void *Thread2(void *x) {
- barrier_wait(&barrier);
- delete obj;
- return NULL;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race on vptr
-
Copied: compiler-rt/trunk/test/tsan/vptr_harmful_race3.cpp (from r367653, compiler-rt/trunk/test/tsan/vptr_harmful_race3.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/vptr_harmful_race3.cpp?p2=compiler-rt/trunk/test/tsan/vptr_harmful_race3.cpp&p1=compiler-rt/trunk/test/tsan/vptr_harmful_race3.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/vptr_harmful_race4.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/vptr_harmful_race4.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/vptr_harmful_race4.cc (original)
+++ compiler-rt/trunk/test/tsan/vptr_harmful_race4.cc (removed)
@@ -1,34 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-struct A {
- virtual void F() {
- }
-
- virtual ~A() {
- }
-};
-
-struct B : A {
- virtual void F() {
- }
-};
-
-void *Thread(void *x) {
- barrier_wait(&barrier);
- ((A*)x)->F();
- return 0;
-}
-
-int main() {
- barrier_init(&barrier, 2);
- A *obj = new B;
- pthread_t t;
- pthread_create(&t, 0, Thread, obj);
- delete obj;
- barrier_wait(&barrier);
- pthread_join(t, 0);
-}
-
-// CHECK: WARNING: ThreadSanitizer: heap-use-after-free (virtual call vs free)
-
Copied: compiler-rt/trunk/test/tsan/vptr_harmful_race4.cpp (from r367653, compiler-rt/trunk/test/tsan/vptr_harmful_race4.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/vptr_harmful_race4.cpp?p2=compiler-rt/trunk/test/tsan/vptr_harmful_race4.cpp&p1=compiler-rt/trunk/test/tsan/vptr_harmful_race4.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
(empty)
Removed: compiler-rt/trunk/test/tsan/write_in_reader_lock.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/write_in_reader_lock.cc?rev=367655&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/write_in_reader_lock.cc (original)
+++ compiler-rt/trunk/test/tsan/write_in_reader_lock.cc (removed)
@@ -1,36 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
-#include "test.h"
-
-pthread_rwlock_t rwlock;
-int GLOB;
-
-void *Thread1(void *p) {
- (void)p;
- pthread_rwlock_rdlock(&rwlock);
- barrier_wait(&barrier);
- // Write under reader lock.
- GLOB++;
- pthread_rwlock_unlock(&rwlock);
- return 0;
-}
-
-int main(int argc, char *argv[]) {
- barrier_init(&barrier, 2);
- pthread_rwlock_init(&rwlock, NULL);
- pthread_rwlock_rdlock(&rwlock);
- pthread_t t;
- pthread_create(&t, 0, Thread1, 0);
- volatile int x = GLOB;
- (void)x;
- pthread_rwlock_unlock(&rwlock);
- barrier_wait(&barrier);
- pthread_join(t, 0);
- pthread_rwlock_destroy(&rwlock);
- return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Write of size 4 at {{.*}} by thread T1{{.*}}:
-// CHECK: #0 Thread1(void*) {{.*}}write_in_reader_lock.cc:12
-// CHECK: Previous read of size 4 at {{.*}} by main thread{{.*}}:
-// CHECK: #0 main {{.*}}write_in_reader_lock.cc:23
Copied: compiler-rt/trunk/test/tsan/write_in_reader_lock.cpp (from r367653, compiler-rt/trunk/test/tsan/write_in_reader_lock.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/write_in_reader_lock.cpp?p2=compiler-rt/trunk/test/tsan/write_in_reader_lock.cpp&p1=compiler-rt/trunk/test/tsan/write_in_reader_lock.cc&r1=367653&r2=367656&rev=367656&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/write_in_reader_lock.cc (original)
+++ compiler-rt/trunk/test/tsan/write_in_reader_lock.cpp Fri Aug 2 00:18:07 2019
@@ -31,6 +31,6 @@ int main(int argc, char *argv[]) {
// CHECK: WARNING: ThreadSanitizer: data race
// CHECK: Write of size 4 at {{.*}} by thread T1{{.*}}:
-// CHECK: #0 Thread1(void*) {{.*}}write_in_reader_lock.cc:12
+// CHECK: #0 Thread1(void*) {{.*}}write_in_reader_lock.cpp:12
// CHECK: Previous read of size 4 at {{.*}} by main thread{{.*}}:
-// CHECK: #0 main {{.*}}write_in_reader_lock.cc:23
+// CHECK: #0 main {{.*}}write_in_reader_lock.cpp:23
More information about the llvm-commits
mailing list