Commit Graph

620 Commits

Author SHA1 Message Date
Bob Andrews c0559dd931
Merge pull request #2009 from bbbradsmith/ca65_feature_disable
ca65: allow .feature to both enable and disable
2023-03-04 13:08:18 +01:00
mvax 3f2129894b Fix .endmacro not at the start of the line. Rename test files. 2023-03-02 15:12:30 -05:00
mvax 98d2d9ee4e Fix .endmacro not at the start of the line. Fix style 2023-03-01 21:59:00 -05:00
mvax 0b71d1cfff Fix .endmacro not at the start of the line. Fix last commit 2023-03-01 21:55:14 -05:00
bbbradsmith 3d41a5b516 allow immedite style syntax variation for BRK signature byte 2023-02-25 08:23:47 -05:00
bbbradsmith cd8fa39066 optional BRK signature on all 6502 CPUs, not just 65816 (also COP) 2023-02-24 22:40:29 -05:00
bbbradsmith c2bc40f213 test for all ca65 .feature options 2023-02-24 20:00:56 -05:00
bbbradsmith 230230819e document the undocumented test/asm/listing behaviours 2023-02-24 19:35:38 -05:00
Bob Andrews 12fc59351e
Merge branch 'master' into ca65_long_jsr_jmp_rts 2023-02-24 19:25:32 +01:00
Bob Andrews 221e6b53ef
Merge pull request #1992 from bbbradsmith/optstackops_toscmpbool_fix
OptStackOps label migration fix
2023-02-24 13:43:07 +01:00
bbbradsmith 2cdab999f5 dasm test extend 65816.info to include added code 2023-02-21 05:22:28 -05:00
bbbradsmith 4b29d257d9 fix dasm test65816 which relied on JMP automatic promotion, add test of new long_jsr_jmp_rts and smart 2023-02-21 04:38:42 -05:00
bbbradsmith 3df5b9f41f relocate dasm test start-addr to avoid producing negative memory area size with none.cfg (conflicted with stack position at $8000) 2023-02-19 09:30:07 -05:00
bbbradsmith 78263cd24b Fix OptStackOps label migration case for toscmpbool, add test case 2023-02-17 23:48:32 -05:00
mrdudz 1764b7aca9 fix for #1941, taken from 22d435b689 2023-01-28 12:29:05 +01:00
Bob Andrews cce119a9e7
Merge pull request #1871 from clbr/da816
da65 support for 65816
2022-12-30 15:34:40 +01:00
mrdudz d9ebfa7192 all good things are three 2022-12-11 12:29:11 +01:00
mrdudz 2b941e255a move test. oops 2022-12-11 12:22:41 +01:00
mrdudz ddab16007a run branch fixer again after replacing BRA by JMP. should fix #1936 2022-12-11 12:08:30 +01:00
mrdudz bad961b36f add missing newline 2022-11-28 06:34:05 +01:00
mrdudz 61ee5fe1d5 test for bug #1933 2022-11-28 06:26:47 +01:00
mrdudz d6c37a757d Merge branch 'master' into underscores 2022-11-19 17:11:11 +01:00
Bob Andrews 3513342445
Merge pull request #1913 from acqn/Diagnostics
[cc65] Improved diagnostics on div-by-zero/bitwise-shift in unevaluated context and overall
2022-11-18 19:55:51 +01:00
Bob Andrews a0a9cfdcd3
Merge pull request #1918 from acqn/PPFix
[cc65] Fixed bitwise-shift in preprocessor
2022-11-18 19:09:55 +01:00
Bob Andrews 93b015660d
Merge pull request #1899 from acqn/TypeCmpFix
[cc65] Fixed compatibility checks on "pointer to pointer" vs "pointer to array" etc.
2022-11-18 19:04:35 +01:00
acqn dadca9e033 Fixed bitwise-shift in PP. 2022-11-13 16:32:41 +08:00
Spiro Trikaliotis d7a804d120 Split stdin and stdout in test/asm/
Some tests pipe the stdout and stderr of the compiler or assembler into
a file and compare the result with a reference. This has the subtle
problem that both stdout and stderr and buffered i/o streams that may or
may not work the same on different OSs or even shells. That means the
order of the lines in the resulting file is not guaranteed.

