tcc -dt -run ... : simpler is better
commit0cc24d0e8487eaf53bb2849fef7e438a8e8fc94d
authorgrischka <grischka>
Thu, 20 Jul 2017 20:21:27 +0000 (20 22:21 +0200)
committergrischka <grischka>
Thu, 20 Jul 2017 20:21:27 +0000 (20 22:21 +0200)
treeba77f5e03cb8944f995b103abb668e37a9dceef2
parentba2b25e4ead7f0037d548289e517b31d29242880
tcc -dt -run ... : simpler is better

* -dt now with lowercase t

* test snippets now separated by real preprocessor statements
  which is valid C also for other compilers

    #if defined test_xxx
       < test snippet x >
    #elif defined test_yyy
       < test snippet y >
    #elif ...
    #endif

* simpler implementation, behaves like -run if no 'test_...' macros
  are seen, works with -E too

* for demonstration I combined some of the small tests for errors
  and warnings (56..63,74) in "60_errors_and_warnings.c"

Also:
* libtcc.c:
  put tcc_preprocess() and tcc_assemble() under the setjmp clause
  to let them return to caller after errors.  This is for -dt -E.
* tccgen.c:
  - get rid of save/restore_parse_state(), macro_ptr is saved
    by begin_macro anyway, now line_num too.
  - use expr_eq for parsing _Generic's controlling_type
  - set nocode_wanted with const_wanted. too, This is to keep
    VT_JMP on vtop when parsing preprocessor expressions.
* tccpp.c: tcc -E: suppress trailing whitespace from lines with
  comments (that -E removes) such as
       NO_GOTPLT_ENTRY,\t    /* never generate ... */
31 files changed:
libtcc.c
tcc.c
tcc.h
tccasm.c
tccgen.c
tccpp.c
tccrun.c
tcctools.c
tests/tests2/56_btype_excess-1.c [deleted file]
tests/tests2/56_btype_excess-1.expect [deleted file]
tests/tests2/57_btype_excess-2.c [deleted file]
tests/tests2/57_btype_excess-2.expect [deleted file]
tests/tests2/58_function_redefinition.c [deleted file]
tests/tests2/58_function_redefinition.expect [deleted file]
tests/tests2/59_function_array.c [deleted file]
tests/tests2/59_function_array.expect [deleted file]
tests/tests2/60_enum_redefinition.c [deleted file]
tests/tests2/60_enum_redefinition.expect [deleted file]
tests/tests2/60_errors_and_warnings.c [new file with mode: 0644]
tests/tests2/60_errors_and_warnings.expect [new file with mode: 0644]
tests/tests2/61_undefined_enum.c [deleted file]
tests/tests2/61_undefined_enum.expect [deleted file]
tests/tests2/62_enumerator_redefinition.c [deleted file]
tests/tests2/62_enumerator_redefinition.expect [deleted file]
tests/tests2/63_local_enumerator_redefinition.c [deleted file]
tests/tests2/63_local_enumerator_redefinition.expect [deleted file]
tests/tests2/74_nocode_wanted.c [deleted file]
tests/tests2/74_nocode_wanted.expect [deleted file]
tests/tests2/96_nodata_wanted.c
tests/tests2/96_nodata_wanted.expect
tests/tests2/Makefile