Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / support / regression / cases / Makefile.in
blob7941c57111db1eddcdcf56f96965b485cc36cbcf
1 # Makefile for "cases"
2 # C code generated from "tests"
4 srcdir = @srcdir@
5 top_builddir = @top_builddir@
6 PYTHON = @PYTHON@
7 M4 = @M4@
9 # Script that takes a source test suite and generates the iterations
10 GENERATE_CASES = $(srcdir)/generate-cases.py
11 MAKE_DRV = $(srcdir)/mkdrv.py # BUG? use 1 line of sed?
12 TESTS_DIR = $(srcdir)/../tests
13 GTE_TESTS_DIR = $(srcdir)/../gte
14 QC_TESTS_DIR = $(srcdir)/../qct
15 TCC_TESTS_DIR = $(srcdir)/../tcc
17 TEST_DIRS = \
18 ${TESTS_DIR} \
19 ${GTE_TESTS_DIR} \
20 ${QC_TESTS_DIR} \
21 ${TCC_TESTS_DIR}
23 vpath %.c.in $(TESTS_DIR)
24 vpath %.c $(TESTS_DIR)
26 TPL_TESTS = $(shell (cd $(TESTS_DIR); ls *.c.in))
27 C_TESTS = $(shell (cd $(TESTS_DIR); ls *.c))
28 M4_TESTS = $(shell (cd $(TESTS_DIR); ls *.m4))
29 GTE_TESTS_WC = $(shell (cd $(GTE_TESTS_DIR); ls *.c))
30 QC_TESTS_WC = $(shell (cd $(QC_TESTS_DIR); ls *.c))
31 TCC_TESTS_WC = $(shell (cd $(TCC_TESTS_DIR); ls *.c))
33 # GTE tests using asm (TODO: generate automatically)
34 # these don't seem to work.
35 GTE_SKIP_TESTS = \
36 20001009-2.c \
37 20020107-1.c \
38 20030222-1.c \
39 20050203-1.c \
40 20061031-1.c \
41 20061220-1.c \
42 20071220-1.c \
43 20071220-2.c \
44 20080122-1.c \
45 960312-1.c \
46 990130-1.c \
47 pr103376.c \
48 pr38533.c \
49 pr40022.c \
50 pr40657.c \
51 pr41239.c \
52 pr43385.c \
53 pr43560.c \
54 pr44852.c \
55 pr45695.c \
56 pr46309.c \
57 pr47925.c \
58 pr49218.c \
59 pr49279.c \
60 pr49390.c \
61 pr51447.c \
62 pr51877.c \
63 pr51933.c \
64 pr52286.c \
65 pr53645-2.c \
66 pr53645.c \
67 pr56205.c \
68 pr56866.c \
69 pr57344-1.c \
70 pr57344-2.c \
71 pr57344-3.c \
72 pr57344-4.c \
73 pr58277-1.c \
74 pr58419.c \
75 pr65053-1.c \
76 pr65053-2.c \
77 pr65648.c \
78 pr65956.c \
79 pr68328.c \
80 pr69320-2.c \
81 pr69691.c \
82 pr78438.c \
83 pr78726.c \
84 pr79354.c \
85 pr79737-2.c \
86 pr80421.c \
87 pr82954.c \
88 pr84478.c \
89 pr84524.c \
90 pr85156.c \
91 pr85756.c \
92 pr88904.c \
93 pr93945.c \
94 pr94130.c \
95 stkalign.c
97 # uses typeof. typeof was a GCC extension, which became standard in C23. RFE #738.
98 GTE_SKIP_TESTS += \
99 20020412-1.c \
100 builtin-types-compatible-p.c \
101 va-arg-22.c
103 # gnu extension (inline varargs, -fgnu89-inline..)
104 GTE_SKIP_TESTS += \
105 bcp-1.c \
106 va-arg-7.c \
107 va-arg-8.c \
108 980608-1.c
110 # SDCC does not yet support compound literals (RFE #332)
111 GTE_SKIP_TESTS += \
112 20000917-1.c \
113 20020206-2.c
115 # Uses GCC implementation-defined long long bit-fields not supported in SDCC
116 GTE_SKIP_TESTS += \
117 991118-1.c
119 # SDCC does not yet support K&R-style style functions (RFE #450)
120 GTE_SKIP_TESTS += \
121 20000914-1.c \
122 20000112-1.c \
123 20000808-1.c \
124 930921-1.c \
125 931228-1.c \
126 940115-1.c \
127 950221-1.c \
128 960209-1.c \
129 970923-1.c
131 # __SIZE_TYPE__ something. TODO: retry
132 GTE_SKIP_TESTS += \
133 20001203-2.c \
134 simd-6.c \
135 pr36321.c \
136 pr35472.c \
137 pr30778.c \
138 pr103405.c \
139 nestfunc-6.c \
140 991014-1.c \
141 20070919-1.c \
142 20051113-1.c \
143 20050215-1.c \
144 strlen-6.c
146 # Test for GCC implementation-defined bit-field layout
147 GTE_SKIP_TESTS += \
148 bitfld-2.c
150 # Test for GCC implementation-defined floating-point behaviour
151 GTE_SKIP_TESTS += \
152 990127-2.c
154 # Requires int of at least 32 bits.
155 GTE_SKIP_TESTS += \
156 20061101-1.c \
157 cmpsi-2.c \
158 pr29797-1.c \
159 pr45262.c \
160 pr66556.c \
161 vrp-5.c \
162 vrp-6.c
164 # Bugs? These fail on stm8.
165 GTE_SKIP_TESTS += \
166 pr48197.c
168 # BUGs? abnormal stop on stm8
169 GTE_SKIP_TESTS += \
170 printf-1.c \
171 vprintf-1.c
173 # timeout on ucsim stm8 (revisit later..)
174 GTE_SKIP_TESTS += \
175 20000819-1.c \
176 20000910-1.c \
177 20001111-1.c \
178 20020404-1.c \
179 20021024-1.c \
180 921110-1.c \
181 941014-2.c \
182 960521-1.c \
183 960802-1.c \
184 991030-1.c \
185 loop-2b.c \
186 nestfunc-4.c \
187 pr58640.c \
188 pr58943.c \
189 pr7284-1.c \
190 va-arg-21.c \
191 va-arg-24.c \
192 va-arg-trap-1.c \
193 zerolen-1.c
195 # Test for implementation-defined struct layout
196 GTE_SKIP_TESTS += \
197 20000223-1.c
199 # Test for GCC behaviour when library function is locally overwritten
200 GTE_SKIP_TESTS += \
201 20021127-1.c
203 # Test for GCC implementation-defined behaviour (GIMPLE memory model)
204 GTE_SKIP_TESTS += \
205 alias-access-path-1.c
207 # misc syntax error
208 GTE_SKIP_TESTS += \
209 20000801-3.c \
210 20000822-1.c \
211 20010904-2.c \
212 20020320-1.c \
213 20030109-1.c \
214 20030224-2.c \
215 20030501-1.c \
216 20030910-1.c \
217 20040302-1.c \
218 20040520-1.c \
219 20041218-2.c \
220 20050107-1.c \
221 20050119-1.c \
222 20050119-2.c \
223 20050121-1.c \
224 20070614-1.c \
225 20071018-1.c \
226 20071029-1.c \
227 20071120-1.c \
228 20080502-1.c \
229 20081117-1.c \
230 20081218-1.c \
231 20090113-2.c \
232 20090113-3.c \
233 20090219-1.c \
234 20090711-1.c \
235 20120105-1.c \
236 20190820-1.c \
237 20190901-1.c \
238 920302-1.c \
239 920415-1.c \
240 920428-2.c \
241 920501-3.c \
242 920501-4.c \
243 920501-5.c \
244 920501-7.c \
245 920612-2.c \
246 920721-4.c \
247 921017-1.c \
248 921215-1.c \
249 930930-1.c \
250 931002-1.c \
251 950906-1.c \
252 960512-1.c \
253 980526-1.c \
254 980605-1.c \
255 990208-1.c \
256 990326-1.c \
257 990413-2.c \
258 991228-1.c \
259 alias-1.c \
260 alias-2.c \
261 align-nest.c \
262 builtin-bitops-1.c \
263 built-in-setjmp.c \
264 comp-goto-1.c \
265 comp-goto-2.c \
266 complex-1.c \
267 complex-2.c \
268 complex-4.c \
269 complex-5.c \
270 complex-6.c \
271 complex-7.c \
272 eeprof-1.c \
273 ffs-1.c \
274 ffs-2.c \
275 fprintf-2.c \
276 fprintf-chk-1.c \
277 ipa-sra-1.c \
278 ipa-sra-2.c \
279 loop-2e.c \
280 mayalias-1.c \
281 mayalias-2.c \
282 mayalias-3.c \
283 nestfunc-1.c \
284 nestfunc-2.c \
285 nestfunc-3.c \
286 nestfunc-5.c \
287 nestfunc-7.c \
288 nest-stdar-1.c \
289 packed-aligned.c \
290 pr103209.c \
291 pr103255.c \
292 pr104604.c \
293 pr19687.c \
294 pr22061-3.c \
295 pr22061-4.c \
296 pr22098-1.c \
297 pr22098-2.c \
298 pr22098-3.c \
299 pr22141-1.c \
300 pr23135.c \
301 pr23324.c \
302 pr23467.c \
303 pr24135.c \
304 pr28403.c \
305 pr28865.c \
306 pr28982b.c \
307 pr29006.c \
308 pr33992.c \
309 pr34154.c \
310 pr34768-1.c \
311 pr34768-2.c \
312 pr35456.c \
313 pr36034-1.c \
314 pr36034-2.c \
315 pr36339.c \
316 pr36343.c \
317 pr36765.c \
318 pr37573.c \
319 pr37780.c \
320 pr38151.c \
321 pr38819.c \
322 pr38969.c \
323 pr39228.c \
324 pr40579.c \
325 pr41395-1.c \
326 pr41395-2.c \
327 pr41463.c \
328 pr42154.c \
329 pr42231.c \
330 pr42248.c \
331 pr43008.c \
332 pr43784.c \
333 pr43987.c \
334 pr44164.c \
335 pr44683.c \
336 pr44858.c \
337 pr45070.c \
338 pr46316.c \
339 pr48571-1.c \
340 pr48814-1.c \
341 pr49644.c \
342 pr51323.c \
343 pr52129.c \
344 pr52760.c \
345 pr52979-1.c \
346 pr52979-2.c \
347 pr53084.c \
348 pr53688.c \
349 pr54471.c \
350 pr54937.c \
351 pr54985.c \
352 pr55750.c \
353 pr55875.c \
354 pr56799.c \
355 pr56962.c \
356 pr56982.c \
357 pr57124.c \
358 pr57130.c \
359 pr57144.c \
360 pr57568.c \
361 pr57829.c \
362 pr58209.c \
363 pr58277-2.c \
364 pr58574.c \
365 pr58831.c \
366 pr59014-2.c \
367 pr59101.c \
368 pr59229.c \
369 pr59358.c \
370 pr59643.c \
371 pr59747.c \
372 pr60822.c \
373 pr61375.c \
374 pr64006.c \
375 pr64242.c \
376 pr65215-3.c \
377 pr65215-4.c \
378 pr65215-5.c \
379 pr65369.c \
380 pr65401.c \
381 pr67037.c \
382 pr68249.c \
383 pr68381.c \
384 pr68648.c \
385 pr69447.c \
386 pr70222-1.c \
387 pr70429.c \
388 pr70460.c \
389 pr70602.c \
390 pr71083.c \
391 pr71494.c \
392 pr71554.c \
393 pr78436.c \
394 pr78622.c \
395 pr79043.c \
396 pr79737-1.c \
397 pr80692.c \
398 pr81423.c \
399 pr81588.c \
400 pr82192.c \
401 pr82524.c \
402 pr84169.c \
403 pr84339.c \
404 pr84748.c \
405 pr85095.c \
406 pr86492.c \
407 pr86528.c \
408 pr86659-1.c \
409 pr86659-2.c \
410 pr86844.c \
411 pr87623.c \
412 pr89195.c \
413 pr90025.c \
414 pr91450-1.c \
415 pr91450-2.c \
416 pr91597.c \
417 pr91632.c \
418 pr92140.c \
419 pr92904.c \
420 pr93213.c \
421 pr93402.c \
422 pr93582.c \
423 pr93908.c \
424 pr94524-1.c \
425 pr94524-2.c \
426 pr94591.c \
427 pr94734.c \
428 pr95731.c \
429 pr97073.c \
430 pr97386-1.c \
431 pr97386-2.c \
432 pr97421-1.c \
433 pr97764.c \
434 pr98474.c \
435 pr98681.c \
436 pr98727.c \
437 pr99079.c \
438 printf-2.c \
439 printf-chk-1.c \
440 return-addr.c \
441 scal-to-vec1.c \
442 scal-to-vec2.c \
443 scal-to-vec3.c \
444 simd-1.c \
445 simd-2.c \
446 simd-4.c \
447 strlen-7.c \
448 struct-aliasing-1.c \
449 user-printf.c \
450 usmul.c \
451 va-arg-pack-1.c \
452 vfprintf-chk-1.c \
453 vprintf-chk-1.c \
454 zerolen-2.c \
455 zero-struct-1.c \
456 zero-struct-2.c
458 # too many parameters (various reasons)
459 GTE_SKIP_TESTS += \
460 20051012-1.c \
461 921208-2.c \
462 980709-1.c \
463 990826-0.c \
464 gofast.c \
465 pr103052.c \
466 pr15262-1.c \
467 pr19449.c \
468 pr34982.c \
469 pr36038.c \
470 pr40668.c \
471 pr47237.c \
472 pr61725.c \
473 pr71550.c \
474 pr79327.c \
475 pr84521.c \
476 pr93494.c \
477 pr97325.c \
478 vfprintf-1.c
480 # too many parameters try #pragma std_c90?
481 GTE_SKIP_TESTS += \
482 990628-1.c
484 # BUG? flexible array 'dims' in otherwise empty struct
485 GTE_SKIP_TESTS += 920728-1.c
487 # stm8 only?: bit-field size too wide for type (max 16 bits)
488 GTE_SKIP_TESTS += \
489 20040629-1.c \
490 20040705-1.c \
491 20040705-2.c \
492 bitfld-4.c \
493 bitfld-6.c \
494 bitfld-7.c \
495 pr103417.c \
496 pr19689.c \
497 pr31448-2.c \
498 pr31448.c \
499 pr32244-1.c \
500 pr34971.c \
501 pr40404.c \
502 pr58570.c \
503 pr78170.c \
504 pr98366.c
506 # SDCC does not yet support omission of braces in initialization. RFE #562.
507 GTE_SKIP_TESTS += \
508 20040703-1.c \
509 991201-1.c \
510 complex-3.c \
511 pr33631.c \
512 pr41919.c
514 # Uses GCC extension __builtin_classify_type
515 GTE_SKIP_TESTS += \
516 20040709-1.c
518 # sys/types.h unavailable (POSIX, not part of C standard)
519 GTE_SKIP_TESTS += \
520 loop-2f.c \
521 loop-2g.c
523 # VLA
524 GTE_SKIP_TESTS += \
525 pr41935.c \
526 pr43220.c \
527 pr43220.c
529 # __builtin_unreachable
530 GTE_SKIP_TESTS += \
531 pr97888-1.c
533 # __builtin_abs
534 GTE_SKIP_TESTS += \
535 pr34130.c
537 # __builtin_strcmp
538 GTE_SKIP_TESTS += \
539 921007-1.c
541 # __builtin_va_list
542 GTE_SKIP_TESTS += \
543 20041214-1.c
545 # __builtin_add_overflow
546 GTE_SKIP_TESTS += \
547 pr90311.c
549 # __builtin_strlen
550 GTE_SKIP_TESTS += \
551 widechar-3.c
553 # __builtin_memcpy
554 GTE_SKIP_TESTS += \
555 20011121-1.c
557 # __builtin_expect
558 GTE_SKIP_TESTS += \
559 20020418-1.c
561 # # TODO: __builtin_abort
562 # GTE_SKIP_TESTS += \
563 # strlen-5.c \
564 # pr101335.c \
565 # alias-access-path-1.c
567 # TODO? __builtin_printf
568 GTE_SKIP_TESTS += \
569 strlen-5.c
571 # __builtin_prefetch
572 GTE_SKIP_TESTS += \
573 builtin-prefetch-1.c \
574 builtin-prefetch-2.c \
575 builtin-prefetch-3.c \
576 builtin-prefetch-4.c \
577 builtin-prefetch-5.c \
578 builtin-prefetch-6.c
580 # __builtin_strncpy
581 GTE_SKIP_TESTS += pr93249.c
583 # TODO?: __complex__, _Complex
584 GTE_SKIP_TESTS += \
585 20020227-1.c \
586 20020411-1.c \
587 20010605-2.c \
588 20041201-1.c \
589 20041124-1.c
591 # TODO?: printf
592 GTE_SKIP_TESTS += 20020406-1.c
594 # Initializer element is not a constant expression
595 GTE_SKIP_TESTS += \
596 20040308-1.c \
597 20040811-1.c
599 # Bug #3405
600 GTE_SKIP_TESTS += \
601 931004-12.c
603 #BUG? incompatible types
604 GTE_SKIP_TESTS += \
605 930608-1.c \
606 pr57321.c
608 # BUG? increment in function declaration args
609 GTE_SKIP_TESTS += \
610 970217-1.c \
611 pr22061-2.c
613 # BUG?: preprocessor ellipsis
614 GTE_SKIP_TESTS += \
615 fprintf-1.c
617 # various __attribute__ (not implemented?)
618 GTE_SKIP_TESTS += \
619 20010518-2.c \
620 20010904-1.c \
621 20010904-2.c \
622 20020108-1.c \
623 20031201-1.c \
624 20040625-1.c \
625 20040709-2.c \
626 20040709-3.c \
627 20050316-1.c \
628 20050316-2.c \
629 20050316-3.c \
630 20050604-1.c \
631 20050607-1.c \
632 20060420-1.c \
633 20071211-1.c \
634 20101011-1.c \
635 20110418-1.c \
636 20111212-1.c \
637 20120919-1.c \
638 20191023-1.c \
639 960117-1.c \
640 alias-3.c \
641 alias-4.c \
642 align-1.c \
643 align-3.c \
644 alloca-1.c \
645 bitfld-10.c \
646 bitfld-8.c \
647 bitfld-9.c \
648 bswap-1.c \
649 bswap-3.c \
650 cbrt.c \
651 frame-address.c \
652 memset-4.c \
653 nest-align-1.c \
654 pr17377.c \
655 pr22141-2.c \
656 pr25125.c \
657 pr28289.c \
658 pr32500.c \
659 pr38051.c \
660 pr42614.c \
661 pr43835.c \
662 pr49886.c \
663 pr56837.c \
664 pr60960.c \
665 pr65427.c \
666 pr70903.c \
667 pr71626-1.c \
668 pr71626-2.c \
669 pr82210.c \
670 pr85169.c \
671 pr85331.c \
672 pr92618.c \
673 pr94412.c \
674 pr97888-2.c \
675 simd-5.c \
676 strcpy-2.c \
677 strct-pack-1.c \
678 strct-pack-2.c \
679 strct-pack-3.c \
680 strct-pack-4.c \
681 struct-ret-2.c
683 # mpn
684 GTE_SKIP_TESTS += \
685 921202-1.c
687 # __builtin_return_address
688 GTE_SKIP_TESTS += \
689 20030323-1.c \
690 20030811-1.c
692 # __builtin_alloca
693 GTE_SKIP_TESTS += \
694 20070824-1.c
696 # __builtin_constant_p
697 GTE_SKIP_TESTS += \
698 20030330-1.c \
699 builtin-constant.c
701 # nested function
702 GTE_SKIP_TESTS += \
703 20010605-1.c
705 # BUG? sizeof applied to an incomplete type
706 GTE_SKIP_TESTS += \
707 pr42570.c
709 # use of alloca (not defined? yet?)
710 GTE_SKIP_TESTS += \
711 20010122-1.c \
712 20020314-1.c \
713 20021113-1.c \
714 20040223-1.c \
715 941202-1.c \
716 pr22061-1.c
718 # error: token "{" is not valid
719 GTE_SKIP_TESTS += \
720 bitintarith.c
722 # Needs far too much memory for SDCC targets
723 GTE_SKIP_TESTS += \
724 920410-1.c \
725 921113-1.c \
726 multi-ix.c
728 GTE_TESTS = $(filter-out $(GTE_SKIP_TESTS), $(GTE_TESTS_WC))
730 ##############
731 # QuickC tests
733 # some preprocessor testing, needs careful flags.
734 QC_SKIP_TESTS += \
735 0064-sysinclude.c
737 # snprintf is missing
738 QC_SKIP_TESTS += \
739 0108-callvararg.c
741 # syntax error
742 QC_SKIP_TESTS += \
743 0047-anonexport.c \
744 0101-bug.c
746 # Tests for QuickC implementation-defined behaviour
747 QC_SKIP_TESTS += \
748 0039-sizeof.c
750 # Takes far too much time for SDCC targets
751 QC_SKIP_TESTS += \
752 0041-queen.c \
753 0042-prime.c
755 QC_TESTS = $(filter-out $(QC_SKIP_TESTS), $(QC_TESTS_WC))
757 ##############
758 # Tiny C tests
760 # SDCC does not yet support compound literals (RFE #332)
761 TCC_SKIP_TESTS += \
762 94_generic.c
764 # Uses POSIX threads
765 TCC_SKIP_TESTS += \
766 106_versym.c \
767 114_bound_signal.c \
768 116_bound_setjmp2.c \
769 124_atomic_counter.c
771 # SDCC does not yet support long double.
772 TCC_SKIP_TESTS += \
773 111_conversion.c
775 # misc syntax error
776 TCC_SKIP_TESTS += \
777 03_struct.c \
778 100_c99array-decls.c \
779 101_cleanup.c \
780 102_alignas.c \
781 103_implicit_memmove.c \
782 108_constructor.c \
783 118_switch.c \
784 119_random_stuff.c \
785 120_alias.c \
786 123_vla_bug.c \
787 18_include.c \
788 33_ternary_op.c \
789 39_typedef.c \
790 40_stdio.c \
791 42_function_pointer.c \
792 46_grep.c \
793 76_dollars_in_identifiers.c \
794 82_attribs_position.c \
795 85_asm-outside-function.c \
796 87_dead_code.c \
797 88_codeopt.c \
798 89_nocode_wanted.c \
799 90_struct-init.c \
800 95_bitfields.c \
801 98_al_ax_extend.c \
802 99_fastcall.c
804 # strdup declaration collision (old standard?)
805 TCC_SKIP_TESTS += \
806 112_backtrace.c
808 # multiple compilation units
809 TCC_SKIP_TESTS += \
810 104_inline.c \
811 104+_inline.c \
812 113_btdll.c \
813 120_alias.c \
814 120+_alias.c
816 # bultins
817 TCC_SKIP_TESTS += \
818 117_builtins.c \
820 # incompatible types
821 TCC_SKIP_TESTS += \
822 17_enum.c
824 # pp bug?
825 TCC_SKIP_TESTS += \
826 77_push_pop_macro.c
828 # heterogeneous main arguments
829 TCC_SKIP_TESTS += \
830 32_led.c \
831 96_nodata_wanted.c
833 # cannot assign values to arrays
834 TCC_SKIP_TESTS += \
835 34_array_assignment.c
837 # Initializer element is not a constant expression
838 TCC_SKIP_TESTS += \
839 78_vla_label.c \
840 79_vla_continue.c \
841 115_bound_setjmp.c \
842 122_vla_reuse.c
844 # Relies on TinyC implementation-defined support for long long bit-fields and integer width of 32 bits.
845 TCC_SKIP_TESTS += \
846 93_integer_promotion.c \
847 95_bitfields.c \
848 95_bitfields_ms.c
850 # Relies on implicit 0 return by main, but the test framework renames the mainfunction from the test.
851 TCC_SKIP_TESTS += \
852 121_struct_return.c
854 # sin function etc.
855 TCC_SKIP_TESTS += \
856 22_floating_point.c \
857 24_math_library.c
859 # ?ASlink-Warning-Undefined Global '_main_' referenced
860 TCC_SKIP_TESTS += \
861 60_errors_and_warnings.c \
862 125_atomic_misc.c
864 # SDCC does not yet support omission of braces in initialization. RFE #562.
865 TCC_SKIP_TESTS += \
866 73_arm64.c \
867 75_array_in_struct_init.c
869 # int f9 (int ((int)), int);
870 # BUG? Syntax error, declaration ignored at ','. Possibly related to bug #3358?
871 TCC_SKIP_TESTS += \
872 81_types.c
874 # abnormal stop (on all ports but host)
875 TCC_SKIP_TESTS += \
876 107_stack_safe.c \
877 71_macro_empty_arg.c
879 # assertion failed (on all ports but host)
880 TCC_SKIP_TESTS += \
881 84_hex-float.c
883 # Relies on implementation extensions common on GNU/Linux
884 TCC_SKIP_TESTS += \
885 86_memory-model.c
887 TCC_TESTS = $(filter-out $(TCC_SKIP_TESTS), $(TCC_TESTS_WC))
889 TPL_TEST_STEMS = $(TPL_TESTS:%.c.in=%)
890 QC_TEST_STEMS = $(QC_TESTS_WC:%.c=%)
891 TCC_TEST_STEMS = $(TCC_TESTS_WC:%.c=%)
893 # maybe this is not necessary, just ship the tst_%.c files?
894 # (does it matter?)
895 C_TEST_SRCS = $(C_TESTS:%.c=tst_%.c)
896 M4_TEST_SRCS = $(M4_TESTS:%.m4=m4_%.c)
897 GTE_TEST_SRCS = $(GTE_TESTS:%.c=gte_%.c)
898 QC_TEST_SRCS = $(QC_TESTS_WC:%.c=qct_%.c)
899 TCC_TEST_SRCS = $(TCC_TESTS_WC:%.c=tcc_%.c)
901 # Generate .c files from .m4 files
902 # bug/feature? run MAKE_DRV as well (requires magic filenames and paths)
903 m4_%.c: $(TESTS_DIR)/%.m4
904 @printf .
905 @$(M4) -I $(srcdir)/../m4include rtmacros.m4 $< > $*.m4c
906 @$(PYTHON) $(MAKE_DRV) $*.m4c $@
907 @touch $@
909 qct_%.c: $(QC_TESTS_DIR)/%.c Makefile
910 @echo '#include <testfwk.h>' > $@
911 @echo '#ifdef __SDCC' >> $@
912 @echo '#pragma std_sdcc99' >> $@
913 @echo '#endif // __SDCC' >> $@
914 @echo 'const int __numCases = 1;' >> $@
915 @echo '__code const char * __getSuiteName(void) { return "qct/$*"; }' >> $@
916 @echo '#define main main_' >> $@
918 @#find matching main arguments, none or 2
919 @#(using printf instead of echo -n for better portability)
920 @printf '#define MAINARGS' >> $@
921 @(grep -q main.*argv $< && echo " 0, 0" || \
922 (grep -q main.*argc $< && echo " 0" || echo )) >> $@
923 @echo '#include "$<"' >> $@
924 @printf 'void __runSuite(void) { __prints("Running main\\n"); ASSERT(!main_(MAINARGS)); }' >> $@
925 @echo >> $@
927 tcc_%.c: $(TCC_TESTS_DIR)/%.c Makefile
928 @echo '#include <testfwk.h>' > $@
929 @echo '#ifdef __SDCC' >> $@
930 @echo '#pragma std_sdcc99' >> $@
931 @echo '#endif // __SDCC' >> $@
932 @echo 'const int __numCases = 1;' >> $@
933 @echo '__code const char * __getSuiteName(void) { return "tcc/$*"; }' >> $@
934 @echo '#define main main_' >> $@
936 @#find matching main arguments, none or 2
937 @printf '#define MAINARGS' >> $@
938 @(grep -q main.*argv $< && echo " 0, 0" || \
939 (grep -q main.*argc $< && echo " 0" || echo )) >> $@
941 # non-standard __FUNCTION__
942 @grep -q __FUNCTION__ $< && echo "#define __FUNCTION__ __func__" >> $@ || :
943 @grep -q tcc_backtrace $< && echo "#define tcc_backtrace printf" >> $@ || :
944 @echo '#include "$<"' >> $@
945 @echo '#undef abort' >> $@ # yikes, 77_push_pop_macro.c
947 @echo '#ifdef __SDCC' >> $@
948 @echo 'extern void _putchar(char c);' >> $@
949 @echo 'int putchar(int c){_putchar(c);return(c);}' >> $@
950 @echo 'void abort(void) {ASSERT(0);}' >> $@
951 @echo '#endif' >> $@
953 @printf 'void __runSuite(void) { __prints("Running main\\n"); ASSERT(!main_(MAINARGS)); }' >> $@
954 @echo >> $@
956 gte_%.c: $(GTE_TESTS_DIR)/%.c Makefile
957 @printf .
958 @echo '#include <testfwk.h>' > $@
959 @echo '#ifdef __SDCC' >> $@
960 @echo '#pragma std_sdcc99' >> $@
962 # stuff defined in gcc, but not in sdcc
963 @grep -q __CHAR_BIT__ $< && (echo "#include <limits.h>"; echo "#define __CHAR_BIT__ CHAR_BIT") >> $@ || :
964 @grep -q __INT_MAX__ $< && (echo "#include <limits.h>"; echo "#define __INT_MAX__ INT_MAX") >> $@ || :
965 @grep -q __SIZE_TYPE__ $< && (echo "#include <stddef.h>" ;echo "#define __SIZE_TYPE__ size_t") >> $@ || :
966 @grep -q __LONG_LONG_MAX__ $< && (echo "#include <limits.h>"; echo "#define __LONG_LONG_MAX__ LLONG_MAX") >> $@ || :
967 @grep -q __INTPTR_TYPE__ $< && echo "#define __INTPTR_TYPE__ intptr_t" >> $@ || :
968 @grep -q __builtin_abort $< && echo "void __builtin_abort(void){ASSERT(0);}" >> $@ || :
969 @grep -q __builtin_unreachable $< && echo "void __builtin_unreachable(void){}" >> $@ || :
970 @grep -q __builtin_memset $< && (echo "#include <string.h>"; echo "#define __builtin_memset memset") >> $@ || :
972 @echo '#endif // __SDCC' >> $@
974 # redirect stuff a bit.
975 @grep -q exit $< && echo "#include <setjmp.h>" >> $@ \
976 && echo "jmp_buf after_main;" >> $@ \
977 && echo "void exit__substitute(int i){ASSERT(!i); longjmp(after_main, 1);}" >> $@ \
978 && echo "#define exit exit__substitute" >> $@ || :
979 @printf '#define main main_\n#define assert ASSERT\nvoid abort(void) {ASSERT(0);}\n' >> $@
981 @#find matching main arguments, none or 2
982 @printf '#define MAINARGS' >> $@
983 @(grep -q main.*argv $< && echo " 0, 0" || \
984 (grep -q main.*argc $< && echo " 0" || echo )) >> $@
986 @echo '#include "$<"' >> $@
987 @printf 'void __runSuite(void) { __prints("Running main\\n");' >> $@
988 @grep -q exit $< && echo 'if(!setjmp(after_main))' >> $@ || :
989 @printf 'main_(MAINARGS); }\n' >> $@
990 @echo 'const int __numCases = 1;' >> $@
991 @echo '__code const char * __getSuiteName(void) { return "gte/$*"; }' >> $@
993 # expand tests with python script
994 %/stamp: %.c.in $(GENERATE_CASES)
995 rm -rf $*
996 mkdir -p $*
997 @printf .
998 @$(PYTHON) $(GENERATE_CASES) $< $*
999 touch $@
1001 tst_%.c: %.c $(MAKE_DRV)
1002 @printf .
1003 @$(PYTHON) $(MAKE_DRV) $< $@
1005 all: MakeList
1007 TEST_SRCS = \
1008 $(C_TEST_SRCS) \
1009 $(GTE_TEST_SRCS) \
1010 $(M4_TEST_SRCS) \
1011 $(QC_TEST_SRCS) \
1012 $(TCC_TEST_SRCS)
1014 MakeList: $(TPL_TEST_STEMS:%=%/stamp) $(TEST_DIRS) $(TEST_SRCS) Makefile
1015 @echo
1016 @echo populated MakeList...
1017 @echo GTE_TEST_STEMS = $(GTE_TESTS:%.c=gte_%) > MakeList
1018 @printf "gce: gcc torture execute.. "
1019 @echo $(GTE_TESTS) | wc -w
1020 @printf "m4: macro tests.. "
1021 @echo $(M4_TESTS) | wc -w
1022 @printf "qct: QuickC tests.. "
1023 @echo $(QC_TEST_STEMS) | wc -w
1024 @printf "tcc: tinycc tests.. "
1025 @echo $(TCC_TEST_STEMS) | wc -w
1027 @printf "tpl: template tests.. "
1028 @echo $(TPL_TEST_STEMS) | wc -w
1029 @printf "tst: plain tests.. "
1030 @echo $(C_TEST_SRCS) | wc -w
1032 @echo QC_TEST_STEMS = $(QC_TESTS:%.c=qct_%) >> MakeList
1033 @echo TCC_TEST_STEMS = $(TCC_TESTS:%.c=tcc_%) >> MakeList
1034 @echo TPL_TEST_STEMS = $(TPL_TEST_STEMS) >> MakeList
1035 @echo C_TEST_STEMS = $(C_TEST_SRCS:%.c=%) >> MakeList
1036 @echo M4_TEST_STEMS = $(M4_TEST_SRCS:%.c=%) >> MakeList
1037 @echo GTE_TEST_STEMS = $(GTE_TEST_SRCS:%.c=%) >> MakeList
1039 @echo TEST_STEMS = '$$(M4_TEST_STEMS)' >> MakeList
1040 @echo TEST_STEMS += '$$(GTE_TEST_STEMS)' >> MakeList
1041 @echo TEST_STEMS += '$$(C_TEST_STEMS)' >> MakeList
1042 @echo TEST_STEMS += '$$(TPL_TEST_STEMS)' >> MakeList
1043 @echo TEST_STEMS += '$$(QC_TEST_STEMS)' >> MakeList
1044 @echo TEST_STEMS += '$$(TCC_TEST_STEMS)' >> MakeList
1046 .PHONY: clean distclean info
1048 clean:
1049 rm -f */*.c */*/stamp
1050 rm -f *.m4c *.c */stamp
1051 rm -rf MakeList
1052 rmdir * 2> /dev/null || :
1054 distclean: clean
1055 rm -f Makefile
1057 .PRECIOUS: %/stamp
1059 info:
1060 @echo TESTS_DIR $(TESTS_DIR)
1061 @echo VPATH $(VPATH)
1062 @echo TPL_TEST_STEMS $(TPL_TEST_STEMS)
1063 @echo C_TEST_SRCS $(C_TEST_SRCS)
1064 @echo M4_TESTS $(M4_TESTS)
1065 @echo GTE_TESTS $(GTE_TESTS)
1067 Makefile: $(srcdir)/Makefile.in
1068 cd $(top_builddir); ./config.status support/regression/cases/Makefile