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