| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
| |
Without sorting they run in whatever order readdir returns,
I like it better when the order is reliable (and alphanumeric).
|
| |
|
|
| |
This reverts commit fa2472c17246206ce6947475782de17245eceeea.
|
| |
|
|
| |
Compiled tcc.exe location is under $(top_srcdir)/win32
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
* 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...
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| |
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
| |
* disable a -fdollar-in-identifiers option in assembler files
* a test is added
This is a patch addon from Daniel Holden.
|
| |
|
|
|
| |
Parse a type if there is only one '(' before a type token.
Otherwise a recursion will perform a job.
|
| | |
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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)
|
| | |
|
| |
|
|
| |
Make integer constant parsing C99 compliant
|
| |
|
|
| |
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
|
| |
|
|
|
|
|
| |
* 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.
|
| | |
|
| |
|
|
|
|
| |
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).
|
| |
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
----------------------------------------------------------------------
#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$
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
- remove -norunsrc switch
Meaning and usage (-run -norun...???) look sort of screwed. Also
general usefulness is unclear, so it was actually to support exactly
one (not even very interesting) test
This partially reverts e31579b0769e1f9c0947d12e83316d1149307b1a
|
| |
|
|
|
| |
gcc/mingw produces msvc compatible pecoff objects, tcc only
knows ELF.
|
| |
|
|
|
| |
The individual tests in tests2 are checked only with -run. Build
(and check) executables as well, to test also building executables.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
Add tests for the fixes made in commits
76cb1144ef91924c53c57ea71e6f67ce73ce1cc6,
a465b7f58fdea15caa1bfb81ff5e985c94c4df4a,
0f522fb32a635dafce30f3ce3ff2cb15bcec809e,
82969f045c99b4d1ef833de35117c17b326b46c0 and
673befd2d7745a90c1c4fcb6d2f0e266c04f8c97.
|
| |
|
|
|
| |
* Adapt tests2 Makefile to support testing tcc error reporting
* Add test for previous commit
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- tccgen: error out for cast to void, as in
void foo(void) { return 1; }
This avoids an assertion failure in x86_64-gen.c, also.
also fix tests2/03_struct.c accordingly
- Error: "memory full" - be more specific
- Makefiles: remove circular dependencies, lookup tcctest.c from VPATH
- tcc.h: cleanup lib, include, crt and libgcc search paths"
avoid duplication or trailing slashes with no CONFIG_MULTIARCHDIR
(as from 9382d6f1a0e2d0104a82ed805207d9e742c6b068)
- tcc.h: remove ";{B}" from PE search path
in ce5e12c2f950052d8109b6b7a56d900547705c08 James Lyon wrote:
"... I'm not sure this is the right way to fix this problem."
And the answer is: No, please. (copying libtcc1.a for tests instead)
- win32/build_tcc.bat: do not move away a versioned file
|
| |
|
|
|
|
|
|
|
| |
on Win64 stdargs.
I removed the XMM6/7 registers from the register list because they are not used
on Win64 however they are necessary for parameter passing on x86-64. I have now
restored them but not marked them with RC_FLOAT so they will not be used except
for parameter passing.
|
| |
|
|
|
|
|
|
|
|
|
| |
Modified tcctest.c so that it uses 'double' in place of 'long double'
with MinGW since this is what TCC does, and what Visual C++ does. Added
an option -norunsrc to tcc to allow argv[0] to be set independently of
the compiled source when using tcc -run, which allows tests that rely on
the value of argv[0] to work in out-of-tree builds.
Also added Makefile rules to automatically update out-of-tree build
Makefiles when in-tree Makefiles have changed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
| |
|