try a new github issue template
[pcsx_rearmed.git] / deps / lightning / check / Makefile.am
CommitLineData
4a71579b 1#
79bfeef6 2# Copyright 2012-2023 Free Software Foundation, Inc.
4a71579b
PC
3#
4# This file is part of GNU lightning.
5#
6# GNU lightning is free software; you can redistribute it and/or modify it
7# under the terms of the GNU Lesser General Public License as published
8# by the Free Software Foundation; either version 3, or (at your option)
9# any later version.
10#
11# GNU lightning is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14# License for more details.
15#
16
79bfeef6
PC
17AM_CFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include \
18 -D_GNU_SOURCE $(LIGHTNING_CFLAGS)
4a71579b 19
ba3814c1 20check_PROGRAMS = lightning ccall self setcode nodata ctramp carg cva_list \
ba86ff93 21 catomic protect riprel cbit callee
4a71579b
PC
22
23lightning_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
24lightning_SOURCES = lightning.c
25
26ccall_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
27ccall_SOURCES = ccall.c
28
29self_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
30self_SOURCES = self.c
31
32setcode_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
33setcode_SOURCES = setcode.c
34
35nodata_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
36nodata_SOURCES = nodata.c
37
38ctramp_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
39ctramp_SOURCES = ctramp.c
40
41carg_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
42carg_SOURCES = carg.c
43
44cva_list_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
45cva_list_SOURCES = cva_list.c
46
ba3814c1
PC
47catomic_LDADD = $(top_builddir)/lib/liblightning.la -lm -lpthread $(SHLIB)
48catomic_SOURCES = catomic.c
49
79bfeef6
PC
50protect_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
51protect_SOURCES = protect.c
52
53riprel_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
54riprel_SOURCES = riprel.c
55
ba86ff93
PC
56# Actually, gcc 4.1.2 does not like unknown -Wno-option and errors out;
57# better to just have warnings.
58if cpu_ia64
59cbit_CFLAGS = $(AM_CFLAGS) -fwrapv
60else
61cbit_CFLAGS = $(AM_CFLAGS) -fwrapv -Wno-overflow -Wno-integer-overflow \
62 -Wno-shift-count-overflow
63endif
64cbit_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
65cbit_SOURCES = cbit.c
66
67callee_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
68callee_SOURCES = callee.c
69
70noinst_PROGRAMS = gen_cbit
71gen_cbit_SOURCES = gen_cbit.c
72
73cbit.c: gen_cbit
74 $(top_builddir)/check/gen_cbit > cbit.c
75
4a71579b
PC
76$(top_builddir)/lib/liblightning.la:
77 cd $(top_builddir)/lib; $(MAKE) $(AM_MAKEFLAGS) liblightning.la
78
79EXTRA_DIST = \
80 3to2.tst 3to2.ok \
81 add.tst add.ok \
82 align.tst align.ok \
83 allocai.tst allocai.ok \
84 allocar.tst allocar.ok \
85 bp.tst bp.ok \
86 divi.tst divi.ok \
87 fib.tst fib.ok \
88 rpn.tst rpn.ok \
89 ldst.inc \
90 ldstr.tst ldstr.ok \
91 ldsti.tst ldsti.ok \
92 ldstxr.tst ldstxr.ok \
93 ldstxi.tst ldstxi.ok \
94 ldstr-c.tst ldstr-c.ok \
95 ldstxr-c.tst ldstxr-c.ok \
96 ldstxi-c.tst ldstxi-c.ok \
ba86ff93 97 ext.tst ext.ok \
4a71579b
PC
98 cvt.tst cvt.ok \
99 hton.tst hton.ok \
40a44dcb 100 bswap.tst bswap.ok \
4a71579b
PC
101 branch.tst branch.ok \
102 alu.inc \
103 alu_add.tst alu_add.ok \
104 alux_add.tst alux_add.ok \
105 alu_sub.tst alu_sub.ok \
106 alux_sub.tst alux_sub.ok \
107 alu_rsb.tst alu_rsb.ok \
108 alu_mul.tst alu_mul.ok \
ba86ff93 109 alu_hmul.tst alu_hmul.ok \
4a71579b
PC
110 alu_div.tst alu_div.ok \
111 alu_rem.tst alu_rem.ok \
112 alu_and.tst alu_and.ok \
113 alu_or.tst alu_or.ok \
114 alu_xor.tst alu_xor.ok \
115 alu_lsh.tst alu_lsh.ok \
116 alu_rsh.tst alu_rsh.ok \
117 alu_com.tst alu_com.ok \
118 alu_neg.tst alu_neg.ok \
ba86ff93 119 alu_rot.tst alu_rot.ok \
e0659411 120 movzr.tst movzr.ok \
4a71579b
PC
121 fop_abs.tst fop_abs.ok \
122 fop_sqrt.tst fop_sqrt.ok \
123 varargs.tst varargs.ok \
124 stack.tst stack.ok \
125 clobber.tst clobber.ok \
126 carry.tst carry.ok \
127 call.tst call.ok \
128 float.tst float.ok \
ba86ff93 129 fma.tst fma.ok \
4a71579b 130 jmpr.tst jmpr.ok \
519a9ea1 131 live.tst live.ok \
4a71579b
PC
132 put.tst put.ok \
133 qalu.inc \
134 qalu_mul.tst qalu_mul.ok \
135 qalu_div.tst qalu_div.ok \
ba86ff93 136 qalu_shift.tst qalu_shift.ok \
4a71579b
PC
137 range.tst range.ok \
138 ranger.tst ranger.ok \
139 ret.tst ret.ok \
79bfeef6 140 skip.tst skip.ok \
4a71579b
PC
141 tramp.tst tramp.ok \
142 va_list.tst va_list.ok \
79bfeef6 143 bit.tst bit.ok \
ba86ff93
PC
144 rbit.tst rbit.ok \
145 popcnt.tst popcnt.ok \
146 imm.tst imm.ok \
147 unldst.tst unldst.ok \
4a71579b
PC
148 check.sh \
149 check.x87.sh \
150 check.arm.sh check.swf.sh \
151 check.arm.swf.sh \
152 check.arm4.swf.sh \
153 check.nodata.sh \
154 check.x87.nodata.sh \
79bfeef6 155 run-test all.tst \
ba86ff93
PC
156 collatz.tst factorial.tst \
157 gen_cbit.c
4a71579b
PC
158
159base_TESTS = \
160 3to2 add align allocai \
161 allocar bp divi fib rpn \
162 ldstr ldsti \
163 ldstxr ldstxi \
164 ldstr-c ldstxr-c ldstxi-c \
ba86ff93 165 ext cvt hton bswap branch \
4a71579b
PC
166 alu_add alux_add \
167 alu_sub alux_sub alu_rsb \
ba86ff93
PC
168 alu_mul alu_hmul \
169 alu_div alu_rem \
4a71579b
PC
170 alu_and alu_or alu_xor \
171 alu_lsh alu_rsh \
ba86ff93
PC
172 alu_com alu_neg alu_rot \
173 movzr fma \
4a71579b
PC
174 fop_abs fop_sqrt \
175 varargs stack \
176 clobber carry call \
519a9ea1 177 float jmpr live put \
ba86ff93 178 qalu_mul qalu_div qalu_shift \
79bfeef6 179 range ranger ret skip tramp \
ba86ff93
PC
180 va_list bit rbit popcnt imm \
181 unldst
4a71579b
PC
182
183$(base_TESTS): check.sh
184 $(LN_S) $(srcdir)/check.sh $@
185
186TESTS = $(base_TESTS)
187
188if test_x86_x87
189#x87_TESTS = $(addsuffix .x87, $(base_TESTS))
190x87_TESTS = \
191 3to2.x87 add.x87 allocai.x87 \
192 allocar.x87 bp.x87 divi.x87 fib.x87 \
193 rpn.x87 ldstr.x87 ldsti.x87 \
194 ldstxr.x87 ldstxi.x87 \
195 ldstr-c.x87 ldstxr-c.x87 ldstxi-c.x87 \
ba86ff93 196 ext.x87 cvt.x87 branch.x87 \
4a71579b
PC
197 alu_add.x87 alux_add.x87 \
198 alu_sub.x87 alux_sub.x87 alu_rsb.x87 \
ba86ff93
PC
199 alu_mul.x87 alu_hmul.x87 \
200 alu_div.x87 alu_rem.x87 \
4a71579b 201 alu_and.x87 alu_or.x87 alu_xor.x87 \
ba86ff93 202 alu_lsh.x87 alu_rsh.x87 alu_rot.x87 \
4a71579b 203 alu_com.x87 alu_neg.x87 \
ba86ff93 204 movzr.x87 fma.x87 \
4a71579b
PC
205 fop_abs.x87 fop_sqrt.x87 \
206 varargs.x87 stack.x87 \
207 clobber.x87 carry.x87 call.x87 \
208 float.x87 jmpr.x87 put.x87 \
ba86ff93 209 va_list.x87 imm.x87 unldst.x87
4a71579b
PC
210$(x87_TESTS): check.x87.sh
211 $(LN_S) $(srcdir)/check.x87.sh $@
212TESTS += $(x87_TESTS)
213
214#x87_nodata_TESTS = $(addsuffix .x87.nodata, $(base_TESTS))
215x87_nodata_TESTS = \
216 3to2.x87.nodata add.x87.nodata allocai.x87.nodata \
217 allocar.x87.nodata bp.x87.nodata divi.x87.nodata fib.x87.nodata \
218 rpn.x87.nodata ldstr.x87.nodata ldsti.x87.nodata \
219 ldstxr.x87.nodata ldstxi.x87.nodata \
220 ldstr-c.x87.nodata ldstxr-c.x87.nodata ldstxi-c.x87.nodata \
ba86ff93 221 ext.x87.nodata cvt.x87.nodata branch.x87.nodata \
4a71579b
PC
222 alu_add.x87.nodata alux_add.x87.nodata \
223 alu_sub.x87.nodata alux_sub.x87.nodata alu_rsb.x87.nodata \
ba86ff93
PC
224 alu_mul.x87.nodata alu_hmul.x87.nodata \
225 alu_div.x87.nodata alu_rem.x87.nodata \
4a71579b 226 alu_and.x87.nodata alu_or.x87.nodata alu_xor.x87.nodata \
ba86ff93 227 alu_lsh.x87.nodata alu_rsh.x87.nodata alu_rot.x87.nodata \
4a71579b 228 alu_com.x87.nodata alu_neg.x87.nodata \
ba86ff93 229 movzr.x87.nodata fma.x87.nodata \
4a71579b
PC
230 fop_abs.x87.nodata fop_sqrt.x87.nodata \
231 varargs.x87.nodata stack.x87.nodata \
232 clobber.x87.nodata carry.x87.nodata call.x87.nodata \
233 float.x87.nodata jmpr.x87.nodata put.x87.nodata \
ba86ff93 234 va_list.x87.nodata imm.x87.nodata unldst.x87.nodata
4a71579b
PC
235$(x87_nodata_TESTS): check.x87.nodata.sh
236 $(LN_S) $(srcdir)/check.x87.nodata.sh $@
237TESTS += $(x87_nodata_TESTS)
238endif
239
240if test_arm_arm
241#arm_TESTS = $(addsuffix .arm, $(base_TESTS))
242arm_TESTS = \
243 3to2.arm add.arm align.arm allocai.arm \
244 allocar.arm bp.arm divi.arm fib.arm \
245 rpn.arm ldstr.arm ldsti.arm \
246 ldstxr.arm ldstxi.arm \
247 ldstr-c.arm ldstxr-c.arm ldstxi-c.arm \
ba86ff93
PC
248 ext.arm cvt.arm hton.arm bswap.arm \
249 branch.arm alu_add.arm alux_add.arm \
4a71579b 250 alu_sub.arm alux_sub.arm alu_rsb.arm \
ba86ff93
PC
251 alu_mul.arm alu_hmul.arm \
252 alu_div.arm alu_rem.arm \
4a71579b 253 alu_and.arm alu_or.arm alu_xor.arm \
ba86ff93 254 alu_lsh.arm alu_rsh.arm alu_rot.arm \
4a71579b 255 alu_com.arm alu_neg.arm \
ba86ff93 256 movzr.arm fma.arm \
4a71579b
PC
257 fop_abs.arm fop_sqrt.arm \
258 varargs.arm stack.arm \
259 clobber.arm carry.arm call.arm \
260 float.arm jmpr.arm tramp.arm range.arm \
ba86ff93
PC
261 ranger.arm put.arm va_list.arm imm.arm \
262 unldst.arm
4a71579b
PC
263$(arm_TESTS): check.arm.sh
264 $(LN_S) $(srcdir)/check.arm.sh $@
265TESTS += $(arm_TESTS)
266endif
267
268if test_arm_swf
269#swf_TESTS = $(addsuffix .swf, $(base_TESTS))
270swf_TESTS = \
271 3to2.swf add.swf allocai.swf \
272 allocar.swf bp.swf divi.swf fib.swf \
273 rpn.swf ldstr.swf ldsti.swf \
274 ldstxr.swf ldstxi.swf \
275 ldstr-c.swf ldstxr-c.swf ldstxi-c.swf \
ba86ff93
PC
276 ext.swf cvt.swf hton.swf bswap.swf \
277 branch.swf alu_add.swf alux_add.swf \
4a71579b 278 alu_sub.swf alux_sub.swf alu_rsb.swf \
ba86ff93
PC
279 alu_mul.swf alu_hmul.swf \
280 alu_div.swf alu_rem.swf \
4a71579b 281 alu_and.swf alu_or.swf alu_xor.swf \
ba86ff93 282 alu_lsh.swf alu_rsh.swf alu_rot.swf \
4a71579b 283 alu_com.swf alu_neg.swf \
ba86ff93 284 movzr.swf fma.swf \
4a71579b
PC
285 fop_abs.swf fop_sqrt.swf \
286 varargs.swf stack.swf \
287 clobber.swf carry.swf call.swf \
288 float.swf jmpr.swf tramp.swf range.swf \
ba86ff93
PC
289 ranger.swf put.swf va_list.swf imm.swf \
290 unldst.swf
4a71579b
PC
291$(swf_TESTS): check.swf.sh
292 $(LN_S) $(srcdir)/check.swf.sh $@
293TESTS += $(swf_TESTS)
294if test_arm_arm
295#arm_swf_TESTS = $(addsuffix .arm.swf, $(base_TESTS))
296arm_swf_TESTS = \
297 3to2.arm.swf add.arm.swf allocai.arm.swf \
298 allocar.arm.swf bp.arm.swf divi.arm.swf fib.arm.swf \
299 rpn.arm.swf ldstr.arm.swf ldsti.arm.swf \
300 ldstxr.arm.swf ldstxi.arm.swf \
301 ldstr-c.arm.swf ldstxr-c.arm.swf ldstxi-c.arm.swf \
ba86ff93
PC
302 ext.arm.swf cvt.arm.swf hton.arm.swf bswap.arm.swf \
303 branch.arm.swf alu_add.arm.swf alux_add.arm.swf \
4a71579b
PC
304 alu_sub.arm.swf alux_sub.arm.swf alu_rsb.arm.swf \
305 alu_mul.arm.swf alu_div.arm.swf alu_rem.arm.swf \
306 alu_and.arm.swf alu_or.arm.swf alu_xor.arm.swf \
ba86ff93 307 alu_lsh.arm.swf alu_rsh.arm.swf alu_rot.arm.swf \
4a71579b 308 alu_com.arm.swf alu_neg.arm.swf \
ba86ff93 309 movzr.arm.swf fma.arm.swf \
4a71579b
PC
310 fop_abs.arm.swf fop_sqrt.arm.swf \
311 varargs.arm.swf stack.arm.swf \
312 clobber.arm.swf carry.arm.swf call.arm.swf \
313 float.arm.swf jmpr.arm.swf tramp.arm.swf range.arm.swf \
ba86ff93
PC
314 ranger.arm.swf put.arm.swf va_list.arm.swf imm.arm.swf \
315 unldst.arm.swf
4a71579b
PC
316$(arm_swf_TESTS): check.arm.swf.sh
317 $(LN_S) $(srcdir)/check.arm.swf.sh $@
318TESTS += $(arm_swf_TESTS)
319endif
320if test_arm_arm
321#arm4_swf_TESTS = $(addsuffix .arm4.swf, $(base_TESTS))
322arm4_swf_TESTS = \
323 3to2.arm4.swf add.arm4.swf allocai.arm4.swf \
324 allocar.arm4.swf bp.arm4.swf divi.arm4.swf fib.arm4.swf \
325 rpn.arm4.swf ldstr.arm4.swf ldsti.arm4.swf \
326 ldstxr.arm4.swf ldstxi.arm4.swf \
327 ldstr-c.arm4.swf ldstxr-c.arm4.swf ldstxi-c.arm4.swf \
ba86ff93 328 ext.arm4.swf cvt.arm4.swf hton.arm4.swf bswap.arm4.swf \
40a44dcb 329 branch.arm4.swf alu_add.arm4.swf alux_add.arm4.swf \
4a71579b
PC
330 alu_sub.arm4.swf alux_sub.arm4.swf alu_rsb.arm4.swf \
331 alu_mul.arm4.swf alu_div.arm4.swf alu_rem.arm4.swf \
332 alu_and.arm4.swf alu_or.arm4.swf alu_xor.arm4.swf \
ba86ff93 333 alu_lsh.arm4.swf alu_rsh.arm4.swf alu_rot.arm4.swf \
4a71579b 334 alu_com.arm4.swf alu_neg.arm4.swf \
ba86ff93 335 movzr.arm4.swf fma.arm4.swf \
4a71579b
PC
336 fop_abs.arm4.swf fop_sqrt.arm4.swf \
337 varargs.arm4.swf stack.arm4.swf \
338 clobber.arm4.swf carry.arm4.swf call.arm4.swf \
339 float.arm4.swf jmpr.arm4.swf tramp.arm4.swf \
340 range.arm4.swf ranger.arm4.swf put.arm4.swf \
ba86ff93
PC
341 va_list.arm4.swf imm.arm4.swf \
342 unldst.arm4.swf
4a71579b
PC
343$(arm4_swf_TESTS): check.arm4.swf.sh
344 $(LN_S) $(srcdir)/check.arm4.swf.sh $@
345TESTS += $(arm4_swf_TESTS)
346endif
347endif
348
349if test_nodata
350#nodata_TESTS = $(addsuffix .nodata, $(base_TESTS))
351nodata_TESTS = \
352 3to2.nodata add.nodata allocai.nodata \
353 allocar.nodata bp.nodata divi.nodata fib.nodata \
354 rpn.nodata ldstr.nodata ldsti.nodata \
355 ldstxr.nodata ldstxi.nodata \
356 ldstr-c.nodata ldstxr-c.nodata ldstxi-c.nodata \
ba86ff93 357 ext.nodata cvt.nodata branch.nodata \
4a71579b
PC
358 alu_add.nodata alux_add.nodata \
359 alu_sub.nodata alux_sub.nodata alu_rsb.nodata \
ba86ff93
PC
360 alu_mul.nodata alu_hmul.nodata \
361 alu_div.nodata alu_rem.nodata \
4a71579b 362 alu_and.nodata alu_or.nodata alu_xor.nodata \
ba86ff93 363 alu_lsh.nodata alu_rsh.nodata alu_rot.nodata \
4a71579b 364 alu_com.nodata alu_neg.nodata \
ba86ff93 365 movzr.nodata fma.nodata \
4a71579b
PC
366 fop_abs.nodata fop_sqrt.nodata \
367 varargs.nodata stack.nodata \
368 clobber.nodata carry.nodata call.nodata \
369 float.nodata jmpr.nodata tramp.nodata \
370 range.nodata ranger.nodata put.nodata \
ba86ff93
PC
371 va_list.nodata bit.nodata imm.nodata \
372 unldst.nodata
4a71579b
PC
373$(nodata_TESTS): check.nodata.sh
374 $(LN_S) $(srcdir)/check.nodata.sh $@
375TESTS += $(nodata_TESTS)
376endif
377
79bfeef6 378TESTS += ccall self setcode nodata ctramp carg cva_list catomic \
ba86ff93
PC
379 protect riprel cbit callee
380CLEANFILES = $(TESTS) gen_cbit cbit.c
4a71579b
PC
381
382#TESTS_ENVIRONMENT=$(srcdir)/run-test;
383
384debug: lightning
385 $(LIBTOOL) --mode=execute gdb lightning