mirror of
https://github.com/cc65/cc65.git
synced 2025-01-26 17:36:57 +00:00
Added a more general test to test/val/bug1690.c
This commit is contained in:
parent
1579d2ec41
commit
74bdc06529
@ -2,22 +2,29 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
static int failures = 0;
|
||||
static unsigned int z = 0xFF23;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
register unsigned int x = 0x200;
|
||||
register unsigned int y = 0;
|
||||
|
||||
do
|
||||
{
|
||||
do {
|
||||
++y;
|
||||
} while (--x);
|
||||
if (y != 0x200) {
|
||||
printf("y should be 0x200, not 0x%X.\n", y);
|
||||
++failures;;
|
||||
}
|
||||
while (--x);
|
||||
|
||||
if (y != 0x200)
|
||||
{
|
||||
printf("0x%X\n", y);
|
||||
return 1;
|
||||
}
|
||||
if ((z -= 0x23)) {
|
||||
/* Passed -- non-zero z looks like non-zero. */
|
||||
} else {
|
||||
/* Failed -- only the low byte of z was tested. */
|
||||
printf("Test thinks non-zero z is zero.\n");
|
||||
++failures;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return failures;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user