aboutsummaryrefslogtreecommitdiff
path: root/tests/tests2
Commit message (Collapse)AuthorAgeFilesLines
* struct-init: Fix zero initialization with multi-level designatorsMichael Matz2017-05-062-0/+37
| | | | | | | See the added testcase. When one used designators like .a.x to initialize sub-members of members, and didn't then initialize all of them the required zero-initialization of the other sub-members wasn't done. The fix also enables tiny code cleanups.
* Fix unsigned enum bit-fieldsMichael Matz2017-05-052-0/+57
| | | | | | See testcase. If an enum has only positive values, fits N bits, and is placed in a N-bit bit-field that bit-fields must be treated as unsigned, not signed.
* Reorganize type parsingMichael Matz2017-05-021-0/+34
| | | | | Various corner cases for declarator parsing were incorrect. This reorganizes and fixes it, and somewhat simplifies it as well.
* 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
|
* updates & cleanups (tcc-doc/Changelog/TODO ...)grischka2017-02-1312-45/+45
| | | | | | | | | | | | | | | - tcc-doc.texi: commandline option info update - Changelog/TODO: update - tests/tcctest.py: removed - tests/Makefile: weaktest fixed - tests/tests2: some files renamed and/or converted to unix LF - configure/Makefile: --enable-static option (no dll on win32) - win32/build-tcc.bat: msvc support - win32/tcc-win32.txt: build info update - win32/vs2015/: VS solution removed - win32/include/tcc/tcc_libm.h: #include statement fixed - tcc.c: -include <file> option help info - .gitignore: cleanup
* 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-205-1/+74
| | | | | | | | | | 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-182-2/+15
| | | | | See testcase. Function pointer use was hosed when the destination function wasn't also called normally by the program.
* Fix initializing members multiple timesMichael Matz2016-12-152-0/+23
| | | | | | | When intializing members where the initializer needs relocations and the member is initialized multiple times we can't allow that to lead to multiple relocations to the same place. The last one must win.
* struct-init: Copy relocs for compound literalsMichael Matz2016-12-151-0/+29
| | | | | When copying the content of compound literals we must include relocations as well.
* opt: Start optimizing dead code a bitMichael Matz2016-12-152-0/+140
| | | | | | | If a condition is always zero/non-zero we can omit the then or else code. This is complicated a bit by having to deal with labels that might make such code reachable without us yet knowing during parsing.
* Fix more nocode_wanted jump problemsMichael Matz2016-12-152-0/+36
| | | | | | | In statement expression we really mustn't emit backward jumps under nocode_wanted (they will form infinte loops as no expressions are evaluated). Do-while and explicit loop with gotos weren't handled.
* struct-init: Support range inits for local varsMichael Matz2016-12-152-0/+5
| | | | Implement missing support for range init for local variables.
* struct-init: Allow member initialization from qualified lvaluesMichael Matz2016-12-152-3/+29
| | | | See testcase.
* struct-init: Correctly parse unnamed member initializersMichael Matz2016-12-152-0/+27
| | | | | | | | | | | | | For union U { struct {int a,b}; int c; }; union U u = {{ 1, 2, }}; The unnamed first member of union U needs to actually exist in the structure so initializer parsing isn't confused about the double braces. That means also the a and b members must be part of _that_, not of union U directly. Which in turn means we need to do a bit more work for field lookup. See the testcase extension for more things that need to work.
* struct-init: CleanupMichael Matz2016-12-153-1/+13
| | | | | | | 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-153-1/+167
| | | | | | 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.
* tccgen: 32bits: fix PTR +/- long longgrischka2016-10-132-0/+16
| | | | | | | | | | | | | | | | | | | | | | | Previously in order to perform a ll+ll operation tcc was trying to 'lexpand' PTR in gen_opl which did not work well. The case: int printf(const char *, ...); char t[] = "012345678"; int main(void) { char *data = t; unsigned long long r = 4; unsigned a = 5; unsigned long long b = 12; *(unsigned*)(data + r) += a - b; printf("data %s\n", data); return 0; }
* Use ISO C string functions instead of obsolete BSD ones that used to be in ↵Christian Jullien2016-10-122-8/+3
| | | | 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)
* Fix test for __*LP*__ predefined macrosChristian Jullien2016-09-251-11/+11
|
* Add test for __*LP*__ predefined macrosChristian Jullien2016-09-252-0/+39
|
* tests/tests2/Makefile: Make 85-asm-outside-function Intel-only.Edmund Grimley Evans2016-05-041-0/+3
|
* __asm__() outside functionseyko2016-05-012-0/+7
| | | | | | | | gcc/pcc allow __asm__() outside a function body: extern void vide(void); __asm__("vide: ret"); There is many such code in the Linux kernels.
* output space after TOK_PPNUM which followed by '+' or '-'seyko2016-05-012-0/+13
| | | | | | * correct -E output for the case ++ + ++ concatenation do this only for expanded from macro string and only when tcc_state->output_type == TCC_OUTPUT_PREPROCESS
* 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.
* tccgen.c: Allow type attributes to prefix enum/struct/union nameVlad Vissoultchev2016-04-062-0/+14
| | | | | | From gcc docs: "You may also specify attributes between the enum, struct or union tag and the name of the type rather than after the closing brace." Adds `82_attribs_position.c` in `tests/tests2`
* utf8 in identifiersseyko2016-04-052-0/+11
| | | | | | | | | | | | | | made like in pcc (pcc.ludd.ltu.se/ftp/pub/pcc-docs/pcc-utf8-ver3.pdf) We treat all chars with high bit set as alphabetic. This allow code like #include <stdio.h> int Lefèvre=2; int main() { printf("Lefèvre=%d\n",Lefèvre); return 0; }
* nocode_wanted with while/for inside ({})seyko2016-04-052-0/+90
| | | | a test included.
* Fix type parsingMichael Matz2016-03-243-1/+10
| | | | | | the check on incomplete struct/union/enum types was too early, disallowing mixed specifiers and qualifiers. Simply rely on the size (->c) field for that. See testcases.
* Fix tests Makefiles on WindowsVlad Vissoultchev2016-03-141-0/+4
| | | | Compiled tcc.exe location is under $(top_srcdir)/win32
* tccgen.c: Fix flex array members some moreMichael Matz2016-03-112-0/+25
| | | | Last fix didn't work for function f1int in the added testcase.
* tccgen.c: In parse_btype, handle type qualifiers applied to arrays.Edmund Grimley Evans2016-01-111-0/+16
| | | | Also add some test cases in tests/tests2/39_typedef.c.
* tccgen.c: Try to make sizeof(!x) work.Edmund Grimley Evans2015-11-222-0/+3
| | | | tests/tests2/27_sizeof.*: Add test.
* tccgen.c: Bug fix for 992cbda and 3ff77a1: set nocode_wanted.Edmund Grimley Evans2015-11-212-0/+13
| | | | tests/tests2/78_vla_label.*: Add test.
* Improve constant propagation with "&&" and "||".Edmund Grimley Evans2015-11-201-1/+5
|
* tccgen.c: Recognise constant expressions with conditional operator.Edmund Grimley Evans2015-11-201-3/+14
| | | | tests/tests2/78_vla_label.c: Check that int a[1 ? 1 : 1] is not a VLA.
* tests/tests2/79_vla_continue.c: Fix off-by-one error.Edmund Grimley Evans2015-11-131-2/+2
|
* 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-0911-113/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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)