scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit cd2e378821e5e5f86215643e87a6b806a8b54492
parent f60bf2a21373462c9b7636b9546a6574c9db7f5f
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date:   Fri, 29 May 2026 18:56:57 +0200

tests/cc: Use make to build the programs

This simplifies the shell script and the Makefile.

Diffstat:
Mtests/cc/execute/.gitignore | 268++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
Mtests/cc/execute/Makefile | 7++++---
Mtests/cc/execute/runtests.sh | 2+-
Mtests/cc/execute/scc-tests.lst | 534++++++++++++++++++++++++++++++++++++++++----------------------------------------
4 files changed, 539 insertions(+), 272 deletions(-)

diff --git a/tests/cc/execute/.gitignore b/tests/cc/execute/.gitignore @@ -1,4 +1,270 @@ test.log tests.h tmp_*.c -a.out +0001-sanity +0002-expr +0003-local +0004-pointer +0005-ifstmt +0006-whilestmt +0007-forstmt +0008-dowhilestmt +0009-expr +0010-goto +0011-assign +0012-expr +0013-addridx +0014-assignidx +0015-localarray +0016-addrarray +0017-struct +0018-structptr +0019-selfrefstruct +0020-ptrptr +0021-intfunc +0022-typedef +0023-global +0024-typedefstruct +0025-string +0026-implicitret +0027-charval +0028-bor +0029-band +0030-bxor +0031-relop +0032-indec +0033-ptrindec +0034-logandor +0035-breakcont +0036-notneg +0037-assignop +0038-ptradd +0039-sizeof +0040-cast +0041-queen +0042-prime +0043-union +0044-struct +0045-struct +0046-inits +0048-inits +0049-inits +0050-inits +0052-switch +0053-struct +0054-struct +0055-enum +0056-enum +0057-duff +0058-bug +0059-multistring +0060-charlit +0061-comments +0062-include +0063-define +0064-sysinclude +0065-ifdef +0066-cppelse +0067-define +0068-funclikemacro +0069-funclikemacro +0070-cppif +0071-cppelif +0072-cppelif +0073-ifndef +0074-undef +0075-ptraddasn +0076-ptrsubasn +0077-defined +0078-dirifexpr +0079-cond +0080-arrays +0081-calls +0082-bug +0083-voidret +0084-longlong +0085-ulonglong +0089-short +0090-fptr +0091-fptr +0092-fptr +0093-arrayinit +0094-arrayinit +0095-arrayselector +0096-inferredarraysize +0097-extern +0098-tentative +0099-tentative +0102-decl +0103-voidparm +0104-qbebug +0105-shl +0106-ppcast +0107-bnot +0108-bug +0109-struct +0110-typedefcast +0111-doubledef +0112-cond +0113-externredecl +0114-shortassig +0115-null_comparision +0116-floatcmp +0117-pointarith +0118-voidmain +0119-macrostr +0120-funpar +0121-localinit +0122-localinit +0123-doubleconst +0124-enumstruct +0125-fundcl +0126-macropar +0127-doublecte +0128-kr_names +0129-initi +0130-mulpars +0131-hello +0132-forward +0133-ftn_ptr +0134-arith +0135-unary +0136-if +0137-int_cast +0138-namespace +0139-ptr_ary +0140-int_fold +0141-int_iden +0142-char_const +0143-int_const +0144-long_const +0145-llong_const +0146-ifdef +0147-intern_cpp +0148-cpp_string +0149-define +0150-define +0151-vararg +0152-cat +0153-cpp_string +0154-if_defined +0155-struct_compl +0156-duff2 +0157-list +0158-ternary +0159-typedef +0160-cpp_if +0161-struct +0162-array +0163-array +0164-struct +0165-struct +0166-desig +0167-array +0168-array +0169-string +0170-line +0171-macros +0172-hexa +0173-macro +0174-decay +0175-defined +0176-macro +0177-literal +0178-include +0179-sizeof +0180-incomplete +0181-stringize +0182-voidcast +0183-negenum +0184-esc_macro +0185-esc_macro2 +0186-dec_ary +0187-zero_struct +0188-multi_string +0189-cpp +0190-enum_ary +0191-ary_addr +0192-ptrcmp +0193-incomplete +0194-vararg +0195-unexpected +0196-invalidchar +0197-cppcomment +0198-nullcpp +0199-voidpcast +0200-cpp +0201-cpp +0202-variadic +0203-comment +0204-cast +0205-cpparg +0206-initializer +0207-structcb +0208-sizeof +0209-dowhile +0210-flexible +0211-enum +0212-krtypes +0213-decay +0214-va_copy +0215-ret_struct +0216-initialize +0217-lchar +0218-initialize +0219-abbrev +0220-comma +0221-ifdef +0222-ifdef +0223-macro +0224-macro +0225-func +0226-pointer +0227-sizeof +0228-extrcast +0229-commalog +0230-init +0231-init +0232-cppmacro +0233-ifelif +0234-macro +0235-comment +0236-sizeof +0237-down +0238-align +0239-fcasts +0240-init +0241-init +0242-ternary +0243-ternary +0244-logic +0245-comma +0246-branch +0247-float +0248-enum +0249-mod +0250-div +0251-mul +0252-literal +0253-maxconst +0254-litchar +0255-init +0256-ary +0257-main +0258-variadic +0259-multichar +0260-macro +0261-macro +0262-macro +0263-macro +0264-wchar +0265-wchar +0266-wchar +0267-wchar +0268-string +0269-extern +0270-union +0271-struct +0272-div +0273-cpp +0274-loop diff --git a/tests/cc/execute/Makefile b/tests/cc/execute/Makefile @@ -4,13 +4,13 @@ PROJECTDIR = ../../.. include $(PROJECTDIR)/scripts/rules.mk CC=$(SCC) -PROJ_CFLAGS = $(CFLAGS) -PROJ_LDFLAGS= $(LDFLAGS) -PROJ_LDLIBS = all: @CC='$(CC)' ./runtests.sh scc-tests.lst +.c: + $(CC) -Isysinclude $(CFLAGS) $(LDFLAGS) -o $@ $< test.c + tests: @$(MAKE) |\ grep -v TODO |\ @@ -19,3 +19,4 @@ tests: clean: rm -f a.out *.s *.s *.as *.o *.ir *.qbe *core* test.log tests.h tmp_*.c + xargs rm -f < scc-tests.lst diff --git a/tests/cc/execute/runtests.sh b/tests/cc/execute/runtests.sh @@ -18,7 +18,7 @@ do state=${state:-""} rm -f a.out - (($CC -Isysinclude $CFLAGS "$i" test.c && ./a.out) >>test.log 2>&1 && + ((${MAKE-make} -s $i && ./$i) >>test.log 2>&1 && printf '[PASS]' || printf '[FAIL]' printf '\t%s\t%s\n' $i $state) | tee -a test.log done < $file diff --git a/tests/cc/execute/scc-tests.lst b/tests/cc/execute/scc-tests.lst @@ -1,267 +1,267 @@ -0001-sanity.c -0002-expr.c -0003-local.c -0004-pointer.c -0005-ifstmt.c -0006-whilestmt.c -0007-forstmt.c -0008-dowhilestmt.c -0009-expr.c -0010-goto.c -0011-assign.c -0012-expr.c -0013-addridx.c -0014-assignidx.c -0015-localarray.c -0016-addrarray.c -0017-struct.c -0018-structptr.c -0019-selfrefstruct.c -0020-ptrptr.c -0021-intfunc.c -0022-typedef.c -0023-global.c -0024-typedefstruct.c -0025-string.c -0026-implicitret.c -0027-charval.c -0028-bor.c -0029-band.c -0030-bxor.c -0031-relop.c -0032-indec.c -0033-ptrindec.c -0034-logandor.c -0035-breakcont.c -0036-notneg.c -0037-assignop.c -0038-ptradd.c -0039-sizeof.c -0040-cast.c -0041-queen.c -0042-prime.c -0043-union.c -0044-struct.c -0045-struct.c -0046-inits.c -0048-inits.c -0049-inits.c -0050-inits.c -0052-switch.c -0053-struct.c -0054-struct.c -0055-enum.c -0056-enum.c -0057-duff.c -0058-bug.c -0059-multistring.c -0060-charlit.c -0061-comments.c -0062-include.c -0063-define.c -0064-sysinclude.c -0065-ifdef.c -0066-cppelse.c -0067-define.c -0068-funclikemacro.c -0069-funclikemacro.c -0070-cppif.c -0071-cppelif.c -0072-cppelif.c -0073-ifndef.c -0074-undef.c -0075-ptraddasn.c -0076-ptrsubasn.c -0077-defined.c -0078-dirifexpr.c -0079-cond.c -0080-arrays.c -0081-calls.c -0082-bug.c -0083-voidret.c -0084-longlong.c -0085-ulonglong.c -0089-short.c -0090-fptr.c -0091-fptr.c -0092-fptr.c -0093-arrayinit.c -0094-arrayinit.c -0095-arrayselector.c -0096-inferredarraysize.c -0097-extern.c -0098-tentative.c -0099-tentative.c -0102-decl.c -0103-voidparm.c -0104-qbebug.c -0105-shl.c -0106-ppcast.c -0107-bnot.c -0108-bug.c -0109-struct.c -0110-typedefcast.c -0111-doubledef.c -0112-cond.c -0113-externredecl.c -0114-shortassig.c -0115-null_comparision.c -0116-floatcmp.c -0117-pointarith.c -0118-voidmain.c -0119-macrostr.c -0120-funpar.c -0121-localinit.c -0122-localinit.c -0123-doubleconst.c -0124-enumstruct.c -0125-fundcl.c -0126-macropar.c -0127-doublecte.c -0128-kr_names.c -0129-initi.c -0130-mulpars.c -0131-hello.c -0132-forward.c -0133-ftn_ptr.c -0134-arith.c -0135-unary.c -0136-if.c -0137-int_cast.c -0138-namespace.c -0139-ptr_ary.c -0140-int_fold.c -0141-int_iden.c -0142-char_const.c -0143-int_const.c -0144-long_const.c -0145-llong_const.c -0146-ifdef.c -0147-intern_cpp.c -0148-cpp_string.c -0149-define.c -0150-define.c -0151-vararg.c -0152-cat.c -0153-cpp_string.c -0154-if_defined.c -0155-struct_compl.c -0156-duff2.c -0157-list.c -0158-ternary.c -0159-typedef.c -0160-cpp_if.c -0161-struct.c -0162-array.c -0163-array.c -0164-struct.c -0165-struct.c -0166-desig.c -0167-array.c -0168-array.c -0169-string.c -0170-line.c -0171-macros.c -0172-hexa.c -0173-macro.c -0174-decay.c -0175-defined.c -0176-macro.c -0177-literal.c -0178-include.c -0179-sizeof.c -0180-incomplete.c -0181-stringize.c -0182-voidcast.c -0183-negenum.c -0184-esc_macro.c -0185-esc_macro2.c -0186-dec_ary.c -0187-zero_struct.c -0188-multi_string.c -0189-cpp.c [TODO] -0190-enum_ary.c -0191-ary_addr.c -0192-ptrcmp.c -0193-incomplete.c -0194-vararg.c -0195-unexpected.c -0196-invalidchar.c -0197-cppcomment.c -0198-nullcpp.c -0199-voidpcast.c -0200-cpp.c -0201-cpp.c -0202-variadic.c -0203-comment.c -0204-cast.c -0205-cpparg.c -0206-initializer.c -0207-structcb.c -0208-sizeof.c -0209-dowhile.c -0210-flexible.c -0211-enum.c -0212-krtypes.c -0213-decay.c -0214-va_copy.c -0215-ret_struct.c -0216-initialize.c -0217-lchar.c -0218-initialize.c -0219-abbrev.c -0220-comma.c -0221-ifdef.c -0222-ifdef.c -0223-macro.c -0224-macro.c -0225-func.c -0226-pointer.c -0227-sizeof.c -0228-extrcast.c -0229-commalog.c -0230-init.c -0231-init.c -0232-cppmacro.c -0233-ifelif.c -0234-macro.c -0235-comment.c -0236-sizeof.c -0237-down.c -0238-align.c -0239-fcasts.c -0240-init.c -0241-init.c -0242-ternary.c -0243-ternary.c -0244-logic.c -0245-comma.c -0246-branch.c -0247-float.c -0248-enum.c -0249-mod.c -0250-div.c -0251-mul.c -0252-literal.c -0253-maxconst.c -0254-litchar.c -0255-init.c -0256-ary.c -0257-main.c -0258-variadic.c -0259-multichar.c -0260-macro.c -0261-macro.c -0262-macro.c -0263-macro.c -0264-wchar.c -0265-wchar.c -0266-wchar.c -0267-wchar.c -0268-string.c -0269-extern.c -0270-union.c -0271-struct.c -0272-div.c -0273-cpp.c -0274-loop.c +0001-sanity +0002-expr +0003-local +0004-pointer +0005-ifstmt +0006-whilestmt +0007-forstmt +0008-dowhilestmt +0009-expr +0010-goto +0011-assign +0012-expr +0013-addridx +0014-assignidx +0015-localarray +0016-addrarray +0017-struct +0018-structptr +0019-selfrefstruct +0020-ptrptr +0021-intfunc +0022-typedef +0023-global +0024-typedefstruct +0025-string +0026-implicitret +0027-charval +0028-bor +0029-band +0030-bxor +0031-relop +0032-indec +0033-ptrindec +0034-logandor +0035-breakcont +0036-notneg +0037-assignop +0038-ptradd +0039-sizeof +0040-cast +0041-queen +0042-prime +0043-union +0044-struct +0045-struct +0046-inits +0048-inits +0049-inits +0050-inits +0052-switch +0053-struct +0054-struct +0055-enum +0056-enum +0057-duff +0058-bug +0059-multistring +0060-charlit +0061-comments +0062-include +0063-define +0064-sysinclude +0065-ifdef +0066-cppelse +0067-define +0068-funclikemacro +0069-funclikemacro +0070-cppif +0071-cppelif +0072-cppelif +0073-ifndef +0074-undef +0075-ptraddasn +0076-ptrsubasn +0077-defined +0078-dirifexpr +0079-cond +0080-arrays +0081-calls +0082-bug +0083-voidret +0084-longlong +0085-ulonglong +0089-short +0090-fptr +0091-fptr +0092-fptr +0093-arrayinit +0094-arrayinit +0095-arrayselector +0096-inferredarraysize +0097-extern +0098-tentative +0099-tentative +0102-decl +0103-voidparm +0104-qbebug +0105-shl +0106-ppcast +0107-bnot +0108-bug +0109-struct +0110-typedefcast +0111-doubledef +0112-cond +0113-externredecl +0114-shortassig +0115-null_comparision +0116-floatcmp +0117-pointarith +0118-voidmain +0119-macrostr +0120-funpar +0121-localinit +0122-localinit +0123-doubleconst +0124-enumstruct +0125-fundcl +0126-macropar +0127-doublecte +0128-kr_names +0129-initi +0130-mulpars +0131-hello +0132-forward +0133-ftn_ptr +0134-arith +0135-unary +0136-if +0137-int_cast +0138-namespace +0139-ptr_ary +0140-int_fold +0141-int_iden +0142-char_const +0143-int_const +0144-long_const +0145-llong_const +0146-ifdef +0147-intern_cpp +0148-cpp_string +0149-define +0150-define +0151-vararg +0152-cat +0153-cpp_string +0154-if_defined +0155-struct_compl +0156-duff2 +0157-list +0158-ternary +0159-typedef +0160-cpp_if +0161-struct +0162-array +0163-array +0164-struct +0165-struct +0166-desig +0167-array +0168-array +0169-string +0170-line +0171-macros +0172-hexa +0173-macro +0174-decay +0175-defined +0176-macro +0177-literal +0178-include +0179-sizeof +0180-incomplete +0181-stringize +0182-voidcast +0183-negenum +0184-esc_macro +0185-esc_macro2 +0186-dec_ary +0187-zero_struct +0188-multi_string +0189-cpp [TODO] +0190-enum_ary +0191-ary_addr +0192-ptrcmp +0193-incomplete +0194-vararg +0195-unexpected +0196-invalidchar +0197-cppcomment +0198-nullcpp +0199-voidpcast +0200-cpp +0201-cpp +0202-variadic +0203-comment +0204-cast +0205-cpparg +0206-initializer +0207-structcb +0208-sizeof +0209-dowhile +0210-flexible +0211-enum +0212-krtypes +0213-decay +0214-va_copy +0215-ret_struct +0216-initialize +0217-lchar +0218-initialize +0219-abbrev +0220-comma +0221-ifdef +0222-ifdef +0223-macro +0224-macro +0225-func +0226-pointer +0227-sizeof +0228-extrcast +0229-commalog +0230-init +0231-init +0232-cppmacro +0233-ifelif +0234-macro +0235-comment +0236-sizeof +0237-down +0238-align +0239-fcasts +0240-init +0241-init +0242-ternary +0243-ternary +0244-logic +0245-comma +0246-branch +0247-float +0248-enum +0249-mod +0250-div +0251-mul +0252-literal +0253-maxconst +0254-litchar +0255-init +0256-ary +0257-main +0258-variadic +0259-multichar +0260-macro +0261-macro +0262-macro +0263-macro +0264-wchar +0265-wchar +0266-wchar +0267-wchar +0268-string +0269-extern +0270-union +0271-struct +0272-div +0273-cpp +0274-loop