1
2include $(top_srcdir)/Makefile.tool-tests.am
3
4dist_noinst_SCRIPTS =		    \
5	compare_error_count_with    \
6	filter_annotate_barrier_xml \
7	filter_error_count	    \
8	filter_error_summary	    \
9	filter_stderr               \
10	filter_stderr_and_thread_no \
11	filter_stderr_and_thread_no_and_offset \
12	filter_thread_no	    \
13	filter_xml_and_thread_no    \
14	run_openmp_test             \
15	supported_libpthread	    \
16	supported_sem_init
17
18noinst_HEADERS =                                    \
19	tsan_thread_wrappers_pthread.h		    \
20	unified_annotations.h
21
22EXTRA_DIST =                                        \
23	annotate_barrier.stderr.exp		    \
24	annotate_barrier.vgtest			    \
25	annotate_barrier_xml.stderr.exp		    \
26	annotate_barrier_xml.vgtest		    \
27	annotate_hb_err.stderr.exp		    \
28	annotate_hb_err.vgtest			    \
29	annotate_hb_race.stderr.exp		    \
30	annotate_hb_race.vgtest			    \
31	annotate_hbefore.stderr.exp		    \
32	annotate_hbefore.vgtest			    \
33	annotate_order_1.stderr.exp		    \
34	annotate_order_1.vgtest			    \
35	annotate_order_2.stderr.exp		    \
36	annotate_order_2.vgtest			    \
37	annotate_order_3.stderr.exp		    \
38	annotate_order_3.vgtest			    \
39	annotate_publish_hg.stderr.exp		    \
40	annotate_publish_hg.vgtest		    \
41	annotate_smart_pointer.stderr.exp	    \
42	annotate_smart_pointer.vgtest		    \
43	annotate_smart_pointer2.stderr.exp	    \
44	annotate_smart_pointer2.stderr.exp-darwin   \
45	annotate_smart_pointer2.vgtest		    \
46	annotate_spinlock.stderr.exp		    \
47	annotate_spinlock.vgtest		    \
48	annotate_rwlock.stderr.exp		    \
49	annotate_rwlock.vgtest			    \
50	annotate_rwlock_hg.stderr.exp		    \
51	annotate_rwlock_hg.vgtest		    \
52	annotate_ignore_read.stderr.exp		    \
53	annotate_ignore_read.vgtest		    \
54	annotate_ignore_rw.stderr.exp		    \
55	annotate_ignore_rw.vgtest		    \
56	annotate_ignore_rw2.stderr.exp		    \
57	annotate_ignore_rw2.vgtest		    \
58	annotate_ignore_write.stderr.exp	    \
59	annotate_ignore_write.vgtest		    \
60	annotate_ignore_write2.stderr.exp	    \
61	annotate_ignore_write2.vgtest		    \
62	annotate_trace_memory.stderr.exp-32bit	    \
63	annotate_trace_memory.stderr.exp-64bit	    \
64	annotate_trace_memory.stderr.exp-mips32	   \
65	annotate_trace_memory.vgtest		    \
66	annotate_trace_memory_xml.stderr.exp-32bit  \
67	annotate_trace_memory_xml.stderr.exp-64bit  \
68	annotate_trace_memory_xml.stderr.exp-mips32 \
69	annotate_trace_memory_xml.vgtest	    \
70	annotate_sem.stderr.exp                     \
71	annotate_sem.vgtest                         \
72	annotate_static.stderr.exp	            \
73	annotate_static.vgtest		            \
74	atomic_var.stderr.exp			    \
75	atomic_var.vgtest			    \
76	bar_bad.stderr.exp			    \
77	bar_bad.vgtest				    \
78	bar_bad_xml.stderr.exp			    \
79	bar_bad_xml.vgtest			    \
80	bar_trivial.stderr.exp			    \
81	bar_trivial.stdout.exp			    \
82	bar_trivial.vgtest			    \
83	boost_thread.stderr.exp			    \
84	boost_thread.vgtest			    \
85	bug-235681.stderr.exp			    \
86	bug-235681.vgtest			    \
87	circular_buffer.stderr.exp		    \
88	circular_buffer.vgtest			    \
89	concurrent_close.stderr.exp		    \
90	concurrent_close.vgtest			    \
91	custom_alloc.stderr.exp			    \
92	custom_alloc.vgtest			    \
93	custom_alloc_fiw.stderr.exp		    \
94	custom_alloc_fiw.vgtest			    \
95	fp_race.stderr.exp                          \
96	fp_race.stderr.exp-mips32-be                \
97	fp_race.stderr.exp-mips32-le                \
98	fp_race.vgtest                              \
99	fp_race2.stderr.exp                         \
100	fp_race2.vgtest                             \
101	fp_race_xml.stderr.exp                      \
102	fp_race_xml.stderr.exp-mips32-be            \
103	fp_race_xml.stderr.exp-mips32-le            \
104	fp_race_xml.vgtest                          \
105	free_is_write.stderr.exp		    \
106	free_is_write.vgtest			    \
107	free_is_write2.stderr.exp		    \
108	free_is_write2.vgtest			    \
109	hg01_all_ok.stderr.exp                      \
110	hg01_all_ok.vgtest                          \
111	hg02_deadlock.stderr.exp                    \
112	hg02_deadlock.vgtest                        \
113	hg03_inherit.stderr.exp                     \
114	hg03_inherit.vgtest                         \
115	hg04_race.stderr.exp                        \
116	hg04_race.vgtest                            \
117	hg05_race2.stderr.exp                       \
118	hg05_race2.stderr.exp-powerpc               \
119	hg05_race2.vgtest                           \
120	hg06_readshared.stderr.exp                  \
121	hg06_readshared.vgtest                      \
122	hold_lock_1.stderr.exp                      \
123	hold_lock_1.vgtest                          \
124	hold_lock_2.stderr.exp                      \
125	hold_lock_2.vgtest                          \
126	linuxthreads_det.stderr.exp                 \
127	linuxthreads_det.stderr.exp-linuxthreads    \
128	linuxthreads_det.stdout.exp                 \
129	linuxthreads_det.stdout.exp-linuxthreads    \
130	linuxthreads_det.vgtest                     \
131	local_static.stderr.exp                     \
132	local_static.vgtest                         \
133	matinv.stderr.exp                           \
134	matinv.stdout.exp                           \
135	matinv.vgtest                               \
136	memory_allocation.stderr.exp		    \
137	memory_allocation.vgtest		    \
138	monitor_example.stderr.exp		    \
139	monitor_example.vgtest			    \
140	new_delete.stderr.exp                       \
141	new_delete.vgtest                           \
142	omp_matinv.stderr.exp                       \
143	omp_matinv.stdout.exp                       \
144	omp_matinv.vgtest                           \
145	omp_matinv_racy.stderr.exp                  \
146	omp_matinv_racy.stdout.exp                  \
147	omp_matinv_racy.vgtest                      \
148	omp_prime_racy.stderr.exp                   \
149	omp_prime_racy.vgtest                       \
150	omp_printf.stderr.exp                       \
151	omp_printf.vgtest                           \
152	pth_barrier.stderr.exp                      \
153	pth_barrier.vgtest                          \
154	pth_barrier2.stderr.exp                     \
155	pth_barrier2.vgtest                         \
156	pth_barrier3.stderr.exp                     \
157	pth_barrier3.vgtest                         \
158	pth_barrier_race.stderr.exp                 \
159	pth_barrier_race.vgtest                     \
160	pth_barrier_reinit.stderr.exp               \
161	pth_barrier_reinit.vgtest                   \
162	pth_barrier_thr_cr.stderr.exp               \
163	pth_barrier_thr_cr.vgtest                   \
164	pth_barrier_thr_cr.supp                     \
165	pth_broadcast.stderr.exp                    \
166	pth_broadcast.vgtest                        \
167	pth_cancel_locked.stderr.exp		    \
168	pth_cancel_locked.stderr.exp-darwin	    \
169	pth_cancel_locked.vgtest		    \
170	pth_cleanup_handler.stderr.exp		    \
171	pth_cleanup_handler.vgtest		    \
172	pth_cond_destroy_busy.stderr.exp            \
173	pth_cond_destroy_busy.vgtest                \
174	pth_cond_race.stderr.exp                    \
175	pth_cond_race.vgtest                        \
176	pth_cond_race2.stderr.exp                   \
177	pth_cond_race2.vgtest                       \
178	pth_cond_race3.stderr.exp                   \
179	pth_cond_race3.vgtest                       \
180	pth_create_chain.stderr.exp                 \
181	pth_create_chain.vgtest                     \
182	pth_create_glibc_2_0.stderr.exp             \
183	pth_create_glibc_2_0.vgtest                 \
184	pth_detached.stderr.exp                     \
185	pth_detached.stdout.exp                     \
186	pth_detached.vgtest                         \
187	pth_detached2.stderr.exp                    \
188	pth_detached2.stdout.exp                    \
189	pth_detached2.vgtest                        \
190	pth_detached3.stderr.exp1                   \
191	pth_detached3.stderr.exp2                   \
192	pth_detached3.vgtest                        \
193	pth_detached_sem.stderr.exp                 \
194	pth_detached_sem.stdout.exp                 \
195	pth_detached_sem.vgtest                     \
196	pth_inconsistent_cond_wait.stderr.exp1      \
197	pth_inconsistent_cond_wait.stderr.exp2      \
198	pth_inconsistent_cond_wait.vgtest           \
199	pth_mutex_reinit.stderr.exp		    \
200	pth_mutex_reinit.vgtest			    \
201	pth_once.stderr.exp			    \
202	pth_once.vgtest				    \
203	pth_process_shared_mutex.stderr.exp         \
204	pth_process_shared_mutex.vgtest             \
205	pth_spinlock.stderr.exp                     \
206	pth_spinlock.vgtest                         \
207	pth_uninitialized_cond.stderr.exp           \
208	pth_uninitialized_cond.vgtest               \
209	read_and_free_race.stderr.exp		    \
210	read_and_free_race.vgtest		    \
211	recursive_mutex.stderr.exp-linux            \
212	recursive_mutex.stderr.exp-darwin           \
213	recursive_mutex.vgtest                      \
214	rwlock_race.stderr.exp	                    \
215	rwlock_race.stderr.exp2	                    \
216	rwlock_race.vgtest                          \
217	rwlock_test.stderr.exp	                    \
218	rwlock_test.vgtest                          \
219	rwlock_type_checking.stderr.exp	            \
220	rwlock_type_checking.vgtest                 \
221	sem_as_mutex.stderr.exp                     \
222	sem_as_mutex.stderr.exp-mips32-be           \
223	sem_as_mutex.stderr.exp-mips32-le           \
224	sem_as_mutex.vgtest                         \
225	sem_as_mutex2.stderr.exp                    \
226	sem_as_mutex2.vgtest                        \
227	sem_as_mutex3.stderr.exp                    \
228	sem_as_mutex3.stderr.exp-mips32-be          \
229	sem_as_mutex3.stderr.exp-mips32-le          \
230	sem_as_mutex3.vgtest                        \
231	sem_open.stderr.exp                         \
232	sem_open.stderr.exp-mips32-be               \
233	sem_open.stderr.exp-mips32-le               \
234	sem_open.vgtest                             \
235	sem_open2.stderr.exp                        \
236	sem_open2.vgtest                            \
237	sem_open3.stderr.exp                        \
238	sem_open3.stderr.exp-mips32-be              \
239	sem_open3.stderr.exp-mips32-le              \
240	sem_open3.vgtest                            \
241	sem_open_traced.stderr.exp                  \
242	sem_open_traced.vgtest                      \
243	sem_wait.stderr.exp                         \
244	sem_wait.vgtest                             \
245	sigalrm.stderr.exp                          \
246	sigalrm.vgtest                              \
247	sigaltstack.stderr.exp                      \
248	sigaltstack.vgtest                          \
249	std_atomic.stderr.exp		  	    \
250	std_atomic.vgtest			            \
251	std_list.stderr.exp		  	    \
252	std_list.vgtest			            \
253	std_string.stderr.exp		  	    \
254	std_string.vgtest			    \
255	std_thread.stderr.exp		  	    \
256	std_thread.vgtest			    \
257	std_thread2.stderr.exp		  	    \
258	std_thread2.vgtest			    \
259	std_thread2.supp			    \
260	str_tester.stderr.exp		  	    \
261	str_tester.vgtest			    \
262	tc01_simple_race.stderr.exp                 \
263	tc01_simple_race.vgtest                     \
264	tc02_simple_tls.stderr.exp                  \
265	tc02_simple_tls.vgtest                      \
266	tc03_re_excl.stderr.exp                     \
267	tc03_re_excl.vgtest                         \
268	tc04_free_lock.stderr.exp-x86               \
269	tc04_free_lock.stderr.exp-ppc               \
270	tc04_free_lock.stderr.exp-s390              \
271	tc04_free_lock.vgtest                       \
272	tc05_simple_race.stderr.exp                 \
273	tc05_simple_race.vgtest                     \
274	tc06_two_races.stderr.exp                   \
275	tc06_two_races.vgtest                       \
276	tc07_hbl1.stderr.exp                        \
277	tc07_hbl1.stdout.exp                        \
278	tc07_hbl1.vgtest                            \
279	tc08_hbl2.stderr.exp                        \
280	tc08_hbl2.stdout.exp                        \
281	tc08_hbl2.vgtest                            \
282	tc09_bad_unlock.stderr.exp-x86              \
283	tc09_bad_unlock.stderr.exp-ppc              \
284	tc09_bad_unlock.stderr.exp-glibc2.8         \
285	tc09_bad_unlock.stderr.exp-s390             \
286	tc09_bad_unlock.vgtest                      \
287	tc10_rec_lock.stderr.exp                    \
288	tc10_rec_lock.vgtest                        \
289	tc11_XCHG.stderr.exp tc11_XCHG.stdout.exp   \
290	tc11_XCHG.vgtest                            \
291	tc12_rwl_trivial.stderr.exp                 \
292	tc12_rwl_trivial.vgtest                     \
293	tc13_laog1.stderr.exp                       \
294	tc13_laog1.vgtest                           \
295	tc15_laog_lockdel.stderr.exp                \
296	tc15_laog_lockdel.vgtest                    \
297	tc16_byterace.stderr.exp                    \
298	tc16_byterace.vgtest                        \
299	tc17_sembar.stderr.exp                      \
300	tc17_sembar.vgtest                          \
301	tc18_semabuse.stderr.exp                    \
302	tc18_semabuse.vgtest                        \
303	tc19_shadowmem.stderr.exp-32bit             \
304	tc19_shadowmem.stderr.exp-64bit             \
305	tc19_shadowmem.vgtest                       \
306	tc21_pthonce.stderr.exp                     \
307	tc21_pthonce.stdout.exp                     \
308	tc21_pthonce.vgtest                         \
309	tc22_exit_w_lock.stderr.exp-32bit	    \
310	tc22_exit_w_lock.stderr.exp-64bit           \
311	tc22_exit_w_lock.vgtest                     \
312	tc23_bogus_condwait.stderr.exp-linux-x86    \
313	tc23_bogus_condwait.stderr.exp-linux-ppc    \
314	tc23_bogus_condwait.stderr.exp-darwin-x86   \
315	tc23_bogus_condwait.stderr.exp-darwin-amd64 \
316	tc23_bogus_condwait.vgtest                  \
317	tc24_nonzero_sem.stderr.exp                 \
318	tc24_nonzero_sem.vgtest                     \
319	thread_name.stderr.exp			    \
320	thread_name.vgtest			    \
321	thread_name_xml.stderr.exp		    \
322	thread_name_xml.vgtest			    \
323	threaded-fork.stderr.exp		    \
324	threaded-fork.vgtest			    \
325	threaded-fork-vcs.stderr.exp		    \
326	threaded-fork-vcs.vgtest		    \
327	tls_threads.stderr.exp			    \
328	tls_threads.vgtest			    \
329	trylock.stderr.exp                          \
330	trylock.vgtest				    \
331	unit_bitmap.stderr.exp                      \
332	unit_bitmap.vgtest                          \
333	unit_vc.stderr.exp                          \
334	unit_vc.vgtest
335
336
337check_PROGRAMS =      \
338  annotate_hb_err     \
339  annotate_hb_race    \
340  annotate_ignore_rw  \
341  annotate_ignore_write \
342  annotate_publish_hg \
343  annotate_static     \
344  annotate_trace_memory \
345  bug-235681          \
346  custom_alloc        \
347  concurrent_close    \
348  fp_race             \
349  free_is_write	      \
350  hold_lock           \
351  linuxthreads_det    \
352  local_static        \
353  memory_allocation   \
354  monitor_example     \
355  new_delete          \
356  pth_broadcast       \
357  pth_cancel_locked   \
358  pth_cleanup_handler \
359  pth_cond_destroy_busy \
360  pth_cond_race       \
361  pth_create_chain    \
362  pth_detached        \
363  pth_detached_sem    \
364  pth_detached3       \
365  pth_inconsistent_cond_wait \
366  pth_mutex_reinit    \
367  pth_process_shared_mutex   \
368  pth_uninitialized_cond \
369  recursive_mutex     \
370  rwlock_race         \
371  rwlock_test         \
372  rwlock_type_checking \
373  sem_as_mutex        \
374  sem_open            \
375  sigalrm             \
376  threaded-fork       \
377  trylock             \
378  unit_bitmap         \
379  unit_vc
380
381if HAVE_BOOST_1_35
382check_PROGRAMS += boost_thread
383endif
384
385if HAVE_BUILTIN_ATOMIC
386check_PROGRAMS +=        \
387  annotate_barrier       \
388  annotate_rwlock        \
389  annotate_sem           \
390  atomic_var             \
391  circular_buffer
392endif
393
394if HAVE_BUILTIN_ATOMIC_CXX
395check_PROGRAMS +=        \
396  annotate_smart_pointer \
397  tsan_unittest
398endif
399
400# clang 3.3 will generate errors about libstdc++ headers from
401# gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
402if CXX_CAN_INCLUDE_THREAD_HEADER
403if HAVE_SHARED_POINTER_ANNOTATION
404check_PROGRAMS += \
405  std_atomic      \
406  std_list        \
407  std_string      \
408  std_thread      \
409  std_thread2
410endif
411endif
412
413if HAVE_OPENMP
414check_PROGRAMS += omp_matinv omp_prime omp_printf
415endif
416
417if HAVE_PTHREAD_BARRIER
418check_PROGRAMS += matinv pth_barrier pth_barrier_race pth_barrier_reinit \
419	pth_barrier_thr_cr thread_name
420endif
421
422if HAVE_PTHREAD_CREATE_GLIBC_2_0
423check_PROGRAMS += pth_create_glibc_2_0
424endif
425
426if HAVE_PTHREAD_SPINLOCK
427check_PROGRAMS += pth_spinlock
428endif
429
430if !VGCONF_OS_IS_DARWIN
431check_PROGRAMS += sem_wait
432endif
433
434
435AM_CFLAGS   += $(AM_FLAG_M3264_PRI) @FLAG_W_EXTRA@ -Wno-inline -Wno-unused-parameter
436AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) @FLAG_W_EXTRA@ -Wno-inline -Wno-unused-parameter
437
438LDADD = -lpthread
439
440
441concurrent_close_SOURCES    = concurrent_close.cpp
442monitor_example_SOURCES     = monitor_example.cpp
443new_delete_SOURCES          = new_delete.cpp
444
445pth_cleanup_handler_CFLAGS  = $(AM_CFLAGS) @FLAG_W_NO_EMPTY_BODY@
446
447tsan_unittest_SOURCES       = tsan_unittest.cpp
448tsan_unittest_CXXFLAGS      = $(AM_CXXFLAGS) \
449			-DTHREAD_WRAPPERS='"tsan_thread_wrappers_pthread.h"'
450
451unit_bitmap_CFLAGS          = $(AM_CFLAGS) -O2 \
452                              -DENABLE_DRD_CONSISTENCY_CHECKS \
453                              @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
454unit_bitmap_LDADD           = # nothing, i.e. not -lpthread
455
456unit_vc_CFLAGS              = $(AM_CFLAGS) -DENABLE_DRD_CONSISTENCY_CHECKS
457unit_vc_LDADD               = # nothing, i.e. not -lpthread
458
459if HAVE_BOOST_1_35
460boost_thread_SOURCES        = boost_thread.cpp
461boost_thread_CXXFLAGS       = $(AM_CXXFLAGS) $(BOOST_CFLAGS)
462boost_thread_LDADD          = $(BOOST_LIBS)
463endif
464
465if HAVE_BUILTIN_ATOMIC
466annotate_smart_pointer_SOURCES = annotate_smart_pointer.cpp
467endif
468
469annotate_static_SOURCES     = annotate_static.cpp
470annotate_static_CXXFLAGS    = $(AM_CXXFLAGS) @FLAG_W_NO_UNUSED_FUNCTION@
471
472local_static_SOURCES        = local_static.cpp
473
474if HAVE_OPENMP
475omp_matinv_CFLAGS           = $(AM_CFLAGS) -fopenmp
476omp_matinv_LDFLAGS          = -fopenmp
477omp_matinv_LDADD            = $(LDADD) -lm
478
479omp_prime_CFLAGS            = $(AM_CFLAGS) -fopenmp
480omp_prime_LDFLAGS           = -fopenmp
481omp_prime_LDADD             = $(LDADD) -lm
482
483omp_printf_CFLAGS           = $(AM_CFLAGS) -fopenmp
484omp_printf_LDFLAGS          = -fopenmp
485omp_printf_LDADD            = $(LDADD) -lm
486endif
487
488if HAVE_PTHREAD_BARRIER
489matinv_LDADD                = $(LDADD) -lm
490endif
491
492std_atomic_SOURCES          = std_atomic.cpp
493std_atomic_CXXFLAGS         = $(AM_CXXFLAGS) -std=c++0x -Wno-sign-compare
494
495std_list_SOURCES            = std_list.cpp
496std_list_CXXFLAGS           = $(AM_CXXFLAGS) -std=c++0x -Wno-sign-compare
497
498std_string_SOURCES          = std_string.cpp
499std_string_CXXFLAGS         = $(AM_CXXFLAGS) -std=c++0x -Wno-sign-compare
500
501# Note: -Wl,--no-as-needed is a workaround for
502# https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1228201
503
504std_thread_SOURCES          = std_thread.cpp
505std_thread_CXXFLAGS         = $(AM_CXXFLAGS) -std=c++0x
506std_thread_LDFLAGS          = -Wl,--no-as-needed
507
508std_thread2_SOURCES          = std_thread2.cpp
509std_thread2_CXXFLAGS         = $(AM_CXXFLAGS) -std=c++0x
510std_thread2_LDFLAGS          = -Wl,--no-as-needed
511
512sem_wait_SOURCES            = sem_wait.cpp
513