mirror of
https://github.com/cc65/cc65.git
synced 2025-01-16 13:31:16 +00:00
rework test for issue #1075 to return an exit code
This commit is contained in:
parent
a0c80a8c72
commit
42c162c15e
@ -97,6 +97,7 @@ $(WORKDIR)/bug1048.$1.$2.prg: bug1048.c | $(WORKDIR)
|
|||||||
$(WORKDIR)/bug1075.$1.$2.prg: bug1075.c | $(WORKDIR)
|
$(WORKDIR)/bug1075.$1.$2.prg: bug1075.c | $(WORKDIR)
|
||||||
$(if $(QUIET),echo misc/bug1075.$1.$2.prg)
|
$(if $(QUIET),echo misc/bug1075.$1.$2.prg)
|
||||||
$(CL65) -t sim$2 -$1 -o $$@ $$< $(NULLERR)
|
$(CL65) -t sim$2 -$1 -o $$@ $$< $(NULLERR)
|
||||||
|
$(SIM65) $(SIM65FLAGS) $$@ $(NULLOUT) $(NULLERR)
|
||||||
|
|
||||||
# should compile, but then hangs in an endless loop
|
# should compile, but then hangs in an endless loop
|
||||||
$(WORKDIR)/endless.$1.$2.prg: endless.c | $(WORKDIR)
|
$(WORKDIR)/endless.$1.$2.prg: endless.c | $(WORKDIR)
|
||||||
|
@ -1,10 +1,31 @@
|
|||||||
/* bug #1075 Internal compiler error */
|
/* bug #1075 Internal compiler error */
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
long rhs;
|
long rhs;
|
||||||
|
|
||||||
int main(void)
|
int test(void)
|
||||||
{
|
{
|
||||||
/* the whole lhs is errorneously treated as an absolute address (integer
|
/* the whole lhs is errorneously treated as an absolute address (integer
|
||||||
constant) neglecting its dereference */
|
constant) neglecting its dereference */
|
||||||
return *(char *)0xD77C + rhs;
|
return *(char *)0xD77C + rhs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int res;
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
memset(*(char *)0xD76C, 11, 0x80);
|
||||||
|
rhs = 0x10;
|
||||||
|
*(char *)(0xD77C + rhs) = 13;
|
||||||
|
*(char *)0xD77C = 23;
|
||||||
|
*(char *)0xD78C = 42;
|
||||||
|
res = test();
|
||||||
|
printf("res: %d\n", res);
|
||||||
|
if (res != (23 + 0x10)) {
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user