Files
cc65/test/val/bug2811.c
2026-03-05 18:44:33 +01:00

28 lines
553 B
C

/* Note: This test is rather fragile since it depends on how the compiler
** handles certain sequences and return codes. It checks for exactly one
** optimizer problem introduced in #2811. If it fails in some future version,
** do not hesitate to remove it.
*/
#include <stdio.h>
static unsigned char test(unsigned v)
{
(void)v;
asm("jsr popax");
asm("lda #0");
return __A__;
}
int main(void)
{
if (test(1)) {
printf("Test failed\n");
return 1;
} else {
printf("Test ok\n");
return 0;
}
}