mirror of
https://github.com/cc65/cc65.git
synced 2024-11-16 18:08:04 +00:00
Added testcase for Issue #1408.
This commit is contained in:
parent
d628772cd1
commit
6f5ad51816
41
test/val/bug1408.c
Normal file
41
test/val/bug1408.c
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/* Bug #1408: Signed char type comparisons with unsigned numeric constants */
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
static int failures = 0;
|
||||||
|
static signed char x = -1;
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
if (!(x > -2u)) {
|
||||||
|
printf("x > -2u should be true\n");
|
||||||
|
++failures;
|
||||||
|
}
|
||||||
|
if (!(x > 0u)) {
|
||||||
|
printf("x > 0u should be true\n");
|
||||||
|
++failures;
|
||||||
|
}
|
||||||
|
if (!(x > 255u)) {
|
||||||
|
printf("x > 255u should be true\n");
|
||||||
|
++failures;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(-2u < x)) {
|
||||||
|
printf("-2u < x should be true\n");
|
||||||
|
++failures;
|
||||||
|
}
|
||||||
|
if (!(0u < x)) {
|
||||||
|
printf("0u < x should be true\n");
|
||||||
|
++failures;
|
||||||
|
}
|
||||||
|
if (!(255u < x)) {
|
||||||
|
printf("255u < x should be true\n");
|
||||||
|
++failures;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (failures != 0) {
|
||||||
|
printf("Failures: %d\n", failures);
|
||||||
|
}
|
||||||
|
|
||||||
|
return failures;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user