aboutsummaryrefslogtreecommitdiff
path: root/tests/tests2/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* tccgen: nodata_wanted fix, default ONE_SOURCE, etc...grischka2017-07-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | tccgen.c: doubles need to be aligned, on ARM. The section_reserve() in init_putv does not do that. -D ONE_SOURCE: is now the default and not longer needed. Also, tcc.h now sets the default native target. These both make compiling tcc simple as "gcc tcc.c -o tcc -ldl" again. arm-asm.c: enable pseudo asm also for inline asm tests/tests2/Makefile: disable bitfield tests except on windows and x86_64 and don't generate-always tcc.c: fix a loop with -dt on errors configure: print compiler version (as recognized) tccpp.c: actually define symbols for tcc -dt clear static variables (needed for -dt or libtcc usage) 96_nodata_wanted.c: use __label__ instead of asm lib/files: use native symbols (__i386__ etc.) instead of TCC_TARGET_...
* tcc -dt -run ... : simpler is bettergrischka2017-07-201-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * -dt now with lowercase t * test snippets now separated by real preprocessor statements which is valid C also for other compilers #if defined test_xxx < test snippet x > #elif defined test_yyy < test snippet y > #elif ... #endif * simpler implementation, behaves like -run if no 'test_...' macros are seen, works with -E too * for demonstration I combined some of the small tests for errors and warnings (56..63,74) in "60_errors_and_warnings.c" Also: * libtcc.c: put tcc_preprocess() and tcc_assemble() under the setjmp clause to let them return to caller after errors. This is for -dt -E. * tccgen.c: - get rid of save/restore_parse_state(), macro_ptr is saved by begin_macro anyway, now line_num too. - use expr_eq for parsing _Generic's controlling_type - set nocode_wanted with const_wanted. too, This is to keep VT_JMP on vtop when parsing preprocessor expressions. * tccpp.c: tcc -E: suppress trailing whitespace from lines with comments (that -E removes) such as NO_GOTPLT_ENTRY,\t /* never generate ... */
* tccgen: nodata_wantedgrischka2017-07-161-40/+51
| | | | | | | | | | | | | | | | | | | | | | | | The existing variable 'nocode_wanted' is now used to control output of static data too. So... (nocode_wanted == 0) code and data (normal within functions) (nocode_wanted < 0) means: no code, but data (global or static data) (nocode_wanted > 0) means: no code and no data (code and data suppressed) (nocode_wanted & 0xC0000000) means: we're in declaration of static data Also: new option '-dT' to be used with -run tcc -dT -run file.c This will look in file.c for certain comment-boundaries: /*-* test-xxx: ...some description */ and then for each test below run it from memory. This way various features and error messages can be tested with one single file. See 96_nodata_wanted.c for an example. Also: tccgen.c: one more bitfield fix
* #pragma comment(option,"-..."), bitfields test, etc...grischka2017-07-141-12/+44
| | | | | | | | | | | | | | | | | | tccpp.c: * #pragma comment(option,"-some-option") to set commandline option from C code. May work only for some options. libtcc.c: * option "-d1..9": sets a 'g_debug' global variable. (for development) tests2/Makefile: * new make targets: tests2.37 / tests2.37+ run single test from tests2, optionally update .expect * new variable GEN-ALWAYS to always generate certain .expects * bitfields test tccgen.c: * bitfields: fix a bug and improve slightly more * _Generic: ignore "type match twice"
* final adjustments for releasegrischka2017-04-251-17/+16
| | | | | | | | | | | | | | | | | | | | | - configure/Makefiles: minor adjustments - build-tcc.bat: add -static to gcc options (avoids libgcc_s*.dll dependency with some mingw versions) - tccpe.c/tcctools.c: eliminate MAX_PATH (not available for cross compilers) - tccasm.c: use uint64_t/strtoull in unary() (unsigned long sometimes is only uint32_t, as always on windows) - tccgen.c: Revert (f077d16c) "tccgen: gen_cast: cast FLOAT to DOUBLE" Was a rather experimental, tentative commit, not really necessary and somewhat ugly too. - cleanup recent osx support: - Makefile/libtcc.c: cleanup copy&paste code - tccpp.c: restore deleted function
* makefile: unify cross with native buildsgrischka2017-02-251-8/+1
| | | | | | | | | | | | | supports building cross compilers on the fly without need for configure --enable-cross $ make cross # all compilers $ make cross-TARGET # only TARGET-compiler & its libtcc1.a with TARGET one from i386 x86_64 i386-win32 x86_64-win32 arm arm64 arm-wince c67 Type 'make help' for more information
* tcc: re-enable correct option -r supportgrischka2017-02-201-2/+2
| | | | | | | | | | | | | | | Forgot about it. It allows to compile several sources (and other .o's) to one single .o file; tcc -r -o all.o f1.c f2.c f3.S o4.o ... Also: - option -fold-struct-init-code removed, no effect anymore - (tcc_)set_environment() moved to tcc.c - win32/lib/(win)crt1 minor fix & add dependency - debug line output for asm (tcc -c -g xxx.S) enabled - configure/Makefiles: x86-64 -> x86_64 changes - README: cleanup
* win32: adjust new unicode supportgrischka2017-02-181-6/+4
| | | | | | | | | | | | | | | | | | | - lib/Makefile: add (win)crt1_w.o - crt1.c/_runtmain: return to tcc & only use for UNICODE (because it might be not 100% reliable with for example wildcards (tcc *.c -run ...) - tccrun.c/tccpe.c: load -run startup_code only if called from tcc_run(). Otherwise main may not be defined. See libtcc_test.c - tests2/Makefile: pass extra options in FLAGS to allow overriding TCC Also: - tccpe.c: support weak attribute. (I first tried to solve the problem above by using it but then didn't)
* Temporary remove 76_dollards_in_identifiers when run on Windows as this test ↵Christian Jullien2017-02-181-0/+3
| | | | failes. To be checked why.
* Fix wrong name for 85 test.Christian Jullien2017-02-151-1/+1
|
* Fix testsuite invocationsMichael Matz2017-02-111-2/+2
| | | | | | The return code of $(FILTER) clobbers the return code of TCC itself. So just prepend messages to the generated output file and ignore return codes.
* update VERSION to 0.9.27grischka2017-02-081-1/+1
| | | | | | | | | Also: - in tests: generate .expect files only if not yet present, because 1) some files were adjusted manually 2) switching git branche might change timestamps and cause unwanted update
* Fix some code suppression falloutMichael Matz2016-12-201-1/+1
| | | | | | | | | | Some more subtle issues with code suppression: - outputting asms but not their operand setup is broken - but global asms must always be output - statement expressions are transparent to code suppression - vtop can't be transformed from VT_CMP/VT_JMP when nocode_wanted Also remove .exe files from tests2 if they don't fail.
* tests: add memory leak testgrischka2016-12-181-1/+1
| | | | | | | | | | | | | Also ... tcctest.c: - exclude stuff that gcc doesn't compile on windows. libtcc.c/tccpp.c: - use unsigned for memory sizes to avoid printf format warnings - use "file:line: message" to make IDE error parsers happy. tccgen.c: fix typo
* Fix gawk miscompileMichael Matz2016-12-181-1/+10
| | | | | See testcase. Function pointer use was hosed when the destination function wasn't also called normally by the program.
* struct-init: CleanupMichael Matz2016-12-151-1/+1
| | | | | | | Remove dead code and variables. Properly check for unions when skipping fields in initializers. Make tests2/*.expect depend on the .c files so they are automatically rebuilt when the latter change.
* struct-init: Implement initializing subaggregatesMichael Matz2016-12-151-1/+1
| | | | | | E.g. "struct { struct S s; int a;} = { others, 42 };" if 'others' is also a 'struct S'. Also when the value is a compound literal. See added testcases.
* Use ISO C string functions instead of obsolete BSD ones that used to be in ↵Christian Jullien2016-10-121-4/+0
| | | | strings.h. It allows more systems -- i.e. Windows -- to use those tests
* build: restore out-of-tree supportgrischka2016-10-011-11/+11
|
* build: revert Makefiles to 0.9.26 state (mostly)grischka2016-10-011-18/+6
| | | | | | | | | | | | Except - that libtcc1.a is now installed in subdirs i386/ etc. - the support for arm and arm64 - some of the "Darwin" fixes - tests are mosly unchanged Also - removed the "legacy links for cross compilers" (was total mess) - removed "out-of-tree" build support (was broken anyway)
* tests/tests2/Makefile: Make 85-asm-outside-function Intel-only.Edmund Grimley Evans2016-05-041-0/+3
|
* Run testcases in sorted orderMichael Matz2016-04-221-1/+1
| | | | | Without sorting they run in whatever order readdir returns, I like it better when the order is reliable (and alphanumeric).
* Revert "Fix tests Makefiles on Windows"Vlad Vissoultchev2016-04-171-4/+0
| | | | This reverts commit fa2472c17246206ce6947475782de17245eceeea.
* Fix tests Makefiles on WindowsVlad Vissoultchev2016-03-141-0/+4
| | | | Compiled tcc.exe location is under $(top_srcdir)/win32
* Revert all of my changes to directories & codingstyle.gus knight2015-07-291-3/+3
|
* Reorganize the source tree.gus knight2015-07-271-3/+3
| | | | | | | | | | * Documentation is now in "docs". * Source code is now in "src". * Misc. fixes here and there so that everything still works. I think I got everything in this commit, but I only tested this on Linux (Make) and Windows (CMake), so I might've messed something up on other platforms...
* tccpp: fix issues, add testsgrischka2015-05-091-87/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix some macro expansion issues * add some pp tests in tests/pp * improved tcc -E output for better diff'ability * remove -dD feature (quirky code, exotic feature, didn't work well) Based partially on ideas / researches from PipCet Some issues remain with VA_ARGS macros (if used in a rather tricky way). Also, to keep it simple, the pp doesn't automtically add any extra spaces to separate tokens which otherwise would form wrong tokens if re-read from tcc -E output (such as '+' '=') GCC does that, other compilers don't. * cleanups - #line 01 "file" / # 01 "file" processing - #pragma comment(lib,"foo") - tcc -E: forward some pragmas to output (pack, comment(lib)) - fix macro parameter list parsing mess from a3fc54345949535524d01319e1ca6378b7c2c201 a715d7143d9d17da17e67fec6af1c01409a71a31 (some coffee might help, next time ;) - introduce TOK_PPSTR - to have character constants as written in the file (similar to TOK_PPNUM) - allow '\' appear in macros - new functions begin/end_macro to: - fix switching macro levels during expansion - allow unget_tok to unget more than one tok - slight speedup by using bitflags in isidnum_table Also: - x86_64.c : fix decl after statements - i386-gen,c : fix a vstack leak with VLA on windows - configure/Makefile : build on windows (MSYS) was broken - tcc_warning: fflush stderr to keep output order (win32)
* VLA fix: save stack pointer right after modificationPhilip2015-04-281-3/+3
| | | | | | | | | | | | | | | | This patch disables the optimization of saving stack pointers lazily, which didn't fully take into account that control flow might not reach the stack-saving instructions. I've decided to leave in the extra calls to vla_sp_save() in case anyone wants to restore this optimization. Tests added and enabled. There are two remaining bugs: VLA variables can be modified, and jumping into the scope of a declared VLA will cause a segfault rather than a compiler error. Both of these do not affect correct C code, but should be fixed at some point. Once VLA variables have been made properly immutable, we can share them with the saved stack pointer and save stack and instructions.
* fix VLA/continue issuePhilip2015-04-271-2/+3
| | | | | | | | | | | | | | | | | | as reported in http://lists.nongnu.org/archive/html/tinycc-devel/2015-04/msg00131.html. Note that this is one of two separate VLA bugs: A. labels aren't reached by program execution, so the stack pointer is never saved B. continue doesn't restore the stack pointer as goto does This fixes only B. I'm not sure whether the same issue applies to break as well as continue. Add a test case, but disable tests #78 and #79 for now as they're not fully fixed until the issue described in http://lists.nongnu.org/archive/html/tinycc-devel/2015-04/msg00110.html is resolved.
* add test case for VLA segfaultsPhilip2015-04-271-1/+2
| | | | | | | | | This test obviously shouldn't segfault, but currently does so. The problem is in the VLA code, which fails to save the stack pointer before taking a conditional branch in some cases. See this thread: http://lists.nongnu.org/archive/html/tinycc-devel/2015-04/msg00130.html
* a test for the #pragma push/pop_macroseyko2015-04-251-1/+2
|
* Revert "* and #pragma pop_macro("macro_name")"grischka2015-04-231-2/+1
| | | | | | | | | | | | - pop_macro incorrect with initially undefined macro - horrible implementation (tcc_open_bf) - crashes eventually (abuse of Sym->prev_tok) - the (unrelated) asm_label part is the opposite of a fix (Despite of its name this variable has nothing to do with the built-in assembler) This reverts commit 0c8447db7970813292a8be74ee50e49091be5d15.
* * and #pragma pop_macro("macro_name")seyko2015-04-211-1/+2
| | | | | | | | | | * give warning if pragma is unknown for tcc * don't free asm_label in sym_free(), it's a job of the asm_free_labels(). The above pragmas are used in the mingw headers. Thise pragmas are implemented in gcc-4.5+ and current clang.
* -fdollar-in-identifiers addonseyko2015-04-201-4/+8
| | | | | | | * disable a -fdollar-in-identifiers option in assembler files * a test is added This is a patch addon from Daniel Holden.
* A right fix for the array in struct initialization w/o '{'seyko2015-03-231-1/+2
| | | | | Parse a type if there is only one '(' before a type token. Otherwise a recursion will perform a job.
* skip 73_arm64,test on ARCH=x86-64: it fails on this ARCHseyko2015-03-201-0/+3
|
* Add some missing nocode_wanted guardThomas Preud'homme2015-03-101-0/+1
| | | | | | int i = i++ causes a segfault because of missing guard. Looking recursively at all backend functions called from middle end several more guard appeared to be missing.
* Disable floating-point test for ARM soft-floatseyko2015-03-041-0/+3
| | | | | | | | | | | From: Matteo Cypriani <mcy@lm7.fr> Date: Fri, 5 Sep 2014 23:22:56 -0400 Subject: Disable floating-point test for ARM soft-float tcc is not yet capable of doing softfloat floating-point operations on ARM, therefore we disable this test for these platforms. Note that tcc displays a warning to warn ARM users about this limitation (debian)
* Add 73_arm64 for testing some arm64 things, mostly PCS.Edmund Grimley Evans2015-02-251-0/+1
|
* The "open a whisky and cut your finger open" patchThomas Preud'homme2015-02-181-3/+4
| | | | Make integer constant parsing C99 compliant
* Fix macro expansion of empty args.Reimar Döffinger2015-01-181-1/+3
| | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* Fix parsing of binary floating point numberLee Duhem2014-12-151-1/+2
| | | | | | | * tccpp.c (parse_number): `shift' should be 1 while parsing binary floating point number. * tests/tests2/70_floating_point_literals.c: New test cases for floating point number parsing.
* Filter-out warning about softfloat in tests2Matteo Cypriani2014-10-171-2/+2
|
* Clear CFLAGS & LDFLAGS in testsMatteo Cypriani2014-09-071-0/+4
| | | | | | Clear CFLAGS and LDFLAGS to build the tests, in case the main Makefile passes some flags that aren't handled by tcc (we are not compiling tcc here, we are using tcc to compile the tests).
* Rename:jiang2014-07-011-2/+2
| | | | | | 68_macro_concat.c -> 68_macro_param_list_err_1.c 69_macro_concat.c -> 69_macro_param_list_err_2.c and Remove spaces
* bug:jiang2014-06-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ---------------------------------------------------------------------- #define hexCh(c (c >= 10 ? 'a' + c - 10 : '0' + c) hexCh(c); out: jiang@jiang:~/test$ ./tcc -E c4.c # 1 "c4.c" (c >= 10 ? 'a' + c - 10 : '0' + c); --------------------------------------------------------------- #define hexCh(c/3) (c >= 10 ? 'a' + c - 10 : '0' + c) hexCh(c); out: jiang@jiang:~/test$ ./tcc -E c4.c # 1 "c4.c" /3) (c >= 10 ? 'a' + c - 10 : '0' + c); jiang@jiang:~/test$ after patch: # 1 "c4.c" c4.c:1: error: may not appear in macro parameter list: "(" jiang@jiang:~/test$ jiang@jiang:~/test$ ./tcc -E c4.c # 1 "c4.c" c4.c:1: error: may not appear in macro parameter list: "/" jiang@jiang:~/test$
* tests2: fix and enable 46_grep test.minux2014-04-121-3/+2
|
* tests2: fix 30_hanoi test and enable it.minux2014-04-121-1/+1
|
* Fix preprocessor concat with empty argThomas Preud'homme2014-04-121-1/+2
|
* Prevent ## to appear at start or end of macroThomas Preud'homme2014-04-081-1/+3
|