Skip to content

Commit

Permalink
Overlooked a few target tests that take the address of main().
Browse files Browse the repository at this point in the history
  • Loading branch information
kugelfuhr committed Sep 2, 2024
1 parent cd43570 commit 79606c4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion targettest/atari/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ unsigned int *MEMTOP = (unsigned int *)741;
unsigned int *MEMLO = (unsigned int *)743;
void *allocmem;

void code(void) { }

int main(void)
{
allocmem = malloc(257);
Expand All @@ -35,7 +37,7 @@ int main(void)
printf(" MEMLO = $%04X (%u)\n", *MEMLO, *MEMLO);

printf(" ----------------------\n");
printf(" main: $%04X (code)\n", &main);
printf(" code: $%04X (code)\n", &code);
printf(" data: $%04X (data)\n", &data);
printf(" _dos_type: $%04X (bss)\n", &_dos_type);
printf(" allocmem: $%04X (dyn. data)\n", allocmem);
Expand Down
4 changes: 3 additions & 1 deletion targettest/pce/conio.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ static char hex[16] = { "0123456789abcdef" };
static char charbuf[0x20];
static char colbuf[0x20];

void func(void) { }

void main(void)
{
int stackvar = 42;
Expand Down Expand Up @@ -65,7 +67,7 @@ void main(void)
p[8],p[9],p[10],p[11],p[12],p[13],p[14],p[15]
);
}
memcpy(p, main, i = 0); /* test that a zero length doesn't copy 64K */
memcpy(p, func, i = 0); /* test that a zero length doesn't copy 64K */

gotoxy(0,ysize - 1);
for (i = 0; i < xsize; ++i) {
Expand Down
4 changes: 3 additions & 1 deletion targettest/scanf-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,14 @@ static void Pause(void) {
#endif
}

static void Nil() { }

int main(void) {
long n0;
unsigned t;
int c, n1 = 12345, n2, n3;
char s1[80], s2[80];
void *p1 = main, *p2 = main, *p3 = main, *p4 = main;
void *p1 = Nil, *p2 = Nil, *p3 = Nil, *p4 = Nil;

#ifndef USE_STDIO
clrscr();
Expand Down

0 comments on commit 79606c4

Please sign in to comment.