Commit Graph

147 Commits (0199123dd7c06a7b10d4200d93221bd3e6f36c49)

Author SHA1 Message Date
jiang 0199123dd7 clean '\t' 2014-05-20 15:18:59 +08:00
jiang 196c999515 1 macro_push and macro_pop work I made a mistake, no matter the definition does not define can be macro_push.
And the modified tcctest.c test
2, pack: in the compiler under the mode of s1->ppfp, I have no clear ideas1->ppfp
Some advice thank you Roy to me.This patch, I hope I can pass the Roy test
2014-05-17 00:55:02 +08:00
jiang 276553c6b2 add push_macro test again 2014-05-16 15:44:51 +08:00
jiang 52891b6ff6 fix push_macro, asked Tom to help me testfix push_macro 2014-05-16 12:15:00 +08:00
jiang 5a514107c4 When tcc.exe update, abitest-tcc.exe not updated. For security, you must first clean up 2014-05-15 12:09:43 +08:00
jiang 07614b5e22 clean '\t' 2014-05-14 12:45:58 +08:00
jiang c6345b5a8a restore 2dd8587c2f32d17a2cd0443a60a614a3fa9bbe29 2014-05-13 22:05:38 +08:00
grischka 899d26605c Revert "update static void parse_number()"
because:
- Constructing fp numbers isn't quite trivial
- 3 additional calls to strchr per number is noticeable slow

Also: exclude abitest.c:ret_longdouble_test2 on _WIN32
for mixed gcc/tcc scenario

test case:
- make -k test (on win32):
  -2.120000 0.500000 23000000000.000000
  +2.120000 0.500000 22999999999.999996
  ...
  ret_longdouble_test2... failure

This reverts 857f7dbfa6
and deaee6c249
2014-05-06 18:24:41 +02:00
jiang 5e56fb635a Return to: e20c1eb99e
1: The new patch for the other machines still have the problem.
2: libcrt Rename (what if gcc had libcrt as well)
3: parse_number exact problem
4: VT_VLS is to allow tcc
     Compile the following
     int b = 9;
     struct st {
     int a;
     int b [b]
     };
     struct st st1;
     st1.b [8] = 9;
     printf ("% d \ n", st1.b [8]);

     tcc a problem. Due to problems in front, and now can not be improved
5: they commit much, bug difficult to lock, you can not let other people help develop.
6: ('\ t') too

