Commit Graph

33 Commits

Author SHA1 Message Date
acqn 96d55e3703 Fixed optimization for char-size bitwise XOR/OR/AND when the rhs operand is complicated. 2024-02-02 19:00:33 +08:00
Colin Leroy-Mira 1e300bf768 Add test case for issue #2395 2024-02-01 22:06:56 +01:00
acqn 2324bd62f6 If __A__,__AX__ or __EAX__ is used, post-inc/dec within the same statement will not modify it.
Moved testcase from src/test/todo to src/test/val plus minor improvement on portability.
2021-06-08 14:16:14 +08:00
bbbradsmith 5c20fb2812 test/todo makefile uses testwrk/val by mistake 2023-05-05 11:28:42 -04: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
mrdudz c1fd3218df add test related to pr #1799 2022-08-11 00:59:09 +02:00
mrdudz 5164b88a27 test was moved to test/val 2022-07-26 17:21:33 +02: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
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 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 080cb1bac9 added testcase for issue #1462 2021-04-23 21:52:36 +02:00
acqn da4cc08b78 Moved and improved test case for Issue #1310. 2021-02-22 14:14:59 -05: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 0e482c7f92 Add test for issue #1310 2020-11-01 19:09:20 +01:00
Oliver Schmidt c658acbf85 Avoid cl65 in tests.
cl65 creates intermediate files based on the source file name in the source file directory. Calling cl65 in parallel with the same source file causes those intermediate files to get overwritten.

Fixes #1080
2020-08-26 20:39:34 +02:00
acqn 0486d28abc Fixed Issue #327. 2020-08-22 13:44:18 +02:00
Jesse Rosenstock ff535b8e1a Treat signed int bit-fields as signed
Prior to this PR, `int`, `signed int`, and `unsigned int`
bitfields are all treated as `unsigned int`.

With this PR, `signed int` will be treated as `signed int`,
and the others remain unsigned.

Since `Type` does not distinguish between `int` and `signed int`,
add an extra `int* SignenessSpecified` param to `ParseTypeSpec`
so we can tell these apart for bit-fields and treat plain `int : N`
as `unsigned int : N` since it is more efficient to zero-extend
than sign-extend.

Fixes #1095
2020-08-18 12:23:20 +02:00
Jesse Rosenstock c4698dfd07 Use C89 semantics for integer conversions
Previously, the following rules were used for binary operators:
* If one of the values is a long, the result is long.
* If one of the values is unsigned, the result is also unsigned.
* Otherwise the result is an int.

C89 specifies the "usual arithmetic conversions" as:
* The integral promotions are performed on both operands.
* Then the following rules are applied:
  * If either operand has type unsigned long int, the other operand is
    converted to unsigned long int.
  * Otherwise, if one operand has type long int and the other has type
    unsigned int, if a long int can represent all values of an unsigned int,
    the operand of type unsigned int is converted to long int; if a long int
    cannot represent all the values of an unsigned int, both operands are
    converted to unsigned long int.
  * Otherwise, if either operand has type long int, the other operand is
    converted to long int.
  * Otherwise, if either operand has type unsigned int, the other operand is
    converted to unsigned int.
  * Otherwise, both operands have type int.
https://port70.net/~nsz/c/c89/c89-draft.html#3.2.1.5

As one example, these rules give a different result for an operator
with one long operand and one unsigned int operand.  Previously,
the result type was unsigned long.  With C89 semantics, it is just long,
since long can represent all unsigned ints.

Integral promotions convert types shorter than int to int (or unsigned int).
Both char and unsigned char are promoted to int since int can represent
all unsigned chars.
https://port70.net/~nsz/c/c89/c89-draft.html#3.2.1.1

Rename promoteint to ArithmeticConvert, since this is more accurate.

Fixes #170
2020-08-15 19:14:31 +02:00
Jesse Rosenstock 847982c6bf Handle bit-field test after shift/mask
Previously, bit-field tests were incorrectly combined with load in
`if (x.bitfield)`.  Delay the test until after the shift/mask
is done.  Still combine tests with load if no shift/mask is required.

Fixes #1139
2020-07-31 19:33:28 +02:00
Jesse Rosenstock c72fa735b9 Add test for #1139 2020-07-30 19:13:19 +02:00
Jesse Rosenstock c0f2b69bef Add test case for sign extending < 1 byte 2020-07-28 22:01:22 +02:00
mrdudz 6abf24e25e move test for issue #1077 to test/val 2020-07-22 15:12:02 +02:00
Jesse Rosenstock bbcb39978c Add test of signed bitfields for #1095 2020-07-19 11:05:27 +02:00
mrdudz 5ad365c5df some tweaks to the moved tests to make them more suitable for automatic testing 2020-07-13 21:26:07 +02:00
mrdudz 882194c221 move a bunch of tests from testcode/lib to test/val (and a failing one to test/todo) 2020-07-13 21:25:13 +02:00
mrdudz 579b50f0c5 test for issue #927 2020-07-09 16:18:08 +02:00
mrdudz 2428285694 test for issue #327 2020-07-09 16:17:31 +02:00
mrdudz ff18218b0a test for issue #170 2020-07-09 16:17:16 +02:00
mrdudz 5925a7f8ee test for issue #1077 2020-07-09 16:16:46 +02:00
Oliver Schmidt 0f8b587bc2 Added directory for currently failing regression tests. 2020-07-01 00:13:55 +02:00