In practise it is "mostly" not an issue, but "we" still stumbled about
one test where different behaviour can be triggered depending on running
it in cmd.exe or bash (msys): test/asm/listing output of
010-paramcount.bin differs from the reference output when running the
test from cmd.exe.

The solution is most likely to have two reference files and not redirect
into one file.

This patch fixes the issue (cf. #1912) for the directory test/asm/.
2022-11-12 23:12:25 +01:00
acqn 7b436e9823 Added tests for #1895 fix. 2022-11-13 01:01:24 +08:00
acqn cc177208b4 Added tests for diagnostics in unevaluated context. 2022-11-12 21:05:01 +08:00
acqn 3af77e7333 Improved error recovery in declarations with curly braces. 2022-11-12 12:28:29 +08:00
Bob Andrews ace39197e5 move test to test/ref 2022-11-11 21:22:20 +01:00
Bob Andrews 9c48c0ab8a
Merge pull request #1900 from acqn/Diagnostics
[cc65] Fixed endlessly repeated error messages when a declaration lacks a required identifier
2022-11-11 21:08:53 +01:00
Bob Andrews ebb33ee8b4 fix problem with copy command in cmd.exe 2022-11-11 20:54:38 +01:00
acqn 9253f0d6bc Added testcase for #1889. 2022-11-10 02:11:54 +08:00
mrdudz a09053ce0b make test work again also on linux. why did this not break the github actions? 2022-11-09 01:07:36 +01:00
mrdudz bf924395fb fix some bashisms, hopefully makes "check" work again in cmd.exe 2022-11-05 19:41:02 +01:00
Bob Andrews 53b62184e8
Merge pull request #1905 from acqn/DeclFix
[cc65] Fixed some missing declaration features
2022-11-05 16:03:09 +01:00
acqn e608f8a94f Renamed several tests. 2022-11-05 18:30:02 +08:00
mrdudz 79fd078ae3 add check for line endings containing CR. 2022-11-03 18:27:10 +01:00
mrdudz cc450706d1 testcase related to bug #1888 2022-11-03 18:03:47 +01:00
mrdudz 44b2e4f331 added examples for tests that compare the compiler output with a reference 2022-11-03 17:40:13 +01:00
acqn 8a7f566387 Fixed support for storage class specifiers after type specifiers. 2022-11-03 21:46:42 +08:00
acqn 991af3755b Added support for _Static_assert in unions. 2022-11-03 21:46:41 +08:00
Lauri Kasanen 9aae1efd03 Add a da65 65186 test 2022-11-03 08:17:51 +02:00
Bob Andrews 0eba33ee74
Merge pull request #1897 from acqn/TernaryFix
[cc65] Fixed errors in the conditional operator "? :" parser
2022-11-02 18:13:45 +01:00
Bob Andrews 37efb40c69
Merge pull request #1898 from acqn/PPFix
[cc65] Fixed '\\' + newline
2022-11-02 18:09:04 +01:00
acqn deb5e97732 Fixed diagnostic messages on enumerator overflow.
An enumerator that would be incremented greater than ULONG_MAX now causes an error.
2022-11-02 14:22:21 +08:00
acqn 8fb2576626 Fixed processing '\\' followed with a newline and line number output (-E) with it. 2022-11-02 14:09:15 +08:00
acqn d84cc2d122 Fixed errors in the conditional operator "? :" parser. 2022-11-02 13:56:55 +08:00
Lauri Kasanen 1e6279aee5 Clarify sprintf-test's output so it doesn't look like the entire test bench summary 2022-10-12 18:38:33 +03:00
Bob Andrews a169e67e43
Merge pull request #1863 from acqn/LinkageFix
[cc65] Fixed symbol visibility and usage problems with extern/static declarations
2022-10-09 18:59:12 +02:00
acqn 9eab36b95a Fixed block-scope extern declarations visibility.
Fixed missing file-scope static function codegen output in a rare care.
2022-09-30 14:32:08 +08:00
acqn f6003b8e8c Renamed some testcases. 2022-09-30 09:41:54 +08:00
acqn 1cbd6bc3f9 Fixed comments in test/val/bug1462-biefield-assign-4.c. 2022-09-29 18:23:41 +08:00
acqn 376afd0edb Fixed trailing spaces in some testcases. 2022-09-29 18:23:32 +08:00
mrdudz 846d51db72 change line endings to unix style, should fix #1858 2022-09-22 20:29:57 +02:00
acqn 5e7d9b5fe3 Renamed a few testcases. 2022-09-18 22:29:41 +08:00
acqn 080ec131d8 Added testcase for constant operands with side-effects. 2022-09-18 22:29:30 +08:00
acqn 16ba232d08 Fixed some testcases. 2022-09-18 22:29:01 +08:00
mrdudz 6fc2cd9f61 add test related to bug #1853 2022-09-17 14:42:18 +02:00
acqn dc001cb4be Reverted E_ADDRESS_OF logic fix.
Added testcase.
2022-09-01 12:56:46 +08:00
mrdudz 5bda57de87 add extra underscore to _bzero, add a test for bzero/memset 2022-08-29 23:20:48 +02:00
mrdudz ce6ee1b891 test some more possible cases and move test into test/val 2022-08-28 03:43:54 +02:00
acqn 43d2fd2a96 Added support for the popular __COUNTER__ macro. 2022-07-24 23:19:05 +08:00
mrdudz 168f42bb83 fix whitespace 2022-08-27 02:14:52 +02:00
mrdudz 41b29d5c81 add testcase related to issue #1252 2022-08-27 02:10:02 +02:00
mrdudz 90b9438b48 added testcase related to issue #1768 2022-08-27 01:15:06 +02:00
Bob Andrews d2628d5949
Merge pull request #1840 from acqn/FnParamFix
[cc65] Fixed function parameters declared as function types rather than function pointers
2022-08-26 23:19:55 +02:00
Bob Andrews 68610490c9
Merge pull request #1837 from acqn/PPLineFix
[cc65] Fixed predefined __FILE__, __LINE__ and added missing preprocessing directive #line
2022-08-26 23:12:59 +02:00
acqn 1dbc5cb325 Simple testcase for __LINE__, __FILE__ as well as #line. 2022-08-24 16:39:44 +08:00
acqn 26945c32ac Fixed function parameters declared as function types rather than function pointers. 2022-08-24 15:30:52 +08:00
Bob Andrews 22ea30c75f
"cat" result to console on failure (only on *nix right now) 2022-08-23 11:56:05 +02:00
acqn 47ee543fe0 Added testcase for some part of PR #1833. 2022-08-21 00:11:19 +08:00
Bob Andrews 12b9b10355
Merge pull request #1832 from acqn/PPDefineFix
[cc65] Preprocessor directive #define fixes
2022-08-20 14:27:25 +02:00
Bob Andrews 03421694b2
Merge pull request #1817 from acqn/PPFix
[cc65] More preprocessor fixes
2022-08-19 21:37:16 +02:00
mrdudz c1fd3218df add test related to pr #1799 2022-08-11 00:59:09 +02:00
mrdudz f942c629d7 simple test related to issue #1655 2022-08-11 00:04:36 +02:00
acqn ae811baaf1 Fixed the bug that redefined macros could co-exist but not all be undefined with a single #undef. 2022-08-06 18:21:42 +08:00
mrdudz fb8de287be test related to pr #1800 2022-07-28 01:50:54 +02:00
mrdudz 5164b88a27 test was moved to test/val 2022-07-26 17:21:33 +02:00
Bob Andrews a41b76795a
Merge pull request #1807 from acqn/CharmapFix
[cc65] Fixed #pragma charmap for string literals
2022-07-26 17:19:58 +02:00
acqn 2f357ba9b2 Preprocessor directives can now appear in the argument list of function-like macro calls.
#pragma PP-tokens can now be macro replaced.
#include header names directly enclosed in <> are free of macro replacement.
Preprocess-only mode (-E) now outputs with #line as source info.
Moved testcases for #760 and #1357.
Added testcase for #1643.
2022-07-26 21:10:38 +08:00
acqn 9f767770ac Added test case for #pragma charmap. 2022-07-26 15:19:48 +08:00
mrdudz d03f28d0ed dangling! 2022-07-24 23:52:53 +02:00
mrdudz 3c71455bd6 test related to issue #1373, should be move to val in pr #1807 2022-07-24 23:49:45 +02:00
Spiro Trikaliotis 6b7d23ca74 isequal with --wildcard: Allow DOS/Win paths
Allow a colon (':') at the second position of a DOS or Windows path, so
a path with drive specifier (i.e., "c:") is recognized as a path of the
wildcard should end with a colon.
2022-06-22 21:23:44 +02:00
Spiro Trikaliotis a7b2a92fc2 isequal: add --wildcards option 2022-06-21 22:23:10 +02:00
Spiro Trikaliotis c738c94935 Debugging fix 2022-06-20 23:13:49 +02:00
Spiro Trikaliotis 0d7fba2332 More make test output for debugging 2022-06-20 23:10:32 +02:00
Spiro Trikaliotis b5b3654017 Un-silence Make 2022-06-20 23:07:36 +02:00
Spiro Trikaliotis aa64234707 Testcases for case 2022-06-20 23:03:12 +02:00
Spiro Trikaliotis 3a5fee75a3 Remove TAB for reference file, too 2022-06-20 22:57:20 +02:00
Spiro Trikaliotis b816ee6676 Remove TABs again 2022-06-20 22:53:46 +02:00
Spiro Trikaliotis b3846ee1c4 Complete check of ld65 output
ld65 output was only checked for listing build before. No, both builds
are tested separately for better test coverage.
2022-06-20 22:19:22 +02:00
Spiro Trikaliotis 343bc1a489 More assert tests
Also test ldwarning and lderror options.
2022-06-20 22:16:55 +02:00
Spiro Trikaliotis e9888a0c28 testcase for ca65 .align 2022-06-20 22:01:01 +02:00
Spiro Trikaliotis 77a6ea3704 Makefile fix for ld65 error processing 2022-06-20 16:34:14 +02:00
Spiro Trikaliotis 7476c86ba9 More .assert testcases
Add testcases with error generation.
2022-06-20 16:33:25 +02:00
Spiro Trikaliotis 2040da0520 Reorga of test/asm/listing/
add ref/ and control/ subdirectories, so the control files and result
files do not clutter the directory, and it is clear which file has which
purpose.
2022-06-20 16:30:51 +02:00
Spiro Trikaliotis e17cb6d602 isequal: add --skip for both left and right file
isequal: New option --skip as a shortcut for --skipleft and --skipright
at once.

Use that for the .list-ref files, so they now contain the first line of
the output, too, which is ignored.
2022-06-19 22:42:44 +02:00
Spiro Trikaliotis 1446b7dcc3 isequal: Add options for better handling
--binary: handled binary files
--empty:  check if file is empty

--skipleft=<n>: Skip <n> lines at the start of the left (first) file
--skipright=<n>: Skip <n> lines at the start of the right (second) file

Note that --binary, --empty and one or both of --skipXXX are mutual
exclusive; that is, you cannot specify more than one of them at the same
time, or the behaviour will be unpredictable.
2022-06-18 23:50:26 +02:00
Spiro Trikaliotis 297a11fcec Add more assert tests 2022-06-18 22:22:27 +02:00
Spiro Trikaliotis 794ebd7a0b Test cases for .assert warnings 2022-06-18 21:04:36 +02:00
Spiro Trikaliotis a9e0dba991 Remove TAB to comply to style 2022-06-16 21:59:37 +02:00
Spiro Trikaliotis 48ae6716ad Some test cases for ca65 2022-06-16 20:57:53 +02:00
mrdudz 1c3d386e09 simple test related to #1678 2022-05-09 21:27:21 +02:00
mrdudz 1abb5f4734 Add a directory for tests that exercise the supported C standard differences.
As a first test added the snippet given in issue #1670
2022-05-08 19:29:57 +02:00
mrdudz e6b9a4b292 test related to issue #1652, shows regression broken by #1231 and the
case that #1231 improved.
2022-05-08 13:19:32 +02:00
mrdudz e0ae8ddc68 add sourcelines to the generated asm for easier inspection,
redirect output of sim65, including cycle count, into a seperate .out file per program
2022-05-08 13:18:27 +02:00
mrdudz f7a5f6ed73 test some more cases that should not change size 2022-04-26 17:08:19 +02:00
mrdudz a3ae28a81c added a test that must fail 2022-04-26 17:07:57 +02:00
mrdudz fd02cbed9d fix workdir path 2022-04-20 14:54:44 +02:00
mrdudz 99919d2899 added a testprogram to check for some of the edge cases 2022-04-20 14:50:42 +02:00
acqn 67594cca70 Testcases for long bit-fields. 2022-03-03 16:14:26 +08:00
mrdudz 0129622383 remove dangling spaces 2022-04-17 16:07:52 +02:00
mrdudz 8cacfa70d5 add missing newline to a bunch of files 2022-04-16 19:51:48 +02:00
mrdudz 2eb20b3e8a remove a bunch of TABs 2022-04-16 18:16:14 +02:00
mrdudz 6001d3eab9 fix #warning directive so the test could actually compile :) 2022-03-07 14:48:55 +01:00
acqn c8956ce19b Fixed signed long comparisons with smaller unsigned types. 2022-03-03 20:24:14 +08:00
acqn 1ba39b678c Fixed test/asm/listing/Makefile with mingw32-make.exe that has problems with comments lead with tabulators. 2022-03-03 14:03:01 +08:00
Bob Andrews 0587d9f5d4
Merge pull request #1675 from acqn/ShiftFix
[cc65] Fixed bitwise shift with numeric constant operand(s)
2022-03-01 19:50:21 +01:00
Greg King bca8fcb947 Added a more general test to test/val/bug1690.c 2022-03-01 12:56:34 -05:00
acqn 5ef420af5a Fixed OptCmp1 with certain code patterns with labels. 2022-03-01 10:40:01 +08:00
Jeff Tranter 2bf8be5b3b Fix some commonly made spelling errors in comments. 2022-02-21 15:44:31 -05:00
Spiro Trikaliotis 0f6cb5b114 Add proper readmes 2022-02-20 11:20:20 +01:00
Spiro Trikaliotis 0e45976f9b Rename target test to asm 2022-02-19 12:52:02 +01:00
Spiro Trikaliotis 388ae87cb3 Reorganized test/asm 2022-02-19 12:44:20 +01:00
acqn 904a77e03c Testcase for #1675. 2022-02-18 15:20:01 +08:00
acqn 6dbafda53f Testcase for #1662. 2022-02-14 22:28:22 +08:00
mrdudz 86f1965202 added test related to issue #1552 fixed in pr #1571 2021-09-28 18:55:23 +02:00
mrdudz 6ba8a385a0 add test related tu issue #1562 2021-09-28 18:11:23 +02:00
acqn 31128d4809 Added test cases for result types of certain operations. 2021-06-10 21:54:32 +02:00
acqn d69e81cd66 Moved and improved test cases for Issue #1462.
Fixed an old test case for unsigned enum bit-fields that are supposed to be int-promoted.
2021-06-09 08:03:12 +02:00
mrdudz 010eea12a2 move test for issue #1211 into misc 2021-05-25 13:38:06 +02:00
mrdudz 022935320c test for issue #897 2021-05-24 14:30:10 +02:00
mrdudz ae3d3a4b5d make readme a bit more clear (hopefully) 2021-05-24 13:53:44 +02:00
mrdudz adda9438d2 testcase for issue #1357 2021-05-24 13:53:14 +02:00
mrdudz 0db23a8951 testcase for issue #263 2021-05-23 18:55:06 +02:00
mrdudz b08dc28cc1 another testcase related to issue #1462 2021-05-22 22:34:52 +02:00
mrdudz e13f57e86c added another testcase for issue #1462 2021-05-21 16:09:10 +02:00
mrdudz 4a57656f69 add test for issue #1504 2021-05-17 14:40:09 +02:00
mrdudz d736032675 added a missing comment 2021-05-17 14:25:33 +02:00
Christian Groessler 09e0e74124 (again) remove TABs 2021-05-13 18:12:12 +02:00
Andrea Odetti 467844963a Update failing test due to error format changes. 2021-05-11 17:41:59 +02:00
mrdudz f3663b8d2e added test for issue #1461 2021-04-28 14:21:48 +02:00
mrdudz 080cb1bac9 added testcase for issue #1462 2021-04-23 21:52:36 +02:00
Oliver Schmidt a982f6a668 Removed obsolete file.
c658acbf85 made this file unnecessary.
2021-04-18 21:14:49 +02:00
acqn 5f8d163045 Moved one test case for #1209. 2021-04-06 22:20:39 +02:00
acqn 39700c77ee Added test case for Issue #1451. 2021-04-05 15:49:54 +02:00
acqn 5d05451ab2 Fixed test case for Issue #1263. 2021-04-03 17:50:46 +02:00
acqn cb8fbf4772 Removed the non-existing-in-C "struct/union scope" for structs/unions.
Fixed handling of struct/union field declarations without identifiers, which do nothing.
2021-03-29 19:28:22 +02:00
mrdudz bf1bb7a032 ooopsie :) 2021-03-27 15:13:32 +01:00
mrdudz 54920193e5 added test for issue #1438 2021-03-27 15:11:47 +01:00
mrdudz 02392d6220 added test related to issue #1437 2021-03-26 22:18:05 +01:00
mrdudz d3cd668585 also test (some of) the cases with an external function 2021-03-22 23:37:33 +01:00
mrdudz 55e89416cd test related to issue #1196 and pr #1424 respectively 2021-03-22 19:12:44 +01:00
Oliver Schmidt 203c4da15b
Merge pull request #1434 from mrdudz/test1423
Test for pr #1423
2021-03-20 02:01:46 +01:00
mrdudz 82fb9aa418 testcase related to pr #1423 2021-03-20 00:55:55 +01:00
mrdudz bbfc24770e test related to pr #1425 2021-03-20 00:23:12 +01:00
mrdudz cc040ca04a remove, fucking git 2021-03-19 23:39:56 +01:00
mrdudz 57e69d9647 test related to pr #1425 2021-03-19 23:35:34 +01:00
mrdudz 9ec9d1e20c test for issue #1431 / pr #1424 2021-03-19 20:53:52 +01:00
acqn 6f5ad51816 Added testcase for Issue #1408. 2021-02-23 22:06:21 +01:00
acqn f1c715c455 Fixed a bug that pointer subtraction results from two absolute addresses are calculated as unsigned long. 2021-02-22 14:14:59 -05:00
acqn da4cc08b78 Moved and improved test case for Issue #1310. 2021-02-22 14:14:59 -05:00
acqn 24985f1b33 Added testcase for the "deferred ops in unevaluated context" bug. 2021-02-22 11:02:47 +01:00
acqn 131f96eb1e Moved testcase for issue #1397. 2021-02-17 07:03:11 -05:00
mrdudz ab8bb26868 added testcase for issue #1937 2021-02-09 19:50:08 +01:00
acqn 95830cce29 Fixed test/misc/bug1265.c with its output. 2021-01-30 14:31:51 +01:00
acqn a040c28cc4 Moved test for #1374. 2021-01-19 14:33:27 +01:00
mrdudz 0846219672 added testprogram for issue #1374 2021-01-16 16:40:58 +01:00
Christian Groessler ef258bdc19 remove TABs which again slipped in.... 2020-12-25 07:16:26 +01:00
Greg King b2c1a77bb3 Fixed the cc65 code that optimizes 16-bit compares when the high bytes are known to be equal.
Only the low bytes are compared.  Originally, signed 16-bit compares were optimized into signed 8-bit compares.  But, the sign bits are in the high bytes; and, they're equal.  Therefore, the low bytes always must be compared as unsigned numbers.
Fixes #1348.
2020-12-24 12:27:09 -05:00
Greg King 8b42f570e9 Fixed code that caused a seg-fault after parsing a (deferred) post-count argument followed by a (nested) function-call argument.
The old broken code defers the count until the end of the (parent function's) argument list.  But, a nested function call clears the pointer to the deferred type.  That leads to an access violation.
The new code defers only until the end of each argument.  Fixes #1320.
2020-11-20 17:45:14 -05:00
mrdudz c11e389a94 move testcase for issue #1320 into test/misc 2020-11-20 17:25:10 +01:00
mrdudz 0d46af2e9c Merge branch 'master' of https://github.com/cc65/cc65 2020-11-19 23:12:46 +01:00
mrdudz 23273584a0 testcase for issue #1348 2020-11-19 23:12:16 +01:00
Zsolt Branyiczky 032b4e3979 Fixed typo 2020-11-19 22:02:07 +01:00
Zsolt Branyiczky 36f5dcbb6e added 6502dtv opdoces testcases and corrected cpudetect 2020-11-19 22:02:07 +01:00
Zsolt Branyiczky 1c5c07406c cpudetect.s needs this file to run its test for 6502dtv cpu 2020-11-19 22:02:07 +01:00
Zsolt Branyiczky 843b94388a added asm test for 6502DTV cpu 2020-11-19 22:02:07 +01:00
Greg King 5ba16654a3 Refined the hints about making new test reference files. 2020-11-17 15:06:05 -05:00
Greg King b0497f40b2 'test/isequal.c' doesn't change. Don't rebuild it for each test subdirectory. 2020-11-17 13:40:36 -05:00
Greg King 47bceb0eab Streamlined some makefiles.
foreach isn't needed because make automatically iterates through lists of words when substituting patterns.
2020-11-17 13:34:22 -05:00
Greg King 2ffb6af5d9 Simplified a bug test. Gave it an appropriate description, 2020-11-17 08:15:34 -05:00
Jesse Rosenstock 68cb15d0f9 Add test case for #1320
From https://github.com/cc65/cc65/issues/1320#issuecomment-726866015
2020-11-17 09:45:02 +01:00
Jesse Rosenstock c2c73e7d06 Move #1332 test from todo/ to val/
This bug was fixed by 2915464.
2020-11-16 03:23:52 -05:00
Jesse Rosenstock 83ac2755fe Add test case for #1332 2020-11-15 21:32:45 +01:00
Jesse Rosenstock 93145246fd Add tests for u8 op s16_const
Test expressions like `unsigned char x = ...; ... = x / 2;`
These use `int` constants with values representable by
`unsigned int` / `unsigned char`, so using unsigned codegen should
be possible.

Additional tests for #1308.  These are things we want to generate better
code for, so add tests that the behavior doesn't change.
2020-11-09 21:20:16 +01:00
Jesse Rosenstock 5db74b4b19 Use u16 codegen for u8 x u8 ops
In g_typeadjust, before we apply the integral promotions, we check if
both types are unsigned char.  If so, we promote to unsigned int, rather
than int, which would be chosen by the standard rules.  This is only a
performance optimization and does not affect correctness, as the flags
returned by g_typeadjust are only used for code generation, and not to
determine types of other expressions containing this one.  All unsigned
char bit-patterns are valid as both int and unsigned int and represent
the same value, so either signed or unsigned int operations can be used.
This special case part is not duplicated by ArithmeticConvert.

Partial fix for #1308.
2020-11-09 21:19:22 +01:00
Jesse Rosenstock 0e482c7f92 Add test for issue #1310 2020-11-01 19:09:20 +01:00
Jesse Rosenstock a686988d0e Add test cases for integral promotion of chars
Both signed and unsigned chars are promoted to int by C's evaluation
rules.  It is more efficient to use unsigned operations when possible,
however.  These tests will help test the correctness of optimizations
doing that.  See #1308.
2020-10-29 13:54:37 +01:00
Jesse Rosenstock 81550ca1ee CS_MergeLabels: Keep labels referenced by data
Partial fix for ICE in #1211.  This may fix enough to allow #1049 to be
fixed.

When merging labels, keep the first label with a ref that has no JumpTo;
this is a data segment label, used by computed gotos.

The real fix is to track and rewrite labels in data, but this is more
involved.
2020-10-08 12:11:03 +02:00
Jesse Rosenstock b931e65811 Fix ICE for bit-fields with typedef
Fixes #1267

Avoid ICE, but treat plain int bit-fields declared via typedef as
signed rather than unsigned.  It is more efficient to treat them
as unsigned, but this requires distinguishing int from signed int,
and this is curently not done.
2020-10-03 15:04:31 +02:00
Oliver Schmidt 4acdc9ced9 Fixed paramcount build. 2020-10-03 14:55:30 +02:00
mrdudz b549e83fb2 move program from testcode/assembler to test/asm and remove testcode/assembler 2020-09-29 19:03:42 +02:00
mrdudz 34177d9edd test related to issue #1094 2020-09-25 20:08:32 +02:00
mrdudz 7ff08c85cf Merge branch 'master' of https://github.com/cc65/cc65 2020-09-25 16:25:53 +02:00
mrdudz 61d934fd7b test related to issue #1265 2020-09-25 16:25:32 +02:00
Greg King 47ee179273 Fixed a copy & paste error in the test/misc/ makefile.
Fixed a warning that's changed to an error in Travis CI tests.
2020-09-25 00:31:07 -04:00