Thanks to Michael and Ray
Their criticism I have benefited!
2014-05-04 13:18:31 +08:00
jiang 6c8207633f Fixes include the double quotes bug
Added push_macro, pop_macro support
Fix pack bug, when output with-E will pack the bug
2014-05-02 11:23:54 +08:00
jiang 87a850f553 fix its own making bug. Improved init_putz (). Modify the tests / Makefile to make the test more secure 2014-05-01 15:15:01 +08:00
jiang ba61fd9cd1 rename libtcc1.c 2014-04-30 17:35:44 +08:00
jiang 5af0ea7fb8 Fix va_arg bug, Fix type conversion bug, an increase of loc_stack () function is used to manage loc 2014-04-30 15:26:45 +08:00
jiang 89f7aea980 fix abitest.c for x86_64 bug 2014-04-28 14:05:55 +08:00
jiang 4b50557553 add test for abitest.c 2014-04-28 12:28:56 +08:00
minux aa255f37f2 tests2: fix and enable 46_grep test. 2014-04-12 14:04:10 -04:00
minux 0a51386960 tests2: fix 30_hanoi test and enable it. 2014-04-12 13:37:37 -04:00
Thomas Preud'homme 6e56bb387d Fix preprocessor concat with empty arg 2014-04-12 16:11:42 +08:00
minux 469ae3a7e5 build: ignore and properly clean tests/vla_test 2014-04-12 01:10:58 -04:00
Thomas Preud'homme a715d7143d Prevent ## to appear at start or end of macro 2014-04-08 22:19:48 +08:00
Thomas Preud'homme 91d4db600b Add new tests for macro nesting 2014-04-07 23:30:57 +08:00
Vincent Lefevre 3e9a7e9d69 Corrected spelling mistakes in comments and strings 2014-04-07 13:31:00 +02:00
grischka f90bad0925 tests2: cleanup
- 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 e31579b076
2014-04-07 11:20:45 +02:00
grischka 76accfb8d5 win32: libtcc1.a needs to be built with tcc
gcc/mingw produces msvc compatible pecoff objects, tcc only
knows ELF.
2014-04-07 11:16:06 +02:00
Michael Matz c4427747e6 arm: Provide alloca()
This provides a simple implementation of alloca for ARM (and enables
the associated testcase).  As tcc for ARM doesn't contain an assembler,
we'll have to resort using gcc for compiling it.
2014-04-05 22:54:11 +02:00
Michael Matz 3d18c9aa64 tests2: Build executables as well
The individual tests in tests2 are checked only with -run.  Build
(and check) executables as well, to test also building executables.
2014-04-05 17:35:00 +02:00
Thomas Preud'homme 3e56584223 Allow local redefinition of enumerator 2014-03-31 22:59:10 +08:00
Thomas Preud'homme 80811671d4 Add tests for previous fixes
Add tests for the fixes made in commits
76cb1144ef,
a465b7f58f,
0f522fb32a,
82969f045c and
673befd2d7.
2014-03-30 12:56:55 +08:00
mingodad bed865275d Add the generated executables ending with "-cc" and "-tcc" to the makefile "clean" 2014-03-26 14:32:03 +00:00
Thomas Preud'homme f1f45a47ef Add test for previous commit
* Adapt tests2 Makefile to support testing tcc error reporting
* Add test for previous commit
2014-03-25 20:54:19 +08:00
Thomas Preud'homme d3d89900f6 Don't hardcode gcc in tests Makefile 2014-03-09 22:54:48 +08:00
Thomas Preud'homme 02d2ca8ac7 Fix and extend *FCAST test in tcctest.c
Result of float to unsigned integer conversion is undefined if float is
negative. This commit take the absolute value of the float before doing
the conversion to unsigned integer and add more float to integer
conversion test.
2014-02-05 15:26:46 +08:00
Thomas Preud'homme 1415d7e6b6 Don't perform builtin_frame_address on ARM 2014-02-03 12:28:25 +08:00
Thomas Preud'homme c88c2706a2 Test long long to float conversions 2014-02-01 15:31:28 +08:00
grischka 32a4962593 tcctest: add back testXb (self compile with -b)
- Thanks to Kirill "tcc -b itself" should work now
  (was removed in d5f4df09ff)

Also:

- tests/Makefile:
  - fix spurious --I from 767410b875
  - lookup boundtest.c via VPATH (for out-of-tree build)
  - test[123]b?: fail on diff error
  - Windows: test3 now works (from e31579b076)
  - abitest: a libtcc.a made by gcc is not usable for tcc
    on WIndows - using source instead (libtcc.c)

- tccpe:
  - avoid gcc warning (x86_64)
2014-01-21 13:25:14 +01:00
Michael Matz f42a02efda tcctest: One more signed zero test
This also checks that -(-0.0) is +0.0.
2014-01-12 04:53:29 +01:00
Michael Matz 05c9b76131 Fix floating point unary minus and plus
negate(x) is subtract(-0,x), not subtract(+0,x), which makes
a difference with signed zeros.  Also +x was expressed as x+0,
in order for the integer promotions to happen, but also mangles signed
zeros, so just don't do that with floating types.
2014-01-12 04:44:27 +01:00
Thomas Preud'homme 767410b875 Various Makefile fixes for cross-compilation
- Build libtcc1 for cross-compiler on arm (arm to X cross compilers)
- Install libtcc1 and includes for arm to i386 cross compiler
- Add basic check of cross-compilers (compile ex1.c)
2014-01-09 17:15:08 +08:00
grischka 2bd0daabbe misc. fixes
- 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 9382d6f1a0)

