move test for issue #1075 to test/var

This commit is contained in:
mrdudz
2020-07-21 20:02:51 +02:00
parent 42c162c15e
commit 145084c41c
2 changed files with 0 additions and 6 deletions

View File

@@ -93,12 +93,6 @@ $(WORKDIR)/bug1048.$1.$2.prg: bug1048.c | $(WORKDIR)
$(if $(QUIET),echo misc/bug1048.$1.$2.prg)
$(CL65) -t sim$2 -$1 -o $$@ $$< $(NULLERR)
# compiles, but we cant easily check if it works
$(WORKDIR)/bug1075.$1.$2.prg: bug1075.c | $(WORKDIR)
$(if $(QUIET),echo misc/bug1075.$1.$2.prg)
$(CL65) -t sim$2 -$1 -o $$@ $$< $(NULLERR)
$(SIM65) $(SIM65FLAGS) $$@ $(NULLOUT) $(NULLERR)
# should compile, but then hangs in an endless loop
$(WORKDIR)/endless.$1.$2.prg: endless.c | $(WORKDIR)
$(if $(QUIET),echo misc/endless.$1.$2.prg)

View File

@@ -1,31 +0,0 @@
/* bug #1075 Internal compiler error */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
long rhs;
int test(void)
{
/* the whole lhs is errorneously treated as an absolute address (integer
constant) neglecting its dereference */
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;
}