aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* tcc -vv/--print-search-dirs: print more infogrischka2013-02-101-4/+9
| | | | | | | | | | | | | | tests/Makefile: - print-search-dirs when 'hello' fails - split off hello-run win32/include/_mingw.h: - fix for compatibility with mingw headers (While our headers in win32 are from mingw-64 and don't have the problem) tiny_libmaker: - don't use "dangerous" mktemp
* lib/Makefile: use CC, add bcheck to libtcc1.agrischka2013-02-061-1/+1
| | | | | | | | Also: - fix "make tcc_p" (profiling version) - remove old gcc flags: -mpreferred-stack-boundary=2 -march=i386 -falign-functions=0 - remove test "hello" for Darwin (cannot compile to file)
* tests: cleanupgrischka2013-02-0511-294/+270
| | | | | | | | | | | | | | | | tests: - add "hello" to test first basic compilation to file/memory - add "more" test (tests2 suite) - remove some tests tests2: - move into tests dir - Convert some files from DOS to unix LF - remove 2>&1 redirection win32: - tccrun.c: modify exception filter to exit correctly (needed for btest) - tcctest.c: exclude weak_test() (feature does not exist on win32)
* tests2: move into testsgrischka2013-02-05112-0/+3052
|
* Don't do builtin_frame_address test with ARM gccThomas Preud'homme2013-01-261-0/+2
| | | | | | | | gcc fails the builtin_frame_address test on ARM so we disable it. As a consequence, the diff between gcc and tcc's output is unecessarily bigger. Given the big size of the diff currently, this doesn't make a big difference but may allow to detect a regression in tcc's implementation of builtin_frame_address.
* Use gcc to generate tcctest.gccThomas Preud'homme2013-01-251-1/+1
|
* Stop returning 0 in cmp_comparison_testThomas Preud'homme2013-01-061-1/+0
| | | | cmp_comparison_test has no return value and should thus not return 0.
* build: fix VPATH buildsAkim Demaille2012-12-181-6/+7
| | | | | | | | | | * configure (fn_dirname): New. Use it to ensure the creation of proper symlinks to Makefiles. (config.mak): Define top_builddir and top_srcdir. (CPPFLAGS): Be sure to find the headers. * Makefile, lib/Makefile, tests/Makefile, tests2/Makefile: Adjust to set VPATH properly. Fix confusion between top_builddir and top_srcdir.
* tests: Add tests for compile/run tcc.c with `tcc -b` then compile tcc.c ↵Kirill Smelkov2012-12-091-1/+22
| | | | | | | | again, then run tcctest.c Just like with test[123] add their test[123]b variants. After previous 3 patchs all test pass here on Debian GNU/Linux on i385 with gcc-4.7 with or without memory randomization turned on.
* tests: btest should only run on targets supporting bcheckKirill Smelkov2012-11-241-0/+5
| | | | | | | | | | | | After 40a54c43 (Repair bounds-checking runtime), and in particular 5d648485 (Now btest pass!) `make test` was broken on ARCH != i386, because I've changed btest to unconditionally run on all arches. But bounds-checking itsels is only supported on i386 and oops... Fix it. Reported-by: Thomas Preud'homme <robotux@celest.fr>
* Add support for __builtin_frame_address(level)Kirill Smelkov2012-11-162-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing d6072d37 (Add __builtin_frame_address(0)) implement __builtin_frame_address for levels greater than zero, in order for tinycc to be able to compile its own lib/bcheck.c after cffb7af9 (lib/bcheck: Prevent __bound_local_new / __bound_local_delete from being miscompiled). I'm new to the internals, and used the most simple way to do it. Generated code is not very good for levels >= 2, compare gcc tcc level=0 mov %ebp,%eax lea 0x0(%ebp),%eax level=1 mov 0x0(%ebp),%eax mov 0x0(%ebp),%eax level=2 mov 0x0(%ebp),%eax mov 0x0(%ebp),%eax mov (%eax),%eax mov %eax,-0x10(%ebp) mov -0x10(%ebp),%eax mov (%eax),%eax level=3 mov 0x0(%ebp),%eax mov 0x0(%ebp),%eax mov (%eax),%eax mov (%eax),%ecx mov (%eax),%eax mov (%ecx),%eax But this is still an improvement and for bcheck we need level=1 for which the code is good. For the tests I had to force gcc use -O0 to not inline the functions. And -fno-omit-frame-pointer just in case. If someone knows how to improve the generated code - help is appreciated. Thanks, Kirill Cc: Michael Matz <matz@suse.de> Cc: Shinichiro Hamaji <shinichiro.hamaji@gmail.com>
* Now btest pass!Kirill Smelkov2012-11-131-1/+0
| | | | | | Thanks to two previous commits now btest tests pass, at least on Linux. Signed-off-by: Kirill Smelkov <kirr@navytux.spb.ru>
* Honour *FLAGS everywhereThomas Preud'homme2012-11-061-5/+5
| | | | Add CPPFLAGS, CFLAGS and LDFLAGS everywhere it's missing.
* tccrun: another incompatible change to the tcc_relocate APIgrischka2012-09-011-1/+1
| | | | | | We are now compatible with the 0.9,25 version though. A special value for the second (ptr) argument is used to get the simple behavior as with the 0.9.24 version.
* Disable callsave_test for armThomas Preud'homme2012-07-301-0/+2
| | | | | Disable callsave_test for arm since it uses alloca which is unavailable on this platform.
* tests: Minor adjustments selecting which tests are run on each platform.Milutin Jovanović2012-06-271-9/+31
| | | | | | | | | | | The intent is for 'make test' to pass cleanly on each platform, and thus easier spotting of regressions. Linux is best supported by most tests running and passing. Mac OSX passes mosts tests that do not make/link with binary files, due to lack of mach-o file support. !!! I have very limited knowledge of Windows platform, and cannot comment why all tests(1) fail. I have posted to newsgroup asking for someone to test Windows platform.
* x86-64: Fix call saved register restoreMichael Matz2012-06-101-0/+20
| | | | | | Loads of VT_LLOCAL values (which effectively represent saved addresses of lvalues) were done in VT_INT type, loosing the upper 32 bits. Needs to be done in VT_PTR type.
* x86_64: Fix compares with NaNs.Michael Matz2012-05-131-0/+66
| | | | | | Comparisons with unordered doubles was broken, NaNs always compare unequal (and unordered) to everything, including to itself.
* Fix comparing comparisonsMichael Matz2012-04-181-0/+30
| | | | | | | | | | | Sometimes the result of a comparison is not directly used in a jump, but in arithmetic or further comparisons. If those further things do a vswap() with the VT_CMP as current top, and then generate instructions for the new top, this most probably destroys the flags (e.g. if it's a bitfield load like in the example). vswap() must do the same like vsetc() and not allow VT_CMP vtops to be moved down.
* Make sizeof() be of type size_tMichael Matz2012-04-181-0/+16
| | | | | | | | This matters when sizeof is directly used in arithmetic, ala "uintptr_t t; t &= -sizeof(long)" (for alignment). When sizeof isn't size_t (as it's specified to be) this masking will truncate the high bits of the uintptr_t object (if uintptr_t is larger than uint).
* Fix parsing function macro invocationsMichael Matz2012-04-181-0/+4
| | | | | | If a function macro name is separated from the parentheses in an macro invocation the substitution doesn't take place. Fix this by handling comments.
* Fix detection of labels with a typedef nameMichael Matz2012-04-181-0/+3
| | | | | | | | | | | | | | This needs to be accepted: typedef int foo; void f (void) { foo: return; } namespaces for labels and types are different. The problem is that the block parser always tries to find a decl first and that routine doesn't peek enough to detect this case. Needs some adjustments to unget_tok() so that we can call it even when we already called it once, but next() didn't come around restoring the buffer yet. (It lazily does so not when the buffer becomes empty, but rather when the next call detects that the buffer is empty, i.e. it requires two next() calls until the unget buffer gets switched back).
* x86_64: Fix segfault for global dataMichael Matz2012-04-181-0/+30
| | | | | | | | | | | When offsetted addresses of global non-static data are computed multiple times in the same statement the x86_64 backend uses gen_gotpcrel with offset, which implements an add insn on the register given. load() uses the R member of the to-be-loaded value, which doesn't yet have a reg assigned in all cases. So use the register we're supposed to load the value into as that register.
* x86_64: Fix indirection in struct paramatersMichael Matz2012-04-181-12/+17
| | | | | | | | | | | | | The first loop setting up struct arguments must not remove elements from the vstack (via vtop--), as gen_reg needs them to potentially evict some argument still held in registers to stack. Swapping the arg in question to top (and back to its place) also simplifies the vstore call itself, as not funny save/restore or some "non-existing" stack elements need to be done. Generally for a stack a vop-- operation conceptually clobbers that element, so further references to it aren't allowed anymore.
* Fix bitfield loads into char/short.Michael Matz2012-04-181-0/+5
| | | | | | Removes a premature optimization of char/short loads rewriting the source type. It did so also for bitfield loads, thereby removing all the shifts/maskings.
* Fix conversion in a?0:ptr.Michael Matz2012-04-181-0/+13
| | | | | | (cond ? 0 : ptr)->member wasn't handled correctly. If one arm is a null pointer constant (which also can be a pointer) the result type is that of the other arm.
* cleanup some partially broken patchesgrischka2012-04-181-2/+2
| | | | | | | | | | | | | | | | | | | - tests/Makefile: fix commit de54586d5b45800e26952ec77b4f51ad4c1e0079 This hunk it unrelated to the other changes (which are about MacOSX). It is not useful and partially wrong. Optional tests are meant to stay optional, btest would work only for i386 - tcc.h: fix commit c52d79605a3c895a16e18f0b7193f1f4b480a60f by unknown The message says it's for MINTW but the patch has obviously no effect for MINGW (which defines __GNUC__). However the patch seems useful for MSC which however needs _strto(u)i64 with underscore. - Makefile: fix commit 5280293d6b16bbe24dfda76e37f32322fa2874ca Do not build tcc.o with -DONE_SOURCE because we finally build tcc from tcc.o and libtcc.a/so
* Further changes improving the OSX build. Everything builds. libtest passes.Milutin Jovanovic2012-03-061-2/+8
| | | | | | | | | | | | | | | | | | | | Other tests still have issues, currently with weak linking. One of the primary stumbling blocks on OSX is the lack of support for mach-o binaries. Therefore all tcc usage on OSX has to be limited to elf binaries, presumably produced by tcc itself. Therefore I had to enable building of tiny_libmaker for OSX. Then changed the make to use tcc and tiny_libmaker to compile the tcclib1. In order to compile the tests, specifically the parts that use weak linking, I have had to define MACOSX_DEPLOYMENT_TARGET to 10.2, which seems like a hack, but extensive searching seems to indicate that this is the only way to make apple gcc allow weak linking. Using any other value, bigger or smaller breaks weak linking. Also added _ANSI_SOURCE define required by some OSX headers, and some cosmetic gitignore changes. I believe these changes should not impact other platforms.
* Patch attempting to build OSX TinyCC.Milutin Jovanovic2012-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Applied patch found on stackoverflow (link below). I also found some related changes that looked like logically needed. The stackoverflow changes addressed only two registers which were breaking a compile. However reading the code in the same file shows two other register accesses that, while not breaking the build, should have the same fix. http://stackoverflow.com/questions/3712902/problems-compiling-tcc-on-os-x/3713144#3713144 The test driver was changed by changing 'cp -u' into 'cp' as '-u' is not supported on mac osx. I found that osx build required the WITHOUT_LIBTCC define. I suspect the reason for this is tcc unability to handle mach-o files. In order to properly address this I had to change 'configure' to propagate target os name to Makefile. Current state is that simple tests work, but not the whole 'make test' suite runs. To the best of my knowledge, these changes should not impact other platforms.
* tcctest: switch weak_toolate proto with implgrischka2011-08-061-1/+1
| | | | gcc -O0 didn't like this.
* fixed Makefile test targetsJoe Soroka2011-07-221-1/+1
|
* re-added negative-array-size testcase and fixed fix for itJoe Soroka2011-07-221-0/+2
|
* Revert "better constant handling for expr_cond"grischka2011-07-161-2/+0
| | | | | It produced wrong code with one of my test projects. This reverts commit cd3d1a45f34be3c9a358f1743bcaf8aac897992e.
* Fix array_test: move params to local varsThomas Preud'homme2011-07-121-2/+2
| | | | | | | | | | array_test is declared and called with no parameters but defined with one parameter. Compilation succeed (definition is after the use so the compiler consider the declaration) as well as link (the function exist and has the right name) but running the test segfault on i386 platforms. This patch moves the parameter to local variable. If the intention was to call it with an array parameter then feel free to fix it again.
* handle arrays with a flexible member but no initializerJoe Soroka2011-07-111-1/+3
|
* better constant handling for expr_condJoe Soroka2011-07-111-0/+2
|
* fix self-referential token pastingJoe Soroka2011-07-081-0/+6
|
* fix end-of-scope for self-referential macrosJoe Soroka2011-07-081-2/+1
|
* make test work when LIBTCC1 not definedThomas Preud'homme2011-05-171-1/+5
| | | | | Make libtest depends on LIBTCC1 instead of ../libtcc1.a and define LIBTCC1 to $(TOP)/$(LIBTCC1) if LIBTCC1 is defined
* VLA fix [1/3]: added testcase demonstrating VLA bugJoe Soroka2011-04-081-1/+6
|
* VLA bcheck works via bound alloca; add test, remove warningJoe Soroka2011-04-061-1/+33
|
* re-apply VLA by Thomas Preud'hommeJoe Soroka2011-04-061-0/+22
|
* sizeof(struct with "flexible array member") is wrongJoe Soroka2011-03-181-0/+1
|
* fix c99 for-loop init decl scope (thanks: grischka)Joe Soroka2011-03-081-0/+2
| | | | see http://lists.nongnu.org/archive/html/tinycc-devel/2011-03/msg00005.html
* support c99 for-loop init declsJoe Soroka2011-03-072-1/+5
|
* use new weaken_symbol() to fix another real-world corner caseJoe Soroka2011-03-071-0/+3
|
* weak redefinition of a symbol should weaken the originalJoe Soroka2011-03-071-0/+4
|
* __typeof(t) should not include storage modifiers of tJoe Soroka2011-03-061-0/+5
|
* handle post-asm-label attributes on variablesJoe Soroka2011-03-031-0/+14
|
* tcc: fix weak attribute handlingJoe Soroka2011-03-021-0/+8
|