2015-07-30 04:53:57 +08:00
|
|
|
TOP = ../..
|
2017-02-25 19:49:47 +08:00
|
|
|
include $(TOP)/Makefile
|
2016-10-02 03:06:53 +08:00
|
|
|
SRC = $(TOPSRC)/tests/tests2
|
|
|
|
VPATH = $(SRC)
|
2012-06-19 01:27:32 +08:00
|
|
|
|
2018-06-01 05:51:51 +08:00
|
|
|
TESTS = $(patsubst %.c,%.test,\
|
|
|
|
$(sort $(notdir $(wildcard $(SRC)/??_*.c)))\
|
|
|
|
$(sort $(notdir $(wildcard $(SRC)/???_*.c))))
|
2013-02-05 21:27:38 +08:00
|
|
|
|
2017-04-26 03:01:54 +08:00
|
|
|
# some tests do not pass on all platforms, remove them for now
|
|
|
|
SKIP = 34_array_assignment.test # array assignment is not in C standard
|
2022-05-18 04:28:32 +08:00
|
|
|
ifeq (-$(CONFIG_arm_eabi)-$(CONFIG_arm_vfp)-,-yes--)
|
2017-04-26 03:01:54 +08:00
|
|
|
SKIP += 22_floating_point.test
|
|
|
|
endif
|
2017-09-10 17:02:48 +08:00
|
|
|
ifeq (,$(filter i386,$(ARCH)))
|
2017-09-10 18:20:02 +08:00
|
|
|
SKIP += 98_al_ax_extend.test 99_fastcall.test
|
2017-09-10 17:02:48 +08:00
|
|
|
endif
|
2017-04-26 03:01:54 +08:00
|
|
|
ifeq (,$(filter i386 x86_64,$(ARCH)))
|
2020-06-16 13:39:48 +08:00
|
|
|
SKIP += 85_asm-outside-function.test # x86 asm
|
2022-08-16 23:54:42 +08:00
|
|
|
SKIP += 127_asm_goto.test # hardcodes x86 asm
|
2020-06-16 13:39:48 +08:00
|
|
|
endif
|
2020-12-17 03:08:43 +08:00
|
|
|
ifeq ($(CONFIG_backtrace),no)
|
|
|
|
SKIP += 113_btdll.test
|
2022-03-23 16:03:54 +08:00
|
|
|
CONFIG_bcheck = no
|
|
|
|
# no bcheck without backtrace
|
2020-12-17 03:08:43 +08:00
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_bcheck),no)
|
2022-05-18 04:28:32 +08:00
|
|
|
SKIP += 112_backtrace.test
|
2020-05-05 14:31:57 +08:00
|
|
|
SKIP += 114_bound_signal.test
|
2020-05-24 02:02:41 +08:00
|
|
|
SKIP += 115_bound_setjmp.test
|
|
|
|
SKIP += 116_bound_setjmp2.test
|
2020-12-17 03:08:43 +08:00
|
|
|
SKIP += 117_builtins.test
|
2022-12-02 14:11:55 +08:00
|
|
|
SKIP += 126_bound_global.test
|
2017-04-26 03:01:54 +08:00
|
|
|
endif
|
2020-12-17 03:08:43 +08:00
|
|
|
ifeq ($(CONFIG_dll),no)
|
|
|
|
SKIP += 113_btdll.test # no shared lib support yet
|
2020-04-16 04:06:02 +08:00
|
|
|
endif
|
2017-07-21 04:21:27 +08:00
|
|
|
ifeq (-$(findstring gcc,$(CC))-,--)
|
2017-07-15 01:26:01 +08:00
|
|
|
SKIP += $(patsubst %.expect,%.test,$(GEN-ALWAYS))
|
|
|
|
endif
|
|
|
|
ifeq (-$(CONFIG_WIN32)-$(CONFIG_i386)$(CONFIG_arm)-,--yes-)
|
2017-09-25 09:03:26 +08:00
|
|
|
SKIP += 95_bitfields%.test # type_align is different on 32bit-non-windows
|
2017-07-15 01:26:01 +08:00
|
|
|
endif
|
2020-05-13 17:14:53 +08:00
|
|
|
ifeq (-$(CONFIG_WIN32)-,-yes-)
|
2020-12-20 04:02:44 +08:00
|
|
|
SKIP += 106_versym.test # No pthread support
|
2020-06-27 23:22:04 +08:00
|
|
|
SKIP += 114_bound_signal.test # No pthread support
|
2021-03-30 17:25:58 +08:00
|
|
|
SKIP += 117_builtins.test # win32 port doesn't define __builtins
|
2021-03-30 15:26:26 +08:00
|
|
|
SKIP += 124_atomic_counter.test # No pthread support
|
2019-10-23 19:14:41 +08:00
|
|
|
endif
|
2020-12-18 22:24:32 +08:00
|
|
|
ifneq (,$(filter OpenBSD FreeBSD NetBSD,$(TARGETOS)))
|
2020-12-20 04:02:44 +08:00
|
|
|
SKIP += 106_versym.test # no pthread_condattr_setpshared
|
2020-12-18 22:24:32 +08:00
|
|
|
SKIP += 114_bound_signal.test # libc problem signal/fork
|
2020-12-22 14:02:47 +08:00
|
|
|
SKIP += 116_bound_setjmp2.test # No TLS_FUNC/TLS_VAR in bcheck.c
|
2020-12-18 22:24:32 +08:00
|
|
|
endif
|
2017-04-26 03:01:54 +08:00
|
|
|
|
2017-07-16 18:10:00 +08:00
|
|
|
# Some tests might need arguments
|
|
|
|
ARGS =
|
|
|
|
31_args.test : ARGS = arg1 arg2 arg3 arg4 arg5
|
|
|
|
46_grep.test : ARGS = '[^* ]*[:a:d: ]+\:\*-/: $$' $(SRC)/46_grep.c
|
|
|
|
|
|
|
|
# And some tests don't test the right thing with -run
|
|
|
|
NORUN =
|
|
|
|
42_function_pointer.test : NORUN = true
|
|
|
|
|
|
|
|
# Some tests might need different flags
|
|
|
|
FLAGS =
|
|
|
|
76_dollars_in_identifiers.test : FLAGS += -fdollars-in-identifiers
|
|
|
|
|
2017-07-21 04:21:27 +08:00
|
|
|
# These tests run several snippets from the same file one by one
|
2019-01-11 17:35:44 +08:00
|
|
|
60_errors_and_warnings.test : FLAGS += -dt
|
2017-07-21 04:21:27 +08:00
|
|
|
96_nodata_wanted.test : FLAGS += -dt
|
2017-07-16 18:10:00 +08:00
|
|
|
|
|
|
|
# Always generate certain .expects (don't put these in the GIT),
|
|
|
|
GEN-ALWAYS =
|
2017-07-24 03:24:11 +08:00
|
|
|
# GEN-ALWAYS += 95_bitfields.expect # does not work
|
2017-07-16 18:10:00 +08:00
|
|
|
|
|
|
|
# using the ms compiler for the really ms-compatible bitfields
|
|
|
|
95_bitfields_ms.test : GEN = $(GEN-MSC)
|
|
|
|
|
2019-06-22 05:22:13 +08:00
|
|
|
# this test compiles/links two files:
|
2020-01-19 18:15:12 +08:00
|
|
|
104_inline.test : FLAGS += $(subst 104,104+,$1)
|
2019-06-22 05:22:13 +08:00
|
|
|
104_inline.test : GEN = $(GEN-TCC)
|
|
|
|
|
Reinstate attribute alias handling
commit 2a0167a merged alias and asm symbol renaming, but broke
semantics of aliases, see testcase. Basically the difference between
the two is that an asm rename doesn't generate a new symbol, i.e. with
int foo __asm__("bar");
all source reference to 'foo' will be to 'bar', nothing of the name
'foo' will remain in the object file, and for instance reference to
'foo' from other compilation units won't be resolved to this one.
Aliases OTOH create an additional symbol. With:
void target (void) { return; }
void afunc (void) __attribute__((alias("target")));
reference to 'afunc' will remain 'afunc' in the object file. It will
generate two symbols, 'afunc' and 'target' referring to the same entity.
This difference matters if other compilation units make references to
'afunc'.
A side requirement of this is that for alias to work that the target
symbol needs to be defined in the same unit. For TCC we even require a
stricter variant: it must be defined before the alias is created.
Now, with this I merely re-instated the old flow of events before above
commit. It didn't seem useful anymore to place both names in the
asm_label member of attributes, and the asm_label member of Sym now
again only needs the hold the __asm__ rename.
It also follows that tcc_predefs.h can't make use of attribute alias to
e.g. map __builtin_memcpy to __bound_memcpy (simply because the latter
isn't defined in all units), but rather must use __asm__ renaming, which
in turn means that the underscore handling needs to be done by hand.
2020-09-30 23:46:01 +08:00
|
|
|
# this test needs two files, and we want to invoke the linker
|
|
|
|
120_alias.test : FLAGS += $(subst 120,120+,$1)
|
|
|
|
120_alias.test : GEN = $(GEN-TCC)
|
|
|
|
120_alias.test : NORUN = true
|
|
|
|
|
2019-10-23 02:45:03 +08:00
|
|
|
# this test needs pthread
|
2020-12-20 04:02:44 +08:00
|
|
|
106_versym.test: FLAGS += -pthread
|
|
|
|
106_versym.test: NORUN = true
|
2019-10-23 02:45:03 +08:00
|
|
|
|
2019-10-29 14:02:58 +08:00
|
|
|
# constructor/destructor
|
|
|
|
108_constructor.test: NORUN = true
|
|
|
|
|
2020-01-18 05:58:39 +08:00
|
|
|
112_backtrace.test: FLAGS += -dt -b
|
Add dwarf support
The new gcc12 release does not support stabs any more.
This was a good reason to add support for dwarf.
The stabs code still works and is used if configure option --dwarf
is not used.
Tested on x86_64, i386, arm, arm64, riscv64 with dwarf-5.
Some debuggers may not support dwarf-5. Try using older dwarf versions
i that case.
The tccmacho.c code probably need some support for dwarf.
arm-gen.c, arm64-gen.c, i386-gen.c, riscv64-gen.c, x86_64-gen.
- fix get_sym_ref symbol size
arm-link.c, arm64-link.c, i386-link.c, riscv64-link.c, x86_64-link.c
- add R_DATA_32U
libtcc.c:
- parse -gdwarf option
tcc.c:
- add dwarf option
tcc.h:
- add dwarf option and sections
tccelf.c:
- init dwarf sections
- avoid adding sh_addr for dwarf sections
- remove dwarf relocs for output dll
- add dwarf sections for tccrun
tccgen.c:
- add dwarf defines + global data
- add dwarf_* functions
- mix dwarf code with stabs code
- a trick is used to emit function name in .debug_line section so
only this section has to be parsed instead of .debug_info and
.debug_abbrev.
- fix init debug_modes
tccrun.c:
- add dwarf sections in rt_context
- init them in tcc_run
- add new dwarf code rt_printline_dwarf to find file/function
dwarf.h:
- New file
tcc-doc.texi:
- document dwarf
configure:
- add dwarf option
lib/Makefile
- change -gstabs into -gdwarf
lib/bt-exe.c, tests/tests2/Makefile, tests/tests2/126_bound_global:
- Add __bound_init call
- Add new testcase to test it
2022-05-05 15:10:37 +08:00
|
|
|
112_backtrace.test 113_btdll.test 126_bound_global.test: FILTER += \
|
2020-06-16 13:39:48 +08:00
|
|
|
-e 's;[0-9A-Fa-fx]\{5,\};........;g' \
|
2022-07-16 04:31:24 +08:00
|
|
|
-e 's;0x[0-9A-Fa-f]\{1,\};0x?;g'
|
2020-01-19 18:15:12 +08:00
|
|
|
|
|
|
|
# this test creates two DLLs and an EXE
|
2020-07-08 10:37:04 +08:00
|
|
|
113_btdll.test: T1 = \
|
|
|
|
$(TCC) -bt $1 -shared -D DLL=1 -o a1$(DLLSUF) && \
|
|
|
|
$(TCC) -bt $1 -shared -D DLL=2 -o a2$(DLLSUF) && \
|
|
|
|
$(TCC) -bt $1 a1$(DLLSUF) a2$(DLLSUF) -Wl,-rpath=. -o a.exe && \
|
|
|
|
./a.exe
|
2020-01-18 05:58:39 +08:00
|
|
|
|
2020-05-05 14:31:57 +08:00
|
|
|
114_bound_signal.test: FLAGS += -b
|
2020-09-15 01:31:56 +08:00
|
|
|
114_bound_signal.test: NORUN = true # tcc -run does not support fork and -b and SELINUX
|
2020-05-24 02:02:41 +08:00
|
|
|
115_bound_setjmp.test: FLAGS += -b
|
|
|
|
116_bound_setjmp2.test: FLAGS += -b
|
2020-07-08 10:37:04 +08:00
|
|
|
117_builtins.test: T1 = ( $(TCC) -run $1 && $(TCC) -b -run $1 )
|
2020-12-17 03:08:43 +08:00
|
|
|
ifneq ($(CONFIG_bcheck),no)
|
2020-10-01 23:09:09 +08:00
|
|
|
121_struct_return.test: FLAGS += -b
|
|
|
|
122_vla_reuse.test: FLAGS += -b
|
2020-12-17 03:08:43 +08:00
|
|
|
endif
|
2021-03-30 15:26:26 +08:00
|
|
|
125_atomic_misc.test: FLAGS += -dt
|
2021-04-06 01:48:50 +08:00
|
|
|
124_atomic_counter.test: FLAGS += -pthread
|
Add dwarf support
The new gcc12 release does not support stabs any more.
This was a good reason to add support for dwarf.
The stabs code still works and is used if configure option --dwarf
is not used.
Tested on x86_64, i386, arm, arm64, riscv64 with dwarf-5.
Some debuggers may not support dwarf-5. Try using older dwarf versions
i that case.
The tccmacho.c code probably need some support for dwarf.
arm-gen.c, arm64-gen.c, i386-gen.c, riscv64-gen.c, x86_64-gen.
- fix get_sym_ref symbol size
arm-link.c, arm64-link.c, i386-link.c, riscv64-link.c, x86_64-link.c
- add R_DATA_32U
libtcc.c:
- parse -gdwarf option
tcc.c:
- add dwarf option
tcc.h:
- add dwarf option and sections
tccelf.c:
- init dwarf sections
- avoid adding sh_addr for dwarf sections
- remove dwarf relocs for output dll
- add dwarf sections for tccrun
tccgen.c:
- add dwarf defines + global data
- add dwarf_* functions
- mix dwarf code with stabs code
- a trick is used to emit function name in .debug_line section so
only this section has to be parsed instead of .debug_info and
.debug_abbrev.
- fix init debug_modes
tccrun.c:
- add dwarf sections in rt_context
- init them in tcc_run
- add new dwarf code rt_printline_dwarf to find file/function
dwarf.h:
- New file
tcc-doc.texi:
- document dwarf
configure:
- add dwarf option
lib/Makefile
- change -gstabs into -gdwarf
lib/bt-exe.c, tests/tests2/Makefile, tests/tests2/126_bound_global:
- Add __bound_init call
- Add new testcase to test it
2022-05-05 15:10:37 +08:00
|
|
|
126_bound_global.test: FLAGS += -b
|
|
|
|
126_bound_global.test: NORUN = true
|
2022-12-02 14:11:55 +08:00
|
|
|
128_run_atexit.test: FLAGS += -dt
|
2021-04-06 01:48:50 +08:00
|
|
|
|
2017-07-16 18:10:00 +08:00
|
|
|
# Filter source directory in warnings/errors (out-of-tree builds)
|
2020-01-18 05:58:39 +08:00
|
|
|
FILTER = 2>&1 | sed -e 's,$(SRC)/,,g'
|
2017-07-16 18:10:00 +08:00
|
|
|
|
2020-04-12 23:34:01 +08:00
|
|
|
all test tests2.all: $(filter-out $(SKIP),$(TESTS))
|
|
|
|
@$(MAKE) clean --no-print-directory -s
|
2014-04-07 17:20:45 +08:00
|
|
|
|
tccpp: fix issues, add tests
* 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)
2015-05-09 20:29:39 +08:00
|
|
|
%.test: %.c %.expect
|
2012-06-19 01:27:32 +08:00
|
|
|
@echo Test: $*...
|
2020-01-19 18:15:12 +08:00
|
|
|
@$(call T1,$<) $(T3)
|
2017-07-15 01:26:01 +08:00
|
|
|
|
2020-01-19 18:15:12 +08:00
|
|
|
T1 = $(TCC) $(FLAGS) $(T2) $(ARGS)
|
|
|
|
T2 = $(if $(NORUN),$1 -o a.exe && ./a.exe,-run $1)
|
2017-07-16 18:10:00 +08:00
|
|
|
T3 = $(FILTER) >$*.output 2>&1 || true \
|
various stuff
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure && make can be used with either
cygwin's "GCC for Win32 Toolchain"
./configure --cross-prefix=i686-w64-mingw32-
or with an existing tcc:
./configure --cc=<old-tccdir>/tcc.exe
tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)
tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)
tests:
- remove -I "expr" diff option to allow tests with
busybox-diff.
libtcc.c, tcc.c:
- removed -iwithprefix option. It is supposed to be
combined with -iprefix which we don't have either.
tccgen.c:
- fix assignments and return of 'void', as in
void f() {
void *p, *q;
*p = *q:
return *p;
}
This appears to be allowed but should do nothing.
tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.
The patch was giving tcc's system includes priority over -I which
is not how it should be.
tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
(weak) symbols
tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
(it was so once except the RX mapping wasn't used at all).
tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.
tccasm.c:
- keep forward asm labels static, otherwise they will endup
in dynsym eventually.
configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
make XTCC=<tcc program to use>
- use $(wildcard ...) for install to allow installing just
a cross compiler for example
make cross-arm
make install
- use name <target>-libtcc1.a
build-tcc.bat:
- add options: -clean, -b bindir
2017-10-12 00:13:43 +08:00
|
|
|
&& diff -Nbu $(filter %.expect,$^) $*.output \
|
2017-07-16 18:10:00 +08:00
|
|
|
&& rm -f $*.output $(filter $*.expect,$(GEN-ALWAYS))
|
2017-07-15 01:26:01 +08:00
|
|
|
|
|
|
|
# run single test and update .expect file, e.g. "make tests2.37+"
|
|
|
|
tests2.%+:
|
|
|
|
@$(MAKE) $(call F2,$(call F1,$*)) --no-print-directory
|
|
|
|
|
2017-07-16 18:10:00 +08:00
|
|
|
# just run tcc to see the output, e.g. "make tests2.37-"
|
|
|
|
tests2.%-:
|
2020-01-19 18:15:12 +08:00
|
|
|
@$(MAKE) $(call F1,$*) T3= --no-print-directory
|
2017-07-16 18:10:00 +08:00
|
|
|
|
2017-07-15 01:26:01 +08:00
|
|
|
# run single test, e.g. "make tests2.37"
|
|
|
|
tests2.%:
|
|
|
|
@$(MAKE) $(call F1,$*) --no-print-directory
|
tccpp: fix issues, add tests
* 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)
2015-05-09 20:29:39 +08:00
|
|
|
|
2017-07-16 18:10:00 +08:00
|
|
|
F1 = $(or $(filter $1_%,$(TESTS)),$1_???.test)
|
|
|
|
F2 = $1 UPDATE="$(patsubst %.test,%.expect,$1)"
|
|
|
|
|
tccpp: fix issues, add tests
* 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)
2015-05-09 20:29:39 +08:00
|
|
|
# automatically generate .expect files with gcc:
|
2017-07-15 01:26:01 +08:00
|
|
|
%.expect :
|
|
|
|
@echo Generating: $@
|
2017-07-16 18:10:00 +08:00
|
|
|
@$(call GEN,$(SRC)/$*.c) $(FILTER) >$@ 2>&1
|
|
|
|
@rm -f *.exe *.obj *.pdb
|
2017-07-15 01:26:01 +08:00
|
|
|
|
2017-07-21 04:21:27 +08:00
|
|
|
# using TCC for .expect if -dt in FLAGS
|
2020-01-19 18:15:12 +08:00
|
|
|
GEN = $(if $(filter -dt -bt -b,$(FLAGS)),$(GEN-TCC),$(GEN-CC))
|
2017-07-16 18:10:00 +08:00
|
|
|
GEN-CC = $(CC) -w -std=gnu99 $(FLAGS) $1 -o a.exe && ./a.exe $(ARGS)
|
2020-01-19 18:15:12 +08:00
|
|
|
GEN-TCC = $(T1)
|
2017-07-16 18:10:00 +08:00
|
|
|
GEN-MSC = $(MS-CC) $1 && ./$(basename $@).exe
|
2017-07-15 01:26:01 +08:00
|
|
|
MS-CC = cl
|
2014-04-07 17:20:45 +08:00
|
|
|
|
tccpp: fix issues, add tests
* 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)
2015-05-09 20:29:39 +08:00
|
|
|
# tell make not to delete
|
|
|
|
.PRECIOUS: %.expect
|
2012-11-07 21:54:43 +08:00
|
|
|
|
2017-07-16 18:10:00 +08:00
|
|
|
# force .expect generation for these files
|
2017-07-15 01:26:01 +08:00
|
|
|
$(sort $(GEN-ALWAYS) $(UPDATE)) : force
|
|
|
|
force:
|
|
|
|
|
2020-04-12 23:34:01 +08:00
|
|
|
clean :
|
2020-01-19 18:15:12 +08:00
|
|
|
rm -f fred.txt *.output a.exe *.dll *.so *.def $(GEN-ALWAYS)
|