- tcc.h: remove ";{B}" from PE search path
  in ce5e12c2f9 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
2014-01-06 19:56:26 +01:00
Thomas Preud'homme f2dbcf7594 Add ARM aeabi functions needed to run tcctest
Add implementation for float / integer conversion functions:
  __aeabi_d2lz, __aeabi_d2ulz, __aeabi_f2lz, __aeabi_f2ulz, __aeabi_l2d,
  __aeabi_l2f, __aeabi_ul2d, __aeabi_ul2f

Add implementation for long long helper functions:
  __aeabi_ldivmod, __aeabi_uldivmod, __aeabi_llsl, __aeabi_llsr, __aeabi_lasr

Add implementation for integer division functions:
  __aeabi_uidiv, __aeabi_uidivmod, __aeabi_idiv, __aeabi_idivmod,
2013-12-11 10:15:30 +08:00
Thomas Preud'homme 5919da6f05 Make abitest.c have predictable result
stdarg_test in abitest.c relies on a sum of some parameters made by both
the caller and the callee to reach the same result. However, the
variables used to store the temporary result of the additions are not
initialized to 0, leading to uncertainty as to the results. This commit
add this needed initialization.
2013-11-25 11:25:04 +08:00
James Lyon 41b3c7a507 Improved variable length array support.
VLA storage is now freed when it goes out of scope. This makes it
possible to use a VLA inside a loop without consuming an unlimited
amount of memory.

Combining VLAs with alloca() should work as in GCC - when a VLA is
freed, memory allocated by alloca() after the VLA was created is also
freed. There are some exceptions to this rule when using goto: if a VLA
is in scope at the goto, jumping to a label will reset the stack pointer
to where it was immediately after the last VLA was created prior to the
label, or to what it was before the first VLA was created if the label
is outside the scope of any VLA. This means that in some cases combining
alloca() and VLAs will free alloca() memory where GCC would not.
2013-04-27 22:58:52 +01:00
James Lyon 6ee366e765 Fixed x86-64 long double passing.
long double arguments require 16-byte alignment on the stack, which
requires adjustment when the the stack offset is not an evven number of
8-byte words.
2013-04-26 16:42:12 +01:00
James Lyon 41d76e1fcb Fixed silly error in Windows build of tests (abitest-cc not linking to libtcc)
I really should do this when less tired; I keep breaking one platform
while fixing another. I've also fixed some Windows issues with tcctest
since Windows printf() uses different format flags to those on Linux,
and removed some conditional compilation tests in tcctest since they
now should work.
2013-04-26 01:27:04 +01:00
James Lyon ae2ece93da Fixed i386 calling convention issue and CMake build on i386.
The i386 calling convention expects the callee to pop 1 word of the
stack when performing a struct ret.
2013-04-26 00:31:46 +01:00
James Lyon 1caee8ab3b Sorted out CMake on x86-64 and fixed silly XMM# bug introduced when working 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.
2013-04-25 22:30:53 +01:00
James Lyon e7a7efed11 Added cross compilation to CMake build system.
Brings it more into line with make based system. I've tested on 32- and 64-bit
Windows, but not yet Linux.
2013-04-25 01:08:18 +01:00
James Lyon 5c35ba66c5 64-bit tests now pass (well, nearly).
tcctest1-3 fail, but this appears to be due to bugs in GCC rather than TCC
(from manual inspection of the output).
2013-04-24 02:19:15 +01:00
James Lyon 8a81f9e103 Added CMake build system (to facilitate Win64 builds)
Win32 build and tests work under CMake, however I haven't added
install code yet. Win64 build fails due to chkstk.S failing to
assemble.
2013-04-21 11:20:20 +01:00
James Lyon 05fa2e754b Workaround for MinGWs use of 80-bit long double on Win32.
This is incompatible with MSVC and TCC on Win32.

Bounds checking appears to be broken (test4).
2013-04-19 23:21:33 +01:00