regtest: remove compiler warnings with clang
[valgrind.git] / none / tests / Makefile.am
blobc0dd7c21dbf3ac9dc78a9c429a366f4f0e93a438
2 include $(top_srcdir)/Makefile.tool-tests.am
4 SUBDIRS = .
5 SUBDIRS += scripts
7 # Arch-specific tests.
8 if VGCONF_ARCHS_INCLUDE_X86
9 SUBDIRS += x86
10 endif
11 if VGCONF_ARCHS_INCLUDE_AMD64
12 SUBDIRS += amd64
13 endif
14 if VGCONF_ARCHS_INCLUDE_PPC32
15 SUBDIRS += ppc32
16 endif
17 if VGCONF_ARCHS_INCLUDE_PPC64
18 SUBDIRS += ppc64
19 endif
20 if VGCONF_ARCHS_INCLUDE_ARM
21 SUBDIRS += arm
22 endif
23 if VGCONF_ARCHS_INCLUDE_ARM64
24 SUBDIRS += arm64
25 endif
26 if VGCONF_ARCHS_INCLUDE_S390X
27 SUBDIRS += s390x
28 endif
29 if VGCONF_ARCHS_INCLUDE_MIPS32
30 SUBDIRS += mips32
31 endif
32 if VGCONF_ARCHS_INCLUDE_MIPS64
33 SUBDIRS += mips64
34 endif
35 if VGCONF_ARCHS_INCLUDE_NANOMIPS
36 SUBDIRS += nanomips
37 endif
40 # OS-specific tests
41 if VGCONF_OS_IS_LINUX
42 SUBDIRS += linux
43 endif
44 if VGCONF_OS_IS_DARWIN
45 SUBDIRS += darwin
46 endif
47 if VGCONF_OS_IS_SOLARIS
48 SUBDIRS += solaris
49 endif
50 if VGCONF_OS_IS_FREEBSD
51 SUBDIRS += freebsd
52 endif
54 # Platform-specific tests
55 if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX
56 SUBDIRS += amd64-linux
57 endif
58 if VGCONF_PLATFORMS_INCLUDE_X86_LINUX
59 SUBDIRS += x86-linux
60 endif
61 if VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN
62 SUBDIRS += amd64-darwin
63 endif
64 if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
65 SUBDIRS += x86-darwin
66 endif
67 if VGCONF_PLATFORMS_INCLUDE_AMD64_SOLARIS
68 SUBDIRS += amd64-solaris
69 endif
70 if VGCONF_PLATFORMS_INCLUDE_X86_SOLARIS
71 SUBDIRS += x86-solaris
72 endif
73 if VGCONF_PLATFORMS_INCLUDE_X86_FREEBSD
74 SUBDIRS += x86-freebsd
75 endif
77 DIST_SUBDIRS = x86 amd64 ppc32 ppc64 arm arm64 s390x mips32 mips64 nanomips \
78                linux darwin solaris freebsd amd64-linux x86-linux amd64-darwin \
79                x86-darwin amd64-solaris x86-solaris x86-freebsd scripts .
81 dist_noinst_SCRIPTS = \
82         filter_cmdline0 \
83         filter_cmdline1 \
84         filter_fdleak \
85         filter_ioctl_moans \
86         filter_none_discards \
87         filter_stderr \
88         filter_timestamp \
89         allexec_prepare_prereq
91 noinst_HEADERS = fdleak.h
93 EXTRA_DIST = \
94         allexec32.stdout.exp allexec32.stderr.exp allexec32.vgtest\
95         allexec64.stdout.exp allexec64.stderr.exp allexec64.vgtest\
96         ansi.stderr.exp ansi.vgtest \
97         args.stderr.exp args.stdout.exp args.vgtest \
98         async-sigs.stderr.exp async-sigs.stderr.exp-mips32 \
99         async-sigs.vgtest async-sigs.stderr.exp-freebsd \
100         bigcode.vgtest bigcode.stderr.exp bigcode.stdout.exp \
101         bitfield1.stderr.exp bitfield1.vgtest \
102         bug129866.vgtest bug129866.stderr.exp bug129866.stdout.exp \
103         bug234814.vgtest bug234814.stderr.exp bug234814.stdout.exp \
104         closeall.stderr.exp closeall.vgtest \
105         cmdline0.stderr.exp cmdline0.stdout.exp cmdline0.vgtest \
106         cmdline1.stderr.exp cmdline1.stdout.exp cmdline1.vgtest \
107                 cmdline1.stdout.exp-non-linux \
108         cmdline2.stderr.exp cmdline2.stdout.exp cmdline2.vgtest \
109                 cmdline2.stdout.exp-non-linux \
110         cmdline3.stderr.exp cmdline3.vgtest \
111         cmdline4.stderr.exp cmdline4.vgtest \
112         cmdline5.stderr.exp cmdline5.vgtest \
113         cmdline6.stderr.exp cmdline6.vgtest \
114         cmdline7.stderr.exp cmdline7.vgtest \
115         cmdline8.stderr.exp cmdline8.vgtest \
116         cmdline9.stderr.exp cmdline9.vgtest \
117         cmdline10.stderr.exp cmdline10.vgtest \
118         cmdline11.stderr.exp cmdline11.vgtest \
119         cmd-with-special.stderr.exp cmd-with-special.vgtest \
120         coolo_sigaction.stderr.exp \
121         coolo_sigaction.stdout.exp coolo_sigaction.vgtest \
122         coolo_strlen.stderr.exp coolo_strlen.vgtest \
123         discard.stderr.exp discard.stdout.exp \
124         discard.vgtest \
125         empty-exe.vgtest empty-exe.stderr.exp \
126         exec-sigmask.vgtest exec-sigmask.stdout.exp \
127         exec-sigmask.stdout.exp2 exec-sigmask.stdout.exp3 \
128         exec-sigmask.stdout.exp-solaris exec-sigmask.stderr.exp \
129         execve.vgtest execve.stdout.exp execve.stderr.exp \
130         faultstatus.vgtest faultstatus.stderr.exp faultstatus.stderr.exp-s390x \
131         fcntl_setown.vgtest fcntl_setown.stdout.exp fcntl_setown.stderr.exp \
132         fdleak_cmsg.stderr.exp fdleak_cmsg.vgtest \
133         fdleak_creat.stderr.exp fdleak_creat.vgtest \
134         fdleak_dup.stderr.exp fdleak_dup.vgtest \
135         fdleak_dup2.stderr.exp fdleak_dup2.vgtest \
136         fdleak_fcntl.stderr.exp fdleak_fcntl.vgtest \
137         fdleak_ipv4.stderr.exp fdleak_ipv4.stdout.exp fdleak_ipv4.vgtest \
138         fdleak_open.stderr.exp fdleak_open.vgtest \
139         fdleak_pipe.stderr.exp fdleak_pipe.vgtest \
140         fdleak_socketpair.stderr.exp fdleak_socketpair.vgtest \
141         floored.stderr.exp floored.stdout.exp floored.vgtest \
142         fork.stderr.exp fork.stdout.exp fork.vgtest \
143         fucomip.stderr.exp fucomip.vgtest \
144         gxx304.stderr.exp gxx304.vgtest \
145         ifunc.stderr.exp ifunc.stdout.exp ifunc.vgtest \
146         ioctl_moans.stderr.exp ioctl_moans.vgtest \
147         libvex_test.stderr.exp libvex_test.vgtest \
148         libvexmultiarch_test.stderr.exp libvexmultiarch_test.vgtest \
149         manythreads.stdout.exp manythreads.stderr.exp manythreads.vgtest \
150         map_unaligned.stderr.exp map_unaligned.vgtest \
151         map_unmap.stderr.exp map_unmap.stdout.exp map_unmap.vgtest \
152         mmap_fcntl_bug.vgtest mmap_fcntl_bug.stdout.exp \
153                 mmap_fcntl_bug.stderr.exp \
154         mq.stderr.exp mq.vgtest \
155         munmap_exe.stderr.exp munmap_exe.vgtest \
156         nestedfns.stderr.exp nestedfns.stdout.exp nestedfns.vgtest \
157         nocwd.stdout.exp nocwd.stderr.exp nocwd.vgtest \
158         nocwd.stderr.exp-freebsd \
159         nodir.stderr.exp nodir.vgtest \
160                 nodir.stderr.exp-freebsd \
161         pending.stdout.exp pending.stderr.exp pending.vgtest \
162         ppoll_alarm.stdout.exp ppoll_alarm.stderr.exp ppoll_alarm.vgtest \
163         procfs-linux.stderr.exp-with-readlinkat \
164         procfs-linux.stderr.exp-without-readlinkat \
165         procfs-linux.vgtest \
166         procfs-non-linux.vgtest \
167         procfs-non-linux.stderr.exp-with-readlinkat \
168         procfs-non-linux.stderr.exp-without-readlinkat \
169         pselect_alarm.stdout.exp pselect_alarm.stderr.exp pselect_alarm.vgtest \
170         pselect_sigmask_null.vgtest \
171         pselect_sigmask_null.stdout.exp pselect_sigmask_null.stderr.exp \
172         pth_atfork1.stderr.exp pth_atfork1.stdout.exp pth_atfork1.vgtest \
173         pth_blockedsig.stderr.exp \
174         pth_blockedsig.stdout.exp pth_blockedsig.vgtest \
175         pth_cancel1.stderr.exp pth_cancel1.stdout.exp pth_cancel1.vgtest \
176         pth_cancel2.stderr.exp pth_cancel2.vgtest \
177         pth_cvsimple.stderr.exp pth_cvsimple.stdout.exp pth_cvsimple.vgtest \
178         pth_empty.stderr.exp pth_empty.vgtest \
179         pth_exit.stderr.exp pth_exit.vgtest \
180         pth_exit2.stderr.exp pth_exit2.vgtest \
181         pth_mutexspeed.stderr.exp \
182         pth_mutexspeed.stdout.exp pth_mutexspeed.vgtest \
183         pth_once.stderr.exp pth_once.stdout.exp pth_once.vgtest \
184         pth_rwlock.stderr.exp pth_rwlock.vgtest \
185         pth_self_kill_9.stderr.exp pth_self_kill_9.vgtest \
186         pth_self_kill_15_other.stderr.exp pth_self_kill_15_other.vgtest \
187         pth_stackalign.stderr.exp \
188         pth_stackalign.stdout.exp pth_stackalign.vgtest \
189         pth_2sig.stderr.exp-linux pth_2sig.stderr.exp-solaris pth_2sig.vgtest \
190         pth_term_signal.stderr.exp pth_term_signal.vgtest \
191         rcrl.stderr.exp rcrl.stdout.exp rcrl.vgtest \
192         readline1.stderr.exp readline1.stdout.exp \
193         readline1.vgtest \
194         require-text-symbol-1.vgtest \
195                 require-text-symbol-1.stderr.exp \
196         require-text-symbol-2.vgtest \
197                 require-text-symbol-2.stderr.exp-libcso1 \
198                 require-text-symbol-2.stderr.exp-libcso6 \
199                 require-text-symbol-2.stderr.exp-freebsd \
200         res_search.stderr.exp res_search.stdout.exp res_search.vgtest \
201         resolv.stderr.exp resolv.stdout.exp resolv.vgtest \
202         rlimit_nofile.stderr.exp rlimit_nofile.stdout.exp rlimit_nofile.vgtest \
203         rlimit64_nofile.stderr.exp rlimit64_nofile.stdout.exp rlimit64_nofile.vgtest \
204         selfrun.stderr.exp selfrun.stdout.exp selfrun.vgtest \
205         sem.stderr.exp sem.stdout.exp sem.vgtest \
206         semlimit.stderr.exp semlimit.stdout.exp semlimit.vgtest \
207         sha1_test.stderr.exp sha1_test.vgtest \
208         shortpush.stderr.exp shortpush.vgtest \
209         shorts.stderr.exp shorts.vgtest \
210         sigstackgrowth.stdout.exp sigstackgrowth.stderr.exp sigstackgrowth.vgtest \
211         sigsusp.stderr.exp sigsusp.vgtest \
212         stackgrowth.stdout.exp stackgrowth.stderr.exp stackgrowth.vgtest \
213         syscall-restart1.vgtest syscall-restart1.stdout.exp syscall-restart1.stderr.exp \
214         syscall-restart2.vgtest syscall-restart2.stdout.exp syscall-restart2.stderr.exp \
215         syslog.vgtest syslog.stderr.exp \
216         system.stderr.exp system.vgtest \
217         thread-exits.stderr.exp thread-exits.stdout.exp thread-exits.vgtest \
218         threaded-fork.stderr.exp threaded-fork.stdout.exp threaded-fork.vgtest \
219         threadederrno.stderr.exp threadederrno.stdout.exp \
220         threadederrno.vgtest \
221         timestamp.stderr.exp timestamp.vgtest \
222         tls.vgtest tls.stderr.exp tls.stdout.exp  \
223         unit_debuglog.stderr.exp unit_debuglog.vgtest \
224         vgprintf.stderr.exp vgprintf.vgtest \
225         vgprintf_nvalgrind.stderr.exp vgprintf_nvalgrind.vgtest \
226         process_vm_readv_writev.stderr.exp process_vm_readv_writev.vgtest \
227         sigprocmask.stderr.exp sigprocmask.vgtest
230 check_PROGRAMS = \
231         args \
232         async-sigs \
233         bitfield1 \
234         bug129866 bug234814 \
235         closeall coolo_strlen \
236         discard exec-sigmask execve faultstatus fcntl_setown \
237         fdleak_cmsg fdleak_creat fdleak_dup fdleak_dup2 \
238         fdleak_fcntl fdleak_ipv4 fdleak_open fdleak_pipe \
239         fdleak_socketpair \
240         floored fork fucomip \
241         ioctl_moans \
242         libvex_test \
243         libvexmultiarch_test \
244         manythreads \
245         mmap_fcntl_bug \
246         munmap_exe map_unaligned map_unmap mq \
247         nocwd \
248         pending \
249         procfs-cmdline-exe \
250         pselect_alarm \
251         pselect_sigmask_null \
252         pth_atfork1 pth_blockedsig pth_cancel1 pth_cancel2 pth_cvsimple \
253         pth_empty pth_exit pth_exit2 pth_mutexspeed pth_once pth_rwlock \
254         pth_self_kill pth_stackalign pth_2sig pth_term_signal\
255         rcrl readline1 \
256         require-text-symbol \
257         res_search resolv \
258         rlimit_nofile selfrun sem semlimit sha1_test \
259         shortpush shorts stackgrowth sigstackgrowth sigsusp \
260         syscall-restart1 syscall-restart2 \
261         syslog \
262         system \
263         thread-exits \
264         threaded-fork \
265         threadederrno \
266         timestamp \
267         tls \
268         tls.so \
269         tls2.so \
270         unit_debuglog \
271         valgrind_cpp_test \
272         vgprintf \
273         vgprintf_nvalgrind \
274         coolo_sigaction \
275         gxx304 \
276         process_vm_readv_writev \
277         sigprocmask
279 if HAVE_NESTED_FUNCTIONS
280    check_PROGRAMS += nestedfns
281 endif
283 # This doesn't appear to be compilable on Darwin.
284 if ! VGCONF_OS_IS_DARWIN_OR_FREEBSD
285    check_PROGRAMS += rlimit64_nofile
286 endif
288 if ! VGCONF_OS_IS_DARWIN
289    check_PROGRAMS += ppoll_alarm
290 endif
292 # older (?) clang does not know -ansi
293 if HAVE_ANSI
294    check_PROGRAMS += ansi
295 endif
297 if BUILD_IFUNC_TESTS
298    check_PROGRAMS += ifunc
299 endif
301 AM_CFLAGS   += $(AM_FLAG_M3264_PRI)
302 AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
304 # Extra stuff for C tests
305 ansi_CFLAGS             = $(AM_CFLAGS) -ansi
306 execve_CFLAGS           = $(AM_CFLAGS) @FLAG_W_NO_NONNULL@
307 if VGCONF_OS_IS_SOLARIS
308 fcntl_setown_LDADD      = -lsocket -lnsl
309 fdleak_cmsg_CFLAGS      = $(AM_CFLAGS) -D_XOPEN_SOURCE=600
310 fdleak_cmsg_LDADD       = -lsocket -lnsl
311 fdleak_ipv4_LDADD       = -lsocket -lnsl
312 fdleak_creat_LDADD      = -lsocket -lnsl
313 fdleak_socketpair_LDADD = -lsocket -lnsl
314 endif
315 floored_LDADD           = -lm
316 ifunc_CFLAGS            = $(AM_CFLAGS) -Wno-unused-function
317 manythreads_LDADD       = -lpthread
318 if VGCONF_OS_IS_DARWIN
319  nestedfns_CFLAGS       = $(AM_CFLAGS) -fnested-functions
320 else
321  nestedfns_CFLAGS       = $(AM_CFLAGS)
322  mq_LDADD               = -lrt
323 endif
324 libvex_test_CFLAGS      = $(AM_CFLAGS) @FLAG_FSANITIZE@
325 libvex_test_LDADD       = ../../VEX/libvex-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a \
326                            @LIB_UBSAN@
327 libvexmultiarch_test_CFLAGS= $(AM_CFLAGS) @FLAG_FSANITIZE@
328 libvexmultiarch_test_LDADD = \
329         ../../VEX/libvexmultiarch-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a \
330         ../../VEX/libvex-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a @LIB_UBSAN@
331 libvexmultiarch_test_SOURCES = libvex_test.c
332 ppoll_alarm_LDADD       = -lpthread
333 pselect_alarm_LDADD     = -lpthread
334 pth_atfork1_LDADD       = -lpthread
335 pth_blockedsig_LDADD    = -lpthread
336 pth_cancel1_CFLAGS      = $(AM_CFLAGS) -Wno-shadow
337 pth_cancel1_LDADD       = -lpthread
338 pth_cancel2_LDADD       = -lpthread
339 pth_cvsimple_LDADD      = -lpthread
340 pth_empty_LDADD         = -lpthread
341 pth_exit_LDADD          = -lpthread
342 pth_exit2_LDADD         = -lpthread
343 pth_mutexspeed_LDADD    = -lpthread
344 pth_once_LDADD          = -lpthread
345 pth_rwlock_LDADD        = -lpthread
346 pth_rwlock_CFLAGS       = $(AM_CFLAGS)
347 pth_self_kill_LDADD     = -lpthread
348 pth_stackalign_LDADD    = -lpthread
349 pth_2sig_LDADD          = -lpthread
350 pth_term_signal_LDADD   = -lpthread
351 if VGCONF_OS_IS_FREEBSD
352    res_search_LDADD      = -lpthread
353    resolv_LDADD             = -lpthread
354 else
355    res_search_LDADD      = -lresolv -lpthread
356    resolv_LDADD             = -lresolv -lpthread
357 endif
358 resolv_CFLAGS           = $(AM_CFLAGS)
359 if VGCONF_OS_IS_SOLARIS
360 resolv_CFLAGS           += -U_REENTRANT
361 endif
362 semlimit_LDADD          = -lpthread
363 sha1_test_CFLAGS        = $(AM_CFLAGS)
364 if VGCONF_OS_IS_SOLARIS
365 sha1_test_CFLAGS        += -Du_int32_t=uint32_t
366 endif
367 sigsusp_LDADD           = -lpthread
368 thread_exits_LDADD      = -lpthread
369 threaded_fork_LDADD     = -lpthread
370 threadederrno_CFLAGS    = $(AM_CFLAGS)
371 threadederrno_LDADD     = -lpthread
372 timestamp_CFLAGS        = @FLAG_W_NO_USE_AFTER_FREE@
373 tls_SOURCES             = tls.c tls2.c
374 tls_DEPENDENCIES        = tls.so tls2.so
375 tls_LDFLAGS             = -Wl,-rpath,$(abs_top_builddir)/none/tests
376 tls_LDADD               = tls.so tls2.so -lpthread
377 tls_so_SOURCES          = tls_so.c
378 tls_so_DEPENDENCIES     = tls2.so
379 if VGCONF_OS_IS_DARWIN
380  tls_so_LDFLAGS         = -dynamic -dynamiclib -all_load -fpic
381  tls_so_LDADD           = `pwd`/tls2.so
382 else
383  tls_so_LDFLAGS         = -Wl,-rpath,$(abs_top_builddir)/none/tests -shared -fPIC
384  tls_so_LDADD           = tls2.so
385 endif
386 tls_so_CFLAGS           = $(AM_CFLAGS) -fPIC
387 tls2_so_SOURCES         = tls2_so.c
388 if VGCONF_OS_IS_DARWIN
389  tls2_so_LDFLAGS        = -dynamic -dynamiclib -all_load
390 else
391  tls2_so_LDFLAGS        = -shared
392 endif
394 vgprintf_nvalgrind_SOURCES = vgprintf.c
395 vgprintf_nvalgrind_CFLAGS = ${AM_CFLAGS} -DNVALGRIND
397 valgrind_cpp_test_SOURCES = valgrind_cpp_test.cpp
398 valgrind_cpp_test_LDADD   = -lstdc++
400 # C++ tests
401 coolo_sigaction_SOURCES = coolo_sigaction.cpp
402 gxx304_SOURCES          = gxx304.cpp