added tests as prepared by oliver

This commit is contained in:
mrdudz
2014-09-24 16:45:10 +02:00
committed by Ingo Korb
parent d75f9c2051
commit ca300826cf
121 changed files with 25206 additions and 0 deletions

31
test/ref/cc65090913.c Normal file
View File

@@ -0,0 +1,31 @@
/*
!!DESCRIPTION!! optimizer bug
!!ORIGIN!! testsuite
!!LICENCE!! Public Domain
!!AUTHOR!! Oliver Schmidt
*/
/*
> I found the problem and fixed it. cc65 treated a label as a statement, but
> the standard says, that a label is part of a statement. In a loop without
> curly braces like
>
> while (foo < bar)
> label: ++foo;
>
> the following statement is the one that is looped over - and because cc65
> treated just the label as a statement, it created code that looped forever.
*/
int foo=0,bar=2;
int main(void)
{
while(foo<bar)
label: ++foo;
printf("foo: %d bar: %d\n",foo,bar);
return 0;
}