From 7f1ab9b1e111b9ea9261eec4b7c6fb0f42591eef Mon Sep 17 00:00:00 2001 From: grischka Date: Sun, 16 Jul 2017 12:10:00 +0200 Subject: tccgen: nodata_wanted The existing variable 'nocode_wanted' is now used to control output of static data too. So... (nocode_wanted == 0) code and data (normal within functions) (nocode_wanted < 0) means: no code, but data (global or static data) (nocode_wanted > 0) means: no code and no data (code and data suppressed) (nocode_wanted & 0xC0000000) means: we're in declaration of static data Also: new option '-dT' to be used with -run tcc -dT -run file.c This will look in file.c for certain comment-boundaries: /*-* test-xxx: ...some description */ and then for each test below run it from memory. This way various features and error messages can be tested with one single file. See 96_nodata_wanted.c for an example. Also: tccgen.c: one more bitfield fix --- tests/tests2/96_nodata_wanted.expect | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/tests2/96_nodata_wanted.expect (limited to 'tests/tests2/96_nodata_wanted.expect') diff --git a/tests/tests2/96_nodata_wanted.expect b/tests/tests2/96_nodata_wanted.expect new file mode 100644 index 0000000..0db4ba2 --- /dev/null +++ b/tests/tests2/96_nodata_wanted.expect @@ -0,0 +1,24 @@ +/*-* test 1: initializer not computable 1 */ +test 1:3: error: initializer element is not computable at load time + +/*-* test 2: initializer not computable 2 */ +test 2:3: error: initializer element is not computable at load time + +/*-* test 3: initializer not computable 3 */ +test 3:2: error: initializer element is not computable at load time + +/*-* test 4: 2 cast warnings */ +test 4:2: warning: assignment makes integer from pointer without a cast +test 4:2: warning: nonportable conversion from pointer to char/short + +/*-* test 5; nodata_wanted test */ +suppression off + static data: 8 - 8.0 - 8.0 - main - static string + static bitfields: 333 44 555555 6 7 + data length is not 0 +suppression on + data length is 0 +returns 0 + +/*-* test 6: some test */ +returns 34 -- cgit v1.3.1