1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-25 17:29:50 +00:00
cc65/test/ref/goto.c
laubzega 4b78d40e97 Added testcase for between-blocks gotos.
Deleted old testcase.
2018-10-02 18:49:53 +02:00

36 lines
557 B
C

#include <stdio.h>
int main () {
char a[200] = "xyz";
int ctr = 0;
start:
a[ctr] = ctr + 65;
goto second;
{
char b[64] = "xxx";
first:
b[0] = ctr + 97;
goto safe;
b[0] = 'Z';
safe:
printf ("%c%c", a[0], b[0]);
if (ctr++ > 20)
goto end;
else
goto second;
}
{
char c[100] = "aaa";
second:;
c[0] = '1';
c[99] = '2';
goto first;
}
end:
a[ctr] = '\n';
printf ("\n%s\n", a);
return 0